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(sequencers): added MsgUpsertSequencer #568

Merged
merged 9 commits into from
Oct 13, 2024

Conversation

keruch
Copy link
Contributor

@keruch keruch commented Oct 4, 2024

Description


ADR link https://www.notion.so/dymension/ADR-x-Sequencer-Reward-Address-On-Rollapp-da84af6888c141d0a4c1a8df256a5025
Closes dymensionxyz/dymension#1248

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
Copy link
Contributor

danwt commented Oct 7, 2024

build fail

Base automatically changed from feat/consensus-messages to main October 8, 2024 16:47
@keruch keruch changed the base branch from main to feat/consensus-messages October 9, 2024 10:27
Base automatically changed from feat/consensus-messages to main October 9, 2024 16:28
proto/sequencers/tx.proto Outdated Show resolved Hide resolved
x/sequencers/keeper/msg_server.go Outdated Show resolved Hide resolved
x/sequencers/types/helpers.go Outdated Show resolved Hide resolved
@keruch keruch requested a review from zale144 October 10, 2024 10:02
@@ -0,0 +1,71 @@
// Package uevent is a copy of https://github.com/dymensionxyz/sdk-utils/tree/main/utils/uevent.
// TODO: import sdk-utils directly when the RDK is updated to SDK v0.47 and further.
Copy link
Collaborator

Choose a reason for hiding this comment

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

we have sdk-util's branch dedicated for the RDK (based on v0.46)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's deeply outdated :(

// all must-methods are safe to use since they're validated in ValidateBasic

v := msg.MustValidator()
m.SetSequencer(ctx, v)
Copy link
Collaborator

Choose a reason for hiding this comment

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

validate it's not already exists?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the next PR (for Whitelisted Relayer ADR) we'll assume that the hub is the source of truth, so the upsert will become an honest upsert independently of the record existence. i'll keep this code as it is for now if you don't mind, just not to do the extra work of reverting it in the next PR.

@@ -12,6 +11,8 @@ option go_package = "github.com/dymensionxyz/dymension-rdk/x/sequencers/types";
service Msg {
rpc CreateSequencer(MsgCreateSequencer) returns (MsgCreateSequencerResponse);
Copy link
Collaborator

Choose a reason for hiding this comment

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

CreateSequencer should be removed if there's no use case for it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i'll remove it in the next PR as well if you don't mind. i'm gonna refactor the whole msg server there.

"github.com/cosmos/cosmos-sdk/types/bech32"
)

func Bech32ToAddr[T sdk.AccAddress | sdk.ValAddress](addr string) (T, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

move to utils/addressutils

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@keruch keruch requested a review from mtsitrin October 10, 2024 15:54
Copy link
Contributor

@zale144 zale144 left a comment

Choose a reason for hiding this comment

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

lgtm

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.

is CreateSequencer still needed? seems to me it can cause a situation where an operator basically can cause a collision as he may create a sequencer using connecting an already existing consensusAddr to a different bech32 address (vs the default settlement address).

update - just saw @mtsitrin already commented on it

@mtsitrin mtsitrin merged commit 69c1b7c into main Oct 13, 2024
7 checks passed
@mtsitrin mtsitrin deleted the kirill/1248-sequencer-reward-addr branch October 13, 2024 06:56
@keruch keruch restored the kirill/1248-sequencer-reward-addr branch October 16, 2024 15:44
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.

Sequencer Reward Address On Rollapp - Impl
5 participants