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(rollapp): new rollapp registration flow #980

Merged
merged 35 commits into from
Aug 2, 2024

Conversation

zale144
Copy link
Contributor

@zale144 zale144 commented Jul 6, 2024

Description


Closes #978

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
  • Updated the scripts for local run, e.g genesis_config_commands.sh if the PR changes parameters
  • 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.

@zale144 zale144 self-assigned this Jul 6, 2024
@zale144 zale144 changed the title feat(rollapp) new rollapp registration flow feat(rollapp): new rollapp registration flow Jul 8, 2024
@zale144 zale144 marked this pull request as ready for review July 11, 2024 15:11
@zale144 zale144 requested a review from a team as a code owner July 11, 2024 15:11
@omritoptix omritoptix linked an issue Jul 18, 2024 that may be closed by this pull request
4 tasks
proto/dymensionxyz/dymension/rollapp/rollapp.proto Outdated Show resolved Hide resolved
x/rollapp/keeper/rollapp.go Outdated Show resolved Hide resolved
x/rollapp/types/params.go Outdated Show resolved Hide resolved
x/rollapp/types/params.go Outdated Show resolved Hide resolved
x/rollapp/types/rollapp.go Show resolved Hide resolved
x/rollapp/keeper/rollapp.go Show resolved Hide resolved
x/rollapp/keeper/rollapp.go Outdated Show resolved Hide resolved
x/rollapp/types/rollapp.go Show resolved Hide resolved
@zale144 zale144 requested a review from mtsitrin July 22, 2024 10:36
Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

Looks like nice work Alex but I left some comments. Some of the comments are more minor and are just suggestions where you can use your own judgement if you want to change or fix or not. Some are more important, here is a summary of the important stuff

  1. Why renaming/changing existing proto fields? Stuff should be reserved/depcrecated. Does it even work in migration as is?
  2. Can we dedupe proto between update and create? extract a common type
  3. Validation of strings which are used in keys. E.g. alias not validated
  4. Please use gerrc libray and errorsmod.Wrap to define errors, and use errors.Join to combine them , there are examples in the code already https://pkg.go.dev/github.com/dymensionxyz/gerr-cosmos@v1.0.0/gerrc. Since error handling is like 50% of go code it's important to do it well
  5. regex compilation
  6. warn/document expensive methods

Also please dont name stuff checkIfCan.. , just do can..

app/upgrades/v4/types/params.go Outdated Show resolved Hide resolved
app/upgrades/v4/upgrade.go Outdated Show resolved Hide resolved
app/upgrades/v4/upgrade_test.go Outdated Show resolved Hide resolved
oldRollapps = make([]types.Rollapp, nRollapps)
newRollapps = make([]rollapptypes.Rollapp, nRollapps)

for i := 0; i < nRollapps; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

for range nRollapps

proto/dymensionxyz/dymension/rollapp/metadata.proto Outdated Show resolved Hide resolved
x/rollapp/types/params.go Show resolved Hide resolved
x/rollapp/types/params.go Outdated Show resolved Hide resolved
x/rollapp/types/rollapp.go Show resolved Hide resolved
x/rollapp/types/rollapp.go Show resolved Hide resolved
x/rollapp/types/rollapp.go Outdated Show resolved Hide resolved
Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

accidentaly approved before

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.

Generally looks good.
small comments/questions.

proto/dymensionxyz/dymension/rollapp/metadata.proto Outdated Show resolved Hide resolved
proto/dymensionxyz/dymension/rollapp/rollapp.proto Outdated Show resolved Hide resolved
proto/dymensionxyz/dymension/sequencer/metadata.proto Outdated Show resolved Hide resolved
x/rollapp/keeper/rollapp.go Outdated Show resolved Hide resolved
Comment on lines 164 to 166
func (k Keeper) checkIfRollappExists(ctx sdk.Context, id, alias string) error {
rollappId, err := types.NewChainID(id)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1. I'd say it's more of a validation of params than checking if one exists. cause if it exists and frozen it may still be valid.

x/rollapp/keeper/rollapp.go Outdated Show resolved Hide resolved
x/sequencer/keeper/msg_server_create_sequencer.go Outdated Show resolved Hide resolved
x/sequencer/types/metadata.go Outdated Show resolved Hide resolved
@zale144 zale144 requested a review from omritoptix July 31, 2024 11:11
mtsitrin
mtsitrin previously approved these changes Jul 31, 2024
Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

still awaiting proto fix with field reservations etc

app/upgrades/v4/upgrade.go Outdated Show resolved Hide resolved
app/upgrades/v4/upgrade.go Outdated Show resolved Hide resolved
Comment on lines 19 to 21
// registration_fee is the fee that is required to register a rollapp
cosmos.base.v1beta1.Coin registration_fee = 2
[ (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"registration_fee\"" ];
Copy link
Contributor

Choose a reason for hiding this comment

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

still not fixed

@zale144 zale144 requested review from danwt and mtsitrin August 1, 2024 15:16
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 37.74803% with 2604 lines in your changes missing coverage. Please review.

Project coverage is 26.52%. Comparing base (1f3b48f) to head (33c9f35).
Report is 10 commits behind head on main.

Files Patch % Lines
x/sequencer/types/metadata.pb.go 42.84% 557 Missing and 130 partials ⚠️
x/rollapp/types/tx.pb.go 17.88% 533 Missing and 27 partials ⚠️
x/sequencer/types/tx.pb.go 3.57% 347 Missing and 4 partials ⚠️
x/rollapp/types/metadata.pb.go 38.98% 234 Missing and 43 partials ⚠️
x/rollapp/types/rollapp.pb.go 54.28% 84 Missing and 28 partials ⚠️
x/rollapp/types/query.pb.go 39.53% 89 Missing and 15 partials ⚠️
x/rollapp/types/query.pb.gw.go 0.00% 79 Missing ⚠️
x/rollapp/client/cli/tx_update_rollapp.go 0.00% 48 Missing ⚠️
x/rollapp/types/rollapp.go 62.72% 27 Missing and 14 partials ⚠️
x/sequencer/client/cli/tx.go 0.00% 37 Missing ⚠️
... and 31 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #980      +/-   ##
==========================================
- Coverage   28.42%   26.52%   -1.91%     
==========================================
  Files         253      304      +51     
  Lines       33786    48934   +15148     
==========================================
+ Hits         9605    12980    +3375     
- Misses      22820    33932   +11112     
- Partials     1361     2022     +661     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@omritoptix
Copy link
Contributor

tests are failing cause we still don't support the new rollapp registration flow in the e2e tests.

@omritoptix omritoptix merged commit afd8254 into main Aug 2, 2024
11 of 118 checks passed
@omritoptix omritoptix deleted the zale144/978-new-create-rollapp-design branch August 2, 2024 12:35
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.

Add extra fields for new rollapp registration flow Update rollapp create process with new design
4 participants