Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(hub-genesis): whitelisted address trigger genesis transfer #625

Merged
merged 33 commits into from
Dec 10, 2024

Conversation

danwt
Copy link
Contributor

@danwt danwt commented Dec 9, 2024

goes with dymensionxyz/dymension#1637

Description


Closes #624

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.

PR review checkboxes:

I have...

  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Targeted PR against the correct branch
  • included the correct type prefix in the PR title
  • Linked to the GitHub issue with discussion and accepted design
  • Targets only one GitHub issue
  • Wrote unit and integration tests
  • Wrote relevant migration scripts if necessary
  • All CI checks have passed
  • Added relevant godoc comments
  • Add an issue in the e2e-tests repo if necessary

SDK Checklist

  • Import/Export Genesis
  • Registered Invariants
  • Registered Events
  • Updated openapi.yaml
  • No usage of go map
  • No usage of time.Now()
  • Used fixed point arithmetic and not float arithmetic
  • Avoid panicking in Begin/End block as much as possible
  • No unexpected math Overflow
  • Used sendCoin and not SendCoins
  • Out-of-block compute is bounded
  • No serialized ID at the end of store keys
  • UInt to byte conversion should use BigEndian

Full security checklist here


For Reviewer:

  • Confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • Confirmed all author checklist items have been addressed

After reviewer approval:

  • In case the PR targets the main branch, PR should not be squash merge in order to keep meaningful git history.
  • In case the PR targets a release branch, PR must be rebased.

@danwt danwt marked this pull request as ready for review December 10, 2024 13:34
@danwt danwt requested a review from a team as a code owner December 10, 2024 13:34
@danwt danwt requested a review from mtsitrin December 10, 2024 15:22
@danwt danwt requested a review from mtsitrin December 10, 2024 15:50
mtsitrin
mtsitrin previously approved these changes Dec 10, 2024
mtsitrin
mtsitrin previously approved these changes Dec 10, 2024
return err
}

if !ack.Success() {
w.logger(ctx).Error("acknowledgement failed for genesis transfer", "packet", packet, "ack", ack)
return errors.New("acknowledgement failed for genesis transfer")
// something wrong - need to fix the hub with gov prop and try to send transfer again
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why u removed the logging?

if !state.CanonicalHubTransferChannelHasBeenSet() {
state.SetCanonicalTransferChannel(port, channelID)
}
if state.HubPortAndChannel.Channel != channelID {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets assume a bug in relayer and sent wrong channel id with the hub.
in that case after first attempt we're gonna set it (SetCanonicalTransferChannel).
Than we find out it's acutally a different channel which is the canonical on the hub.
Than we try again, but fail with channel id mismatch.

Why dot we not simply try every time with the passed channel given we're not in flight (vs setting the first channel attempt as the only one)? ( we will need to clear the canonical transfser channel on ack err though)

Copy link
Contributor

@omritoptix omritoptix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work! small comment/question

@omritoptix omritoptix changed the title feat(hub-genesis): Relayer triggered genesis transfer feat(hub-genesis): whitelisted address trigger genesis transfer Dec 10, 2024
@omritoptix omritoptix merged commit 3d910ef into main Dec 10, 2024
5 of 7 checks passed
@omritoptix omritoptix deleted the danwt/624-relayer-genesis-transfer branch December 10, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relayer triggered genesis transfer
4 participants