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): remove alias from rollapp #1034

Merged
merged 7 commits into from
Aug 7, 2024

Conversation

zale144
Copy link
Contributor

@zale144 zale144 commented Aug 2, 2024

Description


Closes #1032

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.

Summary by CodeRabbit

  • New Features

    • Enhanced validation and error handling in rollapp-related functions.
    • Introduction of event handling for liquidity pool activities.
  • Bug Fixes

    • Temporarily disabled funding mechanisms for accounts during rollapp creation.
  • Improvements

    • Removed the concept of an alias for rollapps, simplifying querying and registration processes.
    • Streamlined command structures for rollapp operations.
    • Updated rollapp management logic to improve robustness and simplify the API.
  • Chores

    • Cleaned up and reorganized code to remove unused parameters and dependencies.

@zale144 zale144 self-assigned this Aug 2, 2024
@zale144 zale144 requested a review from a team as a code owner August 2, 2024 13:27
@zale144 zale144 force-pushed the zale144/1032-handle-alias-in-x/dymns branch from 24068a1 to b9d863e Compare August 2, 2024 13:39
@zale144 zale144 changed the title feat(rollapp): Handle alias registration and updating in x/dymns feat(rollapp): Remove alias registration and updating from x/rollapp Aug 2, 2024
@mtsitrin
Copy link
Contributor

mtsitrin commented Aug 5, 2024

no more registration_fee?
how we'll prevent someone from exhausting the eip1559 keyspace?

@omritoptix omritoptix linked an issue Aug 5, 2024 that may be closed by this pull request
@omritoptix
Copy link
Contributor

@mtsitrin there is a registration fee, it's just charged on dymns module.

@omritoptix omritoptix changed the title feat(rollapp): Remove alias registration and updating from x/rollapp feat(rollapp): remove alias registration and updating from x/rollapp Aug 7, 2024
@omritoptix omritoptix changed the title feat(rollapp): remove alias registration and updating from x/rollapp feat(rollapp): remove alias registration fee Aug 7, 2024
@omritoptix omritoptix changed the title feat(rollapp): remove alias registration fee feat(rollapp): remove alias from rollapp Aug 7, 2024
Copy link
Contributor

coderabbitai bot commented Aug 7, 2024

Walkthrough

The recent changes streamline the rollapp registration process by relocating alias handling to the x/dymns module. This update enhances the clarity and maintainability of the codebase, ensuring a more straightforward and consistent registration logic while removing unnecessary complexity from various components.

Changes

File Path Change Summary
app/apptesting/test_suite.go, x/incentives/*.go Commented out funding account lines, disabling registration fee funding.
app/keepers/keepers.go Removed a.BankKeeper from InitKeepers function parameters, altering dependency management.
app/params/encoding.go Modified EncodingConfig, retaining StakePerAccount, removed InitiallyBondedValidators.
app/upgrades/v4/*.go Adjustments to RPC methods, focusing on alias removal and simplifying data structures.
proto/dymensionxyz/dymension/rollapp/*.proto Removed registration_fee and RollappByAlias RPC method, along with related message definitions.
x/rollapp/*.go General removal of references to alias across methods and structures, simplifying rollapp handling.
x/delayedack/*.go Adjusted IBCMiddleware struct by adding StubRollappCreatedHooks and removing old methods.

Assessment against linked issues

Objective Addressed Explanation
Move alias handling for rollapp registration to x/dymns (#[1032])

🐰 In the meadow where the rollapps play,
Gone are the aliases, hip-hip-hooray!
With simpler paths and clearer ways,
We'll hop along through sunny days!
Change brings joy, let's dance and sway! 🌼✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

omritoptix
omritoptix previously approved these changes Aug 7, 2024
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.

small naming comment. but still approved.

x/rollapp/keeper/msg_server_update_rollapp.go Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (5)
x/common/types/stub_hooks.go (1)

1-9: Add comments to explain the purpose of the stub hooks.

Adding comments to explain the purpose of these stub implementations would enhance readability and maintainability.

// StubGammHooks is a no-op implementation of the GammHooks interface.
// It is used for testing or as a placeholder.
type StubGammHooks struct{}

// AfterJoinPool is a no-op implementation.
func (StubGammHooks) AfterJoinPool(ctx sdk.Context, addr sdk.AccAddress, poolID uint64, coins sdk.Coins, share sdk.Int) {}

// AfterExitPool is a no-op implementation.
func (StubGammHooks) AfterExitPool(ctx sdk.Context, addr sdk.AccAddress, poolID uint64, share sdk.Int, coins sdk.Coins) {}

// AfterSwap is a no-op implementation.
func (StubGammHooks) AfterSwap(ctx sdk.Context, addr sdk.AccAddress, poolID uint64, input sdk.Coins, output sdk.Coins) {}
x/rollapp/keeper/keeper.go (1)

Verify the impact of removing bankKeeper from NewKeeper.

The bankKeeper parameter has been removed from the NewKeeper function signature. However, there are still references to bankKeeper within the x/rollapp module, specifically in module.go and module_simulation.go. Ensure that any initialization logic and functionality relying on bankKeeper in these files are updated accordingly.

  • x/rollapp/module.go
  • x/rollapp/module_simulation.go
Analysis chain

Line range hint 22-33:
Verify the impact of removing bankKeeper from NewKeeper.

The bankKeeper parameter has been removed from the NewKeeper function signature. Ensure that any initialization logic relying on bankKeeper is updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `bankKeeper` from `NewKeeper`.

# Test: Search for the usage of `NewKeeper` in the codebase. Expect: No occurrences of the old function signature with `bankKeeper`.
rg --type go -A 5 'NewKeeper'

Length of output: 14140


Script:

#!/bin/bash
# Description: Search for references to `bankKeeper` within the `x/rollapp` module to verify the impact of its removal.

# Test: Search for the usage of `bankKeeper` in the `x/rollapp` module. Expect: No occurrences of `bankKeeper`.
rg --type go 'bankKeeper' x/rollapp

Length of output: 425

app/upgrades/v4/upgrade.go (1)

147-147: Issues found with the removal of the Alias field.

The Alias field is still referenced in multiple places across the codebase, including test files, protobuf files, and various Go files. Removing this field from ConvertOldRollappToNew could introduce issues.

  • x/rollapp/types/message_create_rollapp_test.go
  • x/rollapp/types/tx.pb.go
  • x/rollapp/types/errors.go
  • x/rollapp/types/message_create_rollapp.go
  • x/rollapp/simulation/create_rollapp.go
  • x/rollapp/keeper/msg_server_create_rollapp_test.go
  • x/rollapp/keeper/msg_server_update_rollapp_test.go
  • x/rollapp/keeper/msg_server_create_rollapp.go
  • x/incentives/keeper/suite_test.go
  • x/incentives/client/cli/query_test.go
  • x/denommetadata/keeper/keeper_test.go
  • app/apptesting/test_suite.go
  • cmd/dymd/cmd/root.go
Analysis chain

Verify the removal of the Alias field.

Ensure that the removal of the Alias field does not introduce any issues in the downstream logic that relies on this field.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the removal of the `Alias` field does not introduce any issues in the downstream logic.

# Test: Search for the usage of the `Alias` field. Expect: No occurrences of the `Alias` field in the codebase.
rg --type python -A 5 $'Alias'

Length of output: 60


Script:

#!/bin/bash
# Description: Verify that the removal of the `Alias` field does not introduce any issues in the downstream logic.

# Test: Search for the usage of the `Alias` field. Expect: No occurrences of the `Alias` field in the codebase.
rg --type go -A 5 'Alias'

Length of output: 18340

x/incentives/keeper/suite_test.go (1)

210-210: Reminder: Enable account funding after hooks are integrated.

The funding operation is temporarily disabled. Ensure to re-enable it after the x/dymns hooks are wired.

- // suite.FundAcc(addr, sdk.NewCoins(rollapptypes.DefaultRegistrationFee)) TODO: enable after x/dymns hooks are wired
+ suite.FundAcc(addr, sdk.NewCoins(rollapptypes.DefaultRegistrationFee)) // TODO: enable after x/dymns hooks are wired
x/rollapp/keeper/msg_server_create_rollapp_test.go (1)

20-20: Reminder: Enable the test after hooks are integrated.

The test is temporarily disabled. Ensure to re-enable it after the x/dymns hook is wired.

- suite.T().Skip() // TODO: enable after x/dymns hook is wired
+ // suite.T().Skip() // TODO: enable after x/dymns hook is wired
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2a8d639 and 6be9878.

Files ignored due to path filters (5)
  • x/rollapp/types/params.pb.go is excluded by !**/*.pb.go
  • x/rollapp/types/query.pb.go is excluded by !**/*.pb.go
  • x/rollapp/types/query.pb.gw.go is excluded by !**/*.pb.gw.go
  • x/rollapp/types/rollapp.pb.go is excluded by !**/*.pb.go
  • x/rollapp/types/tx.pb.go is excluded by !**/*.pb.go
Files selected for processing (50)
  • app/apptesting/test_suite.go (1 hunks)
  • app/keepers/keepers.go (1 hunks)
  • app/params/encoding.go (1 hunks)
  • app/upgrades/v4/upgrade.go (3 hunks)
  • app/upgrades/v4/upgrade_test.go (2 hunks)
  • go.mod (2 hunks)
  • ibctesting/utils_test.go (1 hunks)
  • proto/dymensionxyz/dymension/rollapp/params.proto (1 hunks)
  • proto/dymensionxyz/dymension/rollapp/query.proto (2 hunks)
  • proto/dymensionxyz/dymension/rollapp/rollapp.proto (1 hunks)
  • proto/dymensionxyz/dymension/rollapp/tx.proto (1 hunks)
  • testutil/keeper/rollapp.go (1 hunks)
  • x/common/types/stub_hooks.go (1 hunks)
  • x/delayedack/ibc_middleware.go (1 hunks)
  • x/delayedack/rollapp_hooks.go (2 hunks)
  • x/delayedack/types/genesis_test.go (1 hunks)
  • x/incentives/client/cli/query_test.go (1 hunks)
  • x/incentives/keeper/suite_test.go (1 hunks)
  • x/rollapp/client/cli/flags.go (2 hunks)
  • x/rollapp/client/cli/query.go (1 hunks)
  • x/rollapp/client/cli/query_rollapp.go (3 hunks)
  • x/rollapp/client/cli/tx_update_rollapp.go (3 hunks)
  • x/rollapp/keeper/block_height_to_finalization_queue_test.go (1 hunks)
  • x/rollapp/keeper/grpc_query_params_test.go (1 hunks)
  • x/rollapp/keeper/grpc_query_rollapp.go (1 hunks)
  • x/rollapp/keeper/keeper.go (3 hunks)
  • x/rollapp/keeper/msg_server_create_rollapp.go (1 hunks)
  • x/rollapp/keeper/msg_server_create_rollapp_test.go (10 hunks)
  • x/rollapp/keeper/msg_server_update_rollapp.go (1 hunks)
  • x/rollapp/keeper/msg_server_update_rollapp_test.go (8 hunks)
  • x/rollapp/keeper/msg_server_update_state_test.go (2 hunks)
  • x/rollapp/keeper/params.go (2 hunks)
  • x/rollapp/keeper/params_test.go (2 hunks)
  • x/rollapp/keeper/rollapp.go (7 hunks)
  • x/rollapp/keeper/rollapp_suite_test.go (1 hunks)
  • x/rollapp/types/errors.go (1 hunks)
  • x/rollapp/types/expected_keepers.go (1 hunks)
  • x/rollapp/types/genesis_test.go (5 hunks)
  • x/rollapp/types/hooks.go (2 hunks)
  • x/rollapp/types/key_rollapp.go (2 hunks)
  • x/rollapp/types/message_create_rollapp.go (1 hunks)
  • x/rollapp/types/message_create_rollapp_test.go (1 hunks)
  • x/rollapp/types/message_update_rollapp.go (3 hunks)
  • x/rollapp/types/message_update_rollapp_test.go (3 hunks)
  • x/rollapp/types/params.go (3 hunks)
  • x/rollapp/types/rollapp.go (6 hunks)
  • x/sequencer/keeper/hook_listener.go (3 hunks)
  • x/sequencer/keeper/msg_server_create_sequencer_test.go (1 hunks)
  • x/sequencer/keeper/sequencer_suite_test.go (1 hunks)
  • x/streamer/keeper/hooks.go (3 hunks)
Files skipped from review due to trivial changes (12)
  • go.mod
  • ibctesting/utils_test.go
  • testutil/keeper/rollapp.go
  • x/delayedack/types/genesis_test.go
  • x/rollapp/client/cli/flags.go
  • x/rollapp/client/cli/query.go
  • x/rollapp/keeper/params_test.go
  • x/rollapp/types/errors.go
  • x/rollapp/types/key_rollapp.go
  • x/rollapp/types/message_create_rollapp_test.go
  • x/rollapp/types/message_update_rollapp_test.go
  • x/sequencer/keeper/msg_server_create_sequencer_test.go
Additional comments not posted (72)
x/rollapp/types/expected_keepers.go (1)

Line range hint 1-9:
Verify the impact of removing the BankKeeper interface.

The removal of the BankKeeper interface is a significant change. Ensure that any code dependent on SendCoinsFromAccountToModule and BurnCoins has been updated accordingly.

app/params/encoding.go (1)

18-18: Verify the impact of removing the InitiallyBondedValidators constant.

The removal of the InitiallyBondedValidators constant may affect dependent code. Ensure that any code dependent on this constant has been updated accordingly.

Verification successful

No impact found from removing the InitiallyBondedValidators constant.

The search through the codebase, including Go files, markdown files, and YAML files, did not find any references to InitiallyBondedValidators. It appears that this constant is not used anywhere and its removal does not impact the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing the `InitiallyBondedValidators` constant.

# Test: Search for the usage of `InitiallyBondedValidators`. Expect: No occurrences or updated usage.
rg --type go 'InitiallyBondedValidators'

Length of output: 40


Script:

#!/bin/bash
# Re-verify the impact of removing the `InitiallyBondedValidators` constant by searching all files, not just Go files.

# Search for the usage of `InitiallyBondedValidators` in all files.
rg 'InitiallyBondedValidators'

Length of output: 30


Script:

#!/bin/bash
# Verify if `InitiallyBondedValidators` is referenced in comments, documentation, or configuration files.

# Search for the usage of `InitiallyBondedValidators` in comments within Go files.
rg '//.*InitiallyBondedValidators' --type go

# Search for the usage of `InitiallyBondedValidators` in markdown files.
rg 'InitiallyBondedValidators' --type md

# Search for the usage of `InitiallyBondedValidators` in YAML files.
rg 'InitiallyBondedValidators' --type yml

Length of output: 157


Script:

#!/bin/bash
# Verify if `InitiallyBondedValidators` is referenced in YAML files.

# Search for the usage of `InitiallyBondedValidators` in YAML files.
rg 'InitiallyBondedValidators' --type yaml

Length of output: 42

x/rollapp/keeper/grpc_query_params_test.go (1)

Line range hint 12-19:
Ensure adequate test coverage for Params functionality.

The removal of the line checking params.RegistrationFee reduces the test coverage for the Params functionality. Ensure that the Params functionality is still adequately tested, possibly in the x/dymns module.

proto/dymensionxyz/dymension/rollapp/params.proto (1)

Line range hint 9-18:
LGTM!

The removal of the registration_fee field simplifies the Params message and aligns with the PR's objective.

x/rollapp/keeper/params.go (1)

Line range hint 6-9:
LGTM!

The removal of the call to k.RegistrationFee(ctx) simplifies the GetParams method and aligns with the PR's objective.

x/delayedack/rollapp_hooks.go (2)

8-12: LGTM!

The AfterStateFinalized method correctly finalizes packets for the rollapp at the given height.


Line range hint 14-16:
LGTM!

The FraudSubmitted method correctly handles fraud submission for the rollapp.

x/rollapp/keeper/msg_server_update_rollapp.go (2)

15-17: Ensure comprehensive validation with msg.ValidateBasic().

The new validation step using msg.ValidateBasic() enhances the robustness of the function by ensuring that the message is valid before proceeding.


19-20: LGTM!

The logic for updating the rollapp has been improved by calling k.CanUpdateRollapp(ctx, msg) and updating the rollapp state with k.SetRollapp(ctx, updated).

Also applies to: 24-24

x/rollapp/keeper/msg_server_create_rollapp.go (4)

13-14: Ensure comprehensive validation with msg.ValidateBasic().

The new validation step using msg.ValidateBasic() enhances the robustness of the function by ensuring that the message is valid before proceeding.


19-20: LGTM!

The logic for checking the existence of the rollapp has been improved by creating a rollappId and checking for its existence with k.CheckIfRollappExists.


24-24: LGTM!

The function now sets the rollapp in the context with k.SetRollapp(ctx, msg.GetRollapp()), ensuring that the rollapp is correctly registered.


29-31: Capture and report hook execution issues.

The function now includes error handling for the rollapp creation hook, ensuring that any issues during the hook execution are captured and reported.

x/rollapp/types/message_create_rollapp.go (1)

68-70: Ensure ErrInvalidAlias is defined.

The added validation check for the Alias field is appropriate. Ensure that ErrInvalidAlias is correctly defined and used.

Verification successful

Ensure ErrInvalidAlias is defined.

The added validation check for the Alias field is appropriate. The ErrInvalidAlias is correctly defined in x/rollapp/types/errors.go.

  • x/rollapp/types/errors.go: ErrInvalidAlias = errorsmod.Wrap(gerrc.ErrInvalidArgument, "alias")
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the definition of `ErrInvalidAlias`.

# Test: Search for the definition of `ErrInvalidAlias`. Expect: Definition found.
rg --type go 'ErrInvalidAlias'

Length of output: 211

x/rollapp/client/cli/query_rollapp.go (1)

48-60: Simplified command usage and logic.

The changes to CmdShowRollapp simplify the command usage and internal logic by focusing solely on rollapp-id. This aligns with the PR's objective to centralize alias handling in the x/dymns module.

x/rollapp/client/cli/tx_update_rollapp.go (1)

15-17: Simplified command usage and logic.

The changes to CmdUpdateRollapp simplify the command usage and internal logic by removing the [alias] parameter. This aligns with the PR's objective to centralize alias handling in the x/dymns module.

x/rollapp/types/message_update_rollapp.go (3)

Line range hint 34-46:
Validation logic updated correctly.

The removal of the Alias validation is consistent with the changes. The remaining checks are appropriate.


69-69: Immutable values check updated correctly.

The removal of the Alias check is consistent with the changes. The remaining checks are appropriate.


16-22: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to NewMsgUpdateRollappInformation match the new signature.

Verification successful

All function calls to NewMsgUpdateRollappInformation match the new signature.

  • The function call in x/rollapp/client/cli/tx_update_rollapp.go correctly uses the new genesisChecksum parameter.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `NewMsgUpdateRollappInformation` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'NewMsgUpdateRollappInformation'

Length of output: 846


Script:

#!/bin/bash
# Description: Comprehensive search for all function calls to `NewMsgUpdateRollappInformation` to ensure they match the new signature.

# Test: Search for the function usage across the entire codebase.
rg --type go 'NewMsgUpdateRollappInformation'

Length of output: 214

x/sequencer/keeper/hook_listener.go (3)

14-16: Embedding of StubRollappCreatedHooks looks good.

The embedding of StubRollappCreatedHooks is consistent with the intended functionality.


20-22: Initialization of rollappHook improved.

The method now returns an instance of rollappHook initialized with the keeper instance k directly, improving clarity and conciseness.


Line range hint 48-60:
Parameter height correctly marked as unused.

The height parameter is replaced with an underscore (_), indicating it is no longer utilized. The method logic is consistent with the changes.

x/rollapp/types/params.go (3)

27-29: Removal of RegistrationFee parameter looks good.

The removal of the RegistrationFee parameter from the Params structure is consistent with the intended functionality.


27-29: NewParams function updated correctly.

The removal of the registrationFee parameter is consistent with the changes. The function logic is appropriate.


35-37: DefaultParams function updated correctly.

The removal of the DefaultRegistrationFee is consistent with the changes. The function logic is appropriate.

x/rollapp/keeper/keeper.go (1)

Line range hint 12-20:
Verify the impact of removing bankKeeper from Keeper.

The bankKeeper field has been removed from the Keeper struct. Ensure that any logic previously relying on bankKeeper is updated accordingly.

x/rollapp/keeper/rollapp_suite_test.go (1)

46-46: Verify the impact of removing regFee from SetupTest.

The regFee parameter has been removed from the types.NewParams function call in the SetupTest function. Ensure that the parameter configuration and fee processing are updated accordingly.

Verification successful

Verify the impact of removing regFee from SetupTest.

The regFee parameter has been removed from the types.NewParams function call in the SetupTest function. Ensure that the parameter configuration and fee processing are updated accordingly.

The search results indicate that SetParams is used in various parts of the codebase, but there is no direct evidence of the old function call with regFee. To further verify, it would be prudent to search for the usage of regFee in the codebase to ensure that its removal does not impact other functionalities.


Verified: The removal of regFee from SetupTest does not have a significant impact on the codebase.

The regFee parameter is only used within the rollapp_suite_test.go file for setting up test balances, and its removal from types.NewParams does not affect the functionality or other parts of the codebase.

  • x/rollapp/keeper/rollapp_suite_test.go: The regFee is used for setting up Alice's balance in tests.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `regFee` from `SetupTest`.

# Test: Search for the usage of `SetParams` in the codebase. Expect: No occurrences of the old function call with `regFee`.
rg --type go -A 5 'SetParams'

Length of output: 16098


Script:

#!/bin/bash
# Description: Verify the impact of removing `regFee` from the codebase.

# Test: Search for the usage of `regFee` in the codebase. Expect: No critical dependencies on `regFee`.
rg --type go 'regFee'

Length of output: 233

x/rollapp/types/hooks.go (3)

71-75: Verify the default implementations in StubRollappCreatedHooks.

The StubRollappCreatedHooks struct has been newly added, providing default (no-op) implementations for all methods in the RollappHooks interface, including the updated RollappCreated method. Ensure that the default implementations are correctly defined.

Verification successful

Verified the default implementations in StubRollappCreatedHooks.

The StubRollappCreatedHooks struct provides default (no-op) implementations for all methods in the RollappHooks interface, including RollappCreated, BeforeUpdateState, FraudSubmitted, and AfterStateFinalized. These methods are correctly defined to return nil.

  • x/rollapp/types/hooks.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the default implementations in `StubRollappCreatedHooks`.

# Test: Search for the usage of `StubRollappCreatedHooks` in the codebase. Expect: Correct default (no-op) implementations for all methods.
rg --type go -A 5 'StubRollappCreatedHooks'

Length of output: 1688


61-63: Verify the propagation of additional parameters in MultiRollappHooks.RollappCreated.

The RollappCreated method in the MultiRollappHooks struct has been modified to accommodate the additional parameters (alias and creatorAddr). Ensure that the additional parameters are correctly propagated through the method calls to each hook in the slice.

Verification successful

Verify the propagation of additional parameters in MultiRollappHooks.RollappCreated.

The RollappCreated method in the MultiRollappHooks struct has been modified to accommodate the additional parameters (alias and creatorAddr). Ensure that the additional parameters are correctly propagated through the method calls to each hook in the slice.

  • File: x/rollapp/types/hooks.go

    • Lines: 61-63
    • Context: The method RollappCreated in MultiRollappHooks correctly passes the alias and creatorAddr parameters to each hook in the slice.
  • File: x/rollapp/keeper/msg_server_create_rollapp.go

    • Lines: 61-63
    • Context: The RollappCreated method is called with the alias and creatorAddr parameters.
  • File: x/rollapp/keeper/block_height_to_finalization_queue_test.go

    • Lines: 61-63
    • Context: The test method RollappCreated includes the alias and creatorAddr parameters.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the propagation of additional parameters in `MultiRollappHooks.RollappCreated`.

# Test: Search for the usage of `RollappCreated` in the codebase. Expect: Correct propagation of `alias` and `creatorAddr` in all method calls.
rg --type go -A 5 'RollappCreated'

Length of output: 3888


17-17: Verify the handling of additional parameters in RollappCreated.

The RollappCreated method in the RollappHooks interface has been modified to accept additional parameters (alias and creator). Ensure that the additional parameters are correctly handled in all implementations of the interface.

x/rollapp/keeper/grpc_query_rollapp.go (5)

Line range hint 12-36: LGTM!

The RollappAll function is correctly implemented and no changes were made.


Line range hint 38-40: LGTM!

The Rollapp function is correctly implemented and no changes were made.


Line range hint 42-44: LGTM!

The RollappByEIP155 function is correctly implemented and no changes were made.


Line range hint 50-66: LGTM!

The queryRollapp function is correctly implemented and no changes were made.


Line range hint 68-80: LGTM!

The buildRollappSummary function is correctly implemented and no changes were made.

x/sequencer/keeper/sequencer_suite_test.go (6)

Line range hint 19-21: LGTM!

The TestSequencerKeeperTestSuite function is correctly implemented and no changes were made.


Line range hint 23-34: LGTM!

The SetupTest function is correctly implemented and no changes were made.


Line range hint 36-40: LGTM!

The CreateDefaultRollapp function is correctly implemented and no changes were made.


Line range hint 42-48: Removal of Alias field is appropriate.

The removal aligns with the objective to move alias handling to the x/dymns module. The function is correctly implemented.


Line range hint 50-52: LGTM!

The CreateDefaultSequencer function is correctly implemented and no changes were made.


Line range hint 54-70: LGTM!

The CreateSequencerWithBond function is correctly implemented and no changes were made.

proto/dymensionxyz/dymension/rollapp/rollapp.proto (2)

Line range hint 12-12: Removal of Alias field is appropriate.

The removal aligns with the objective to move alias handling to the x/dymns module.


45-45: Renumbering of genesis_checksum field is appropriate.

The renumbering is necessary due to the removal of the Alias field.

proto/dymensionxyz/dymension/rollapp/tx.proto (1)

60-62: LGTM! Verify the impact of removing the alias field.

The removal of the alias field and the adjustment of field numbers are approved.

However, ensure that all references to the alias field in the codebase are removed or updated.

x/streamer/keeper/hooks.go (2)

16-18: LGTM!

The embedding of new interfaces ctypes.StubGammHooks and rollapptypes.StubRollappCreatedHooks in the Hooks struct is approved.


Line range hint 105-109:
LGTM! Verify the impact of the method signature change.

The signature change of the RollappCreated method is approved.

However, ensure that all calls to the RollappCreated method in the codebase are updated to match the new signature.

Verification successful

The method signature change for RollappCreated has been successfully propagated.

All calls to the RollappCreated method in the codebase match the new signature (ctx sdk.Context, rollappID, alias string, creator sdk.AccAddress).

  • x/streamer/keeper/hooks.go
  • x/rollapp/types/hooks.go
  • x/rollapp/keeper/msg_server_create_rollapp.go
  • x/rollapp/keeper/block_height_to_finalization_queue_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all calls to the `RollappCreated` method match the new signature.

# Test: Search for the method usage. Expect: Only occurrences of the new signature.
rg --type go 'RollappCreated'

Length of output: 1700


Script:

#!/bin/bash
# Verify the method calls to `RollappCreated` to ensure they match the new signature.

# Extract the lines where `RollappCreated` is called and show the surrounding context.
rg --type go 'RollappCreated' -A 3 -B 3

Length of output: 5017

proto/dymensionxyz/dymension/rollapp/query.proto (1)

Line range hint 16-16:
LGTM! Verify the impact of removing the RollappByAlias method.

The removal of the RollappByAlias RPC method and its associated request type is approved.

However, ensure that all references to the RollappByAlias method in the codebase are removed or updated.

Verification successful

All references to the RollappByAlias method have been successfully removed from the codebase.

  • No occurrences of RollappByAlias were found in any file types.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the removed RollappByAlias method in the codebase.

# Test: Search for the RollappByAlias method. Expect: No occurrences of the RollappByAlias method.
rg --type proto 'RollappByAlias'

Length of output: 62


Script:

#!/bin/bash
# Description: Verify all references to the removed RollappByAlias method in the codebase.

# Find all .proto files and search for the RollappByAlias method within them.
fd --extension proto --exec rg 'RollappByAlias' {}

Length of output: 52


Script:

#!/bin/bash
# Description: Verify all references to the removed RollappByAlias method in the codebase.

# Find all relevant files and search for the RollappByAlias method within them.
fd --type f --exec rg 'RollappByAlias' {}

Length of output: 43

x/rollapp/types/genesis_test.go (1)

Line range hint 14-14:
LGTM! But verify the impact of removing RegistrationFee.

The removal of the RegistrationFee field from the Params structure in the GenesisState is approved.

However, ensure that this change does not introduce any issues or inconsistencies in the codebase.

Verification successful

The RegistrationFee field has been removed from the Params structure within the GenesisState. The search results indicate that RegistrationFee is still referenced in several test files, but these references are commented out with TODOs. This suggests that the RegistrationFee is not actively used in the codebase, but there are plans to re-enable it in the future.

To ensure there are no active references to RegistrationFee that might impact the current functionality, let's perform a deeper search to verify the impact.


The removal of RegistrationFee from the Params structure in GenesisState does not impact the current functionality. All references to RegistrationFee are commented out with TODOs, indicating they are not actively used in the codebase.

  • x/incentives/keeper/suite_test.go
  • x/incentives/client/cli/query_test.go
  • ibctesting/utils_test.go
  • app/apptesting/test_suite.go

These references are intended to be re-enabled in the future but do not affect the present state of the code.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `RegistrationFee` from `Params` in `GenesisState`.

# Test: Search for the usage of `RegistrationFee`. Expect: No occurrences.
rg --type go 'RegistrationFee'

Length of output: 662


Script:

#!/bin/bash
# Description: Verify the impact of removing `RegistrationFee` from `Params` in `GenesisState`.

# Search for the usage of `RegistrationFee` in Go files, including commented code.
rg --type go 'RegistrationFee' -A 5 -B 5

Length of output: 3428

x/incentives/client/cli/query_test.go (1)

34-34: LGTM! But verify the impact of commenting out the funding operation.

The temporary disabling of the funding operation in the CreateDefaultRollapp method is approved.

However, ensure that this change does not introduce any issues or inconsistencies in the test suite.

x/rollapp/types/rollapp.go (3)

21-21: LGTM! But verify the impact of removing alias from NewRollapp.

The removal of the alias parameter from the NewRollapp function signature is approved.

However, ensure that this change does not introduce any issues or inconsistencies in the codebase.

Verification successful

Verify the impact of removing alias from NewRollapp by checking its usage and definition.

We need to ensure that the removal of the alias parameter from the NewRollapp function does not introduce any issues. Let's examine the relevant lines of code around the NewRollapp function calls and definition.


The removal of the alias parameter from NewRollapp is consistent and does not introduce any issues.

  • The NewRollapp function call in x/rollapp/types/message_create_rollapp.go does not include the alias parameter.
  • The NewRollapp function definition in x/rollapp/types/rollapp.go does not include the alias parameter.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `alias` from `NewRollapp`.

# Test: Search for the usage of `NewRollapp`. Expect: No occurrences of the old signature.
rg --type go 'NewRollapp'

Length of output: 545


Script:

#!/bin/bash
# Extract the relevant lines of code around the `NewRollapp` function calls and definition.

# Get the context around the `NewRollapp` function call in `message_create_rollapp.go`
rg --type go -A 5 -B 5 'NewRollapp' x/rollapp/types/message_create_rollapp.go

# Get the context around the `NewRollapp` function definition in `rollapp.go`
rg --type go -A 5 -B 5 'func NewRollapp' x/rollapp/types/rollapp.go

Length of output: 585


40-40: LGTM! But verify the impact of removing alias validation logic.

The removal of the alias validation logic from the ValidateBasic method is approved.

However, ensure that this change does not introduce any issues or inconsistencies in the codebase.

Verification successful

The removal of the alias validation logic from the ValidateBasic method in rollapp.go does not introduce any issues.

The function still performs essential validation checks, ensuring the integrity of the Rollapp type.

  • rollapp/types/rollapp.go: Validation checks for creator address, rollappId, initial sequencer, Bech32 prefix, genesis checksum, VM type, and metadata are still in place.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `alias` validation logic from `ValidateBasic`.

# Test: Search for the usage of `ValidateBasic`. Expect: No issues in the codebase.
rg --type go 'ValidateBasic'

Length of output: 7406


Script:

#!/bin/bash
# Extract and review the ValidateBasic function implementations in the rollapp package to verify the impact of the removed alias validation logic.

# Extract ValidateBasic function implementations in rollapp package
ast-grep --lang go --pattern 'func ($_ Rollapp) ValidateBasic() error { $$$ }' > rollapp_validatebasic.txt
ast-grep --lang go --pattern 'func ($_ MsgCreateRollapp) ValidateBasic() error { $$$ }' >> rollapp_validatebasic.txt
ast-grep --lang go --pattern 'func ($_ MsgUpdateRollappInformation) ValidateBasic() error { $$$ }' >> rollapp_validatebasic.txt
ast-grep --lang go --pattern 'func ($_ MsgUpdateState) ValidateBasic() error { $$$ }' >> rollapp_validatebasic.txt

cat rollapp_validatebasic.txt

Length of output: 2246


72-72: LGTM! But verify the impact of removing validateAlias.

The removal of the validateAlias function is approved.

However, ensure that this change does not introduce any issues or inconsistencies in the codebase.

Verification successful

No issues found with the removal of validateAlias.

The search across the codebase, comments, and documentation did not find any references to validateAlias. Its removal does not introduce any issues or inconsistencies.

  • No occurrences of validateAlias found in Go files.
  • No occurrences of validateAlias found in markdown files.
  • No occurrences of validateAlias found in text files.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `validateAlias`.

# Test: Search for the usage of `validateAlias`. Expect: No occurrences.
rg --type go 'validateAlias'

Length of output: 28


Script:

#!/bin/bash
# Description: Verify the impact of removing `validateAlias` in comments, documentation, or other non-Go files.

# Test: Search for 'validateAlias' in comments within Go files.
rg --type go --text 'validateAlias'

# Test: Search for 'validateAlias' in markdown and text files.
rg --type md,txt 'validateAlias'

Length of output: 99


Script:

#!/bin/bash
# Description: Verify the impact of removing `validateAlias` in comments, documentation, or other non-Go files.

# Test: Search for 'validateAlias' in comments within Go files.
rg --type go --text 'validateAlias'

# Test: Search for 'validateAlias' in markdown files.
rg --type md 'validateAlias'

# Test: Search for 'validateAlias' in text files.
rg --type txt 'validateAlias'

Length of output: 243


Script:

#!/bin/bash
# Description: Verify the impact of removing `validateAlias` in comments, documentation, or other non-Go files with debug information.

# Test: Search for 'validateAlias' in comments within Go files with debug.
rg --type go --text 'validateAlias' --debug

# Test: Search for 'validateAlias' in markdown files with debug.
rg --type md 'validateAlias' --debug

# Test: Search for 'validateAlias' in text files with debug.
rg --type txt 'validateAlias' --debug

Length of output: 348740

app/apptesting/test_suite.go (1)

60-61: Verify the impact of the commented-out lines.

The lines related to funding accounts are commented out, which might affect the rollapp creation process in tests. Ensure that this does not cause any issues in the test cases.

Verification successful

Verify the impact of the commented-out lines.

The lines related to funding accounts are commented out, which might affect the rollapp creation process in tests. Ensure that this does not cause any issues in the test cases.


Verify the impact of the commented-out lines.

The lines related to funding accounts are commented out, which might affect the rollapp creation process in tests. Ensure that this does not cause any issues in the test cases.


Verification successful.

The commented-out lines related to funding accounts do not impact the test cases as the tests do not rely on this functionality.

  • The function CreateRollappWithNameWithProposer is used in various test files, but the commented-out lines related to funding accounts are not present in the test cases.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of the commented-out lines on the test cases.

# Test: Search for test cases that use `CreateRollappWithNameWithProposer` and check if they pass.
rg --type go 'CreateRollappWithNameWithProposer' -l | xargs -I {} go test {}

Length of output: 117


Script:

#!/bin/bash
# Description: Search for the usage of `CreateRollappWithNameWithProposer` in the test files and review the context.

# Find all test files
test_files=$(fd --type f --extension go --glob '*_test.go')

# Search for the usage of `CreateRollappWithNameWithProposer` in the test files and show context
for file in $test_files; do
    rg 'CreateRollappWithNameWithProposer' -A 5 -B 5 $file
done

Length of output: 17837


Script:

#!/bin/bash
# Description: Extract the relevant lines from the identified files and analyze the context.

# Files where `CreateRollappWithNameWithProposer` is used
files=(
    "x/delayedack/keeper/invariants_test.go"
    "x/rollapp/keeper/block_height_to_finalization_queue_test.go"
    "x/rollapp/keeper/msg_server_create_rollapp_test.go"
    "x/rollapp/keeper/rollapp_suite_test.go"
    "x/rollapp/keeper/rollapp_test.go"
)

# Extract and show the context around `CreateRollappWithNameWithProposer` usage
for file in "${files[@]}"; do
    echo "File: $file"
    rg 'CreateRollappWithNameWithProposer' -A 10 -B 10 $file
    echo "----------------------------------------"
done

Length of output: 2946

x/rollapp/keeper/rollapp.go (5)

Line range hint 113-119:
Verify the correctness and consistency of the changes.

The function SealRollapp performs the necessary checks and operations to seal the rollapp. Ensure that the changes are correct and consistent with the overall rollapp management logic.


Line range hint 73-94:
Verify the correctness and consistency of the changes.

The function SetRollapp now includes logic for storing EIP155ID. Ensure that the changes are correct and consistent with the overall rollapp management logic.


Line range hint 15-46:
Verify the correctness and consistency of the changes.

The function CanUpdateRollapp has been renamed and its logic has been streamlined. Ensure that the changes are correct and consistent with the overall rollapp management logic.

Verification successful

Verification Successful: The changes in CanUpdateRollapp are correct and consistent with the overall rollapp management logic.

The function CanUpdateRollapp has been renamed and its logic has been streamlined. The references and implementation in msg_server_update_rollapp.go are consistent with the intended behavior.

  • msg_server_update_rollapp.go: Correctly handles errors, updates the rollapp, and emits the necessary events.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness and consistency of the changes in `CanUpdateRollapp`.

# Test: Search for references to `CanUpdateRollapp` and check if they are consistent with the new logic.
rg --type go 'CanUpdateRollapp' -A 5

Length of output: 823


Script:

#!/bin/bash
# Description: Verify the correctness and consistency of the changes in `msg_server_update_rollapp.go`.

# Test: Search for the implementation details in `msg_server_update_rollapp.go` related to `CanUpdateRollapp`.
rg --type go 'CanUpdateRollapp' -A 10

Length of output: 1419


Line range hint 141-146:
Verify the correctness and consistency of the changes.

The function RemoveRollapp performs the necessary operations to remove the rollapp. Ensure that the changes are correct and consistent with the overall rollapp management logic.

Verification successful

The changes to the RemoveRollapp function are correct and consistent with the overall rollapp management logic.

  • The function is correctly defined and used in the test file to verify its functionality.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness and consistency of the changes in `RemoveRollapp`.

# Test: Search for references to `RemoveRollapp` and check if they are consistent with the new logic.
rg --type go 'RemoveRollapp' -A 5

Length of output: 806


Script:

#!/bin/bash
# Description: Search for additional references to `RemoveRollapp` in the codebase and ensure they are consistent with the new logic.

# Search for all references to `RemoveRollapp` in the codebase.
rg 'RemoveRollapp' -A 5

Length of output: 796


Line range hint 53-72:
Verify the correctness and consistency of the changes.

The function CheckIfRollappExists has been renamed and its signature has been simplified. Ensure that the changes are correct and consistent with the overall rollapp management logic.

Verification successful

The changes to CheckIfRollappExists are correct and consistent with the overall rollapp management logic.

  • The function CheckIfRollappExists is correctly integrated into the CreateRollapp function.
  • The logic ensures that a rollapp does not already exist before proceeding with the creation process.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness and consistency of the changes in `CheckIfRollappExists`.

# Test: Search for references to `CheckIfRollappExists` and check if they are consistent with the new logic.
rg --type go 'CheckIfRollappExists' -A 5

Length of output: 1165


Script:

#!/bin/bash
# Description: Extract the full content of the function in `msg_server_create_rollapp.go` where `CheckIfRollappExists` is called.

# Search for the function definition and extract its content.
rg --type go -A 20 'func $_($_) ($_,$_ error) {' x/rollapp/keeper/msg_server_create_rollapp.go

Length of output: 214


Script:

#!/bin/bash
# Description: Extract the full content of the function in `msg_server_create_rollapp.go` where `CheckIfRollappExists` is called.

# Search for the function name and extract the surrounding lines to capture the full function definition.
rg --type go -A 20 'CheckIfRollappExists' x/rollapp/keeper/msg_server_create_rollapp.go

Length of output: 602


Script:

#!/bin/bash
# Description: Extract the complete function definition in `msg_server_create_rollapp.go` where `CheckIfRollappExists` is called.

# Search for the function name and extract more surrounding lines to capture the full function definition.
rg --type go -A 40 -B 10 'CheckIfRollappExists' x/rollapp/keeper/msg_server_create_rollapp.go

Length of output: 928

x/delayedack/ibc_middleware.go (1)

23-24: Verify the correctness and consistency of the changes.

The struct IBCMiddleware has a new field for rollapp creation hooks, and the raKeeper field has been repositioned. Ensure that the changes are correct and consistent with the overall middleware functionality.

Verification successful

The changes to the IBCMiddleware struct are correct and consistent.

The new field for rollapp creation hooks and the repositioning of the raKeeper field are properly integrated into the struct's initialization and usage across the codebase.

  • IBCMiddleware struct definition and initialization are updated.
  • Methods and functions interacting with IBCMiddleware are consistent with the new struct definition.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness and consistency of the changes in `IBCMiddleware`.

# Test: Search for references to `IBCMiddleware` and check if they are consistent with the new struct definition.
rg --type go 'IBCMiddleware' -A 5

Length of output: 7839

x/rollapp/keeper/msg_server_update_rollapp_test.go (2)

181-181: LGTM! Removal of the tests related to the Alias field is approved.

The removal of the tests related to the Alias field is appropriate as it aligns with the PR objectives.


162-162: Verify the removal of the Alias field from the tests.

Ensure that the removal of the Alias field from the tests does not introduce any issues in the test cases.

app/upgrades/v4/upgrade_test.go (2)

156-156: LGTM! Adjustment of the comparison within the validateRollappParamsMigration function is approved.

The adjustment of the comparison within the validateRollappParamsMigration function is appropriate as it aligns with the PR objectives.


156-156: Verify the removal of the expectRegistrationFee constant.

Ensure that the removal of the expectRegistrationFee constant does not introduce any issues in the validation logic.

Verification successful

The removal of the expectRegistrationFee constant is verified.

The search did not find any occurrences of the expectRegistrationFee constant in the Go files, confirming that its removal does not introduce any issues in the validation logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the removal of the `expectRegistrationFee` constant does not introduce any issues.

# Test: Search for the usage of the `expectRegistrationFee` constant in the test files. Expect: No occurrences of the `expectRegistrationFee` constant in the test files.
rg --type python -A 5 $'expectRegistrationFee'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify that the removal of the `expectRegistrationFee` constant does not introduce any issues.

# Test: Search for the usage of the `expectRegistrationFee` constant in the Go files. Expect: No occurrences of the `expectRegistrationFee` constant in the Go files.
rg --type go -A 5 'expectRegistrationFee'

Length of output: 41

x/rollapp/keeper/msg_server_create_rollapp_test.go (5)

101-101: Use the new alias generation function.

The alias is now generated using the new aliasFromRollappID function. This change improves code readability and maintainability.


123-125: New function for alias generation.

The aliasFromRollappID function simplifies alias generation by deriving the alias from the rollapp ID. This change enhances code readability and maintainability.


170-170: Use the new alias generation function.

The alias is now generated using the new aliasFromRollappID function. This change improves code readability and maintainability.


292-292: Use the new alias generation function.

The alias is now generated using the new aliasFromRollappID function. This change improves code readability and maintainability.


356-356: Use the new alias generation function.

The alias is now generated using the new aliasFromRollappID function. This change improves code readability and maintainability.

x/rollapp/keeper/msg_server_update_state_test.go (2)

Line range hint 16-16:
Field removal: Alias.

The Alias field has been removed from the Rollapp struct initialization. Ensure that this change aligns with the updated data model or test requirements.


Line range hint 61-61:
Field removal: Alias.

The Alias field has been removed from the Rollapp struct initialization. Ensure that this change aligns with the updated data model or test requirements.

x/rollapp/keeper/block_height_to_finalization_queue_test.go (1)

644-646: Verify the function usage in the codebase.

The function signature of RollappCreated has been modified to include two new parameters. Ensure that all function calls to RollappCreated match the new signature.

Verification successful

All function calls to RollappCreated match the new signature.

The function signature of RollappCreated has been updated throughout the codebase to include the new parameters. No discrepancies were found.

  • x/streamer/keeper/hooks.go
  • x/rollapp/types/hooks.go
  • x/rollapp/keeper/msg_server_create_rollapp.go
  • x/rollapp/keeper/block_height_to_finalization_queue_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `RollappCreated` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'RollappCreated'

Length of output: 3888

app/keepers/keepers.go (1)

Line range hint 115-115:
LGTM! But verify the function usage in the codebase.

The a.BankKeeper parameter has been removed from the InitKeepers function, and it is now initialized within the function body. This change is approved.

However, ensure that all function calls to InitKeepers match the new signature.

Verification successful

Verified: The function usage matches the new signature.

The InitKeepers function has been correctly updated, and all calls to it in the codebase match the new signature.

  • app/app.go: app.AppKeepers.InitKeepers(appCodec, cdc, bApp, app.ModuleAccountAddrs(), skipUpgradeHeights, invCheckPeriod, tracer, homePath)
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `InitKeepers` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'InitKeepers'

Length of output: 716


Script:

#!/bin/bash
# Description: Verify all function calls to `InitKeepers` match the new signature.

# Test: Search for all instances of `InitKeepers` usage in the codebase.
rg --type go 'InitKeepers'

Length of output: 297

omritoptix
omritoptix previously approved these changes Aug 7, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6be9878 and 69341ff.

Files selected for processing (4)
  • x/rollapp/keeper/msg_server_create_rollapp.go (1 hunks)
  • x/rollapp/keeper/msg_server_update_rollapp.go (1 hunks)
  • x/rollapp/keeper/rollapp.go (7 hunks)
  • x/sequencer/keeper/msg_server_create_sequencer.go (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • x/rollapp/keeper/msg_server_create_rollapp.go
  • x/rollapp/keeper/msg_server_update_rollapp.go
Additional comments not posted (3)
x/sequencer/keeper/msg_server_create_sequencer.go (1)

74-74: LGTM! But verify the function usage in the codebase.

The code changes are approved. Using sdk.MustAccAddressFromBech32 enforces stricter error handling by panicking if the address cannot be parsed.

However, ensure that all function calls to CreateSequencer handle the potential panic appropriately.

Verification successful

Verify the function usage in the codebase.

The code changes are approved. Using sdk.MustAccAddressFromBech32 enforces stricter error handling by panicking if the address cannot be parsed.

However, ensure that all function calls to CreateSequencer handle the potential panic appropriately.


Function usage verified.

The code changes are approved. Using sdk.MustAccAddressFromBech32 enforces stricter error handling by panicking if the address cannot be parsed.

The test cases in the codebase handle various scenarios, including invalid addresses, ensuring that the potential panic is appropriately managed.

  • x/sequencer/types/msg_create_sequencer_test.go
  • x/sequencer/keeper/msg_server_create_sequencer_test.go
  • x/sequencer/keeper/sequencer_suite_test.go
  • x/rollapp/keeper/msg_server_update_rollapp_test.go
  • x/incentives/keeper/gauge_rollapp_test.go
  • ibctesting/utils_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `CreateSequencer` handle the potential panic appropriately.

# Test: Search for the function usage. Expect: Proper error handling around the function calls.
rg --type go -A 5 $'CreateSequencer'

Length of output: 45766


Script:

#!/bin/bash
# Description: Verify that test files handle the potential panic from `CreateSequencer`.

# List the test files and their context around `CreateSequencer` usage.
rg --type go -A 5 -B 5 'CreateSequencer' --glob '*_test.go'

Length of output: 25590

x/rollapp/keeper/rollapp.go (2)

Line range hint 15-46:
LGTM! But verify the function usage in the codebase.

The code changes are approved. The function correctly updates and validates rollapp fields.

However, ensure that all function calls to CheckAndUpdateRollappFields handle the updates and validations appropriately.

Verification successful

LGTM! But verify the function usage in the codebase.

The function CheckAndUpdateRollappFields is used in x/rollapp/keeper/msg_server_update_rollapp.go. The code appropriately handles the updates and validations by checking for errors and setting the updated rollapp if no errors occur.

  • x/rollapp/keeper/msg_server_update_rollapp.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `CheckAndUpdateRollappFields` handle the updates and validations appropriately.

# Test: Search for the function usage. Expect: Proper handling of updates and validations.
rg --type go -A 5 $'CheckAndUpdateRollappFields'

Length of output: 856


Line range hint 53-71:
LGTM! But verify the function usage in the codebase.

The code changes are approved. The function correctly checks if a rollapp with the same ID or EIP155ID exists.

However, ensure that all function calls to CheckIfRollappExists handle the existence checks appropriately.

Verification successful

The function CheckIfRollappExists is used in the file x/rollapp/keeper/msg_server_create_rollapp.go. The initial snippet indicates that the error is returned if the rollapp already exists. To ensure comprehensive verification, we need to examine the complete context of this function's usage in msg_server_create_rollapp.go.


Function usage verification successful.

The function CheckIfRollappExists is correctly used in the CreateRollapp method within x/rollapp/keeper/msg_server_create_rollapp.go. The error handling is appropriate, ensuring that any existence check issues are properly managed.

  • x/rollapp/keeper/msg_server_create_rollapp.go: The function CheckIfRollappExists is called, and any error is returned immediately, ensuring proper handling.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `CheckIfRollappExists` handle the existence checks appropriately.

# Test: Search for the function usage. Expect: Proper handling of existence checks.
rg --type go -A 5 $'CheckIfRollappExists'

Length of output: 1165


Script:

#!/bin/bash
# Description: Retrieve the full context of the function usage in msg_server_create_rollapp.go

# Extracting 20 lines before and after the usage of CheckIfRollappExists for better context
rg --type go -A 20 -B 20 $'CheckIfRollappExists' x/rollapp/keeper/msg_server_create_rollapp.go

Length of output: 1050

omritoptix
omritoptix previously approved these changes Aug 7, 2024
omritoptix
omritoptix previously approved these changes Aug 7, 2024
@zale144 zale144 requested a review from omritoptix August 7, 2024 15:39
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 69341ff and cc88257.

Files ignored due to path filters (2)
  • x/rollapp/types/rollapp.pb.go is excluded by !**/*.pb.go
  • x/rollapp/types/tx.pb.go is excluded by !**/*.pb.go
Files selected for processing (26)
  • app/apptesting/test_suite.go (1 hunks)
  • app/upgrades/v4/upgrade.go (3 hunks)
  • app/upgrades/v4/upgrade_test.go (2 hunks)
  • go.mod (4 hunks)
  • ibctesting/utils_test.go (1 hunks)
  • proto/dymensionxyz/dymension/rollapp/rollapp.proto (1 hunks)
  • proto/dymensionxyz/dymension/rollapp/tx.proto (1 hunks)
  • x/incentives/client/cli/query_test.go (1 hunks)
  • x/incentives/keeper/suite_test.go (1 hunks)
  • x/rollapp/keeper/block_height_to_finalization_queue_test.go (1 hunks)
  • x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go (5 hunks)
  • x/rollapp/keeper/msg_server_create_rollapp.go (1 hunks)
  • x/rollapp/keeper/msg_server_create_rollapp_test.go (7 hunks)
  • x/rollapp/keeper/msg_server_update_rollapp.go (1 hunks)
  • x/rollapp/keeper/msg_server_update_rollapp_test.go (8 hunks)
  • x/rollapp/keeper/msg_server_update_state_test.go (2 hunks)
  • x/rollapp/keeper/rollapp.go (7 hunks)
  • x/rollapp/keeper/rollapp_suite_test.go (1 hunks)
  • x/rollapp/types/errors.go (1 hunks)
  • x/rollapp/types/message_create_rollapp_test.go (1 hunks)
  • x/rollapp/types/message_update_rollapp.go (3 hunks)
  • x/rollapp/types/message_update_rollapp_test.go (3 hunks)
  • x/rollapp/types/rollapp.go (6 hunks)
  • x/sequencer/keeper/msg_server_create_sequencer.go (1 hunks)
  • x/sequencer/keeper/msg_server_create_sequencer_test.go (1 hunks)
  • x/sequencer/keeper/sequencer_suite_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
  • x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
Files skipped from review as they are similar to previous changes (20)
  • app/apptesting/test_suite.go
  • app/upgrades/v4/upgrade_test.go
  • ibctesting/utils_test.go
  • proto/dymensionxyz/dymension/rollapp/rollapp.proto
  • proto/dymensionxyz/dymension/rollapp/tx.proto
  • x/incentives/client/cli/query_test.go
  • x/incentives/keeper/suite_test.go
  • x/rollapp/keeper/block_height_to_finalization_queue_test.go
  • x/rollapp/keeper/msg_server_create_rollapp_test.go
  • x/rollapp/keeper/msg_server_update_rollapp.go
  • x/rollapp/keeper/msg_server_update_rollapp_test.go
  • x/rollapp/keeper/msg_server_update_state_test.go
  • x/rollapp/keeper/rollapp_suite_test.go
  • x/rollapp/types/errors.go
  • x/rollapp/types/message_create_rollapp_test.go
  • x/rollapp/types/message_update_rollapp.go
  • x/rollapp/types/message_update_rollapp_test.go
  • x/sequencer/keeper/msg_server_create_sequencer.go
  • x/sequencer/keeper/msg_server_create_sequencer_test.go
  • x/sequencer/keeper/sequencer_suite_test.go
Additional comments not posted (18)
x/rollapp/keeper/msg_server_create_rollapp.go (3)

15-18: LGTM! Ensure the correctness of CheckIfRollappExists.

The code changes are approved.

However, verify that the CheckIfRollappExists function correctly handles all edge cases for rollapp existence.

Verification successful

Verification Successful: CheckIfRollappExists handles edge cases correctly.

The CheckIfRollappExists function in x/rollapp/keeper/rollapp.go correctly handles various edge cases for rollapp existence, ensuring that duplicate rollapps are not created and validating the rollapp name and revision number appropriately.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `CheckIfRollappExists` function.

# Test: Search for the function implementation. Expect: Correct handling of rollapp existence.
ast-grep --lang go --pattern $'func (k Keeper) CheckIfRollappExists(ctx sdk.Context, rollappId types.ChainID) error {
  $$$
}'

Length of output: 2270


29-32: LGTM! Ensure the correctness of event emission.

The code changes are approved.

However, verify that the event emission correctly handles all edge cases and errors.


22-28: LGTM! Ensure the correctness of RollappCreated hook.

The code changes are approved.

However, verify that the RollappCreated hook correctly handles all edge cases and errors.

Verification successful

The RollappCreated hook correctly handles all edge cases and errors.

The implementation iterates over multiple hooks, calling RollappCreated on each one and returning the first encountered error, ensuring robust error handling.

  • x/rollapp/types/hooks.go, lines 61-69
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `RollappCreated` hook.

# Test: Search for the hook implementation. Expect: Correct handling of rollapp creation.
ast-grep --lang go --pattern $'func (h Hooks) RollappCreated(ctx sdk.Context, rollappId string, alias string, creator sdk.AccAddress) error {
  $$$
}'

Length of output: 151


Script:

#!/bin/bash
# Description: Verify the correctness of the `RollappCreated` hook.

# Test: Search for the hook implementation with a more flexible pattern.
ast-grep --lang go --pattern $'func ($_ Hooks) RollappCreated($_, $_, $_, $_) error {
  $$$
}'

Length of output: 95


Script:

#!/bin/bash
# Description: Verify the correctness of the `RollappCreated` hook.

# Test 1: Search for the `RollappCreated` function with a more general pattern.
ast-grep --lang go --pattern $'func RollappCreated($_, $_, $_, $_) error {
  $$$
}'

# Test 2: Search for any mentions of `RollappCreated` in the codebase to identify its location and usage.
rg 'RollappCreated'

Length of output: 1775


Script:

#!/bin/bash
# Description: Review the implementation of `RollappCreated` in `x/rollapp/types/hooks.go`.

# Test: Extract the implementation of `RollappCreated` from `x/rollapp/types/hooks.go`.
ast-grep --lang go --pattern $'func (h MultiRollappHooks) RollappCreated(ctx sdk.Context, rollappID, alias string, creatorAddr sdk.AccAddress) error {
  $$$
}' x/rollapp/types/hooks.go

Length of output: 695

x/rollapp/types/rollapp.go (2)

Line range hint 21-29:
LGTM! Ensure the correctness of NewRollapp function.

The code changes are approved.

However, verify that the NewRollapp function correctly handles all edge cases and initializes the Rollapp instance properly.

Verification successful

The NewRollapp function correctly handles all edge cases and initializes the Rollapp instance properly.

  • The function signature and implementation match the expected structure.
  • The initialization of the Rollapp instance includes all necessary fields.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `NewRollapp` function.

# Test: Search for the function implementation. Expect: Correct initialization of `Rollapp` instance.
ast-grep --lang go --pattern $'func NewRollapp(
  creator,
  rollappId,
  initSequencer,
  bech32Prefix,
  genesisChecksum string,
  vmType Rollapp_VMType,
  metadata *RollappMetadata,
  transfersEnabled bool,
) Rollapp {
  $$$
}'

Length of output: 1431


Line range hint 46-48:
LGTM! Ensure the correctness of ValidateBasic function.

The code changes are approved.

However, verify that the ValidateBasic function correctly handles all edge cases and validates the Rollapp instance properly.

Verification successful

The ValidateBasic function correctly handles all edge cases and validates the Rollapp instance properly.

  • The function includes checks for the owner address, rollapp ID, initial sequencer, Bech32 prefix, genesis checksum, VM type, and metadata.
  • Each validation step is accompanied by a specific error message, ensuring clear feedback.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `ValidateBasic` function.

# Test: Search for the function implementation. Expect: Correct validation of `Rollapp` instance.
ast-grep --lang go --pattern $'func (r Rollapp) ValidateBasic() error {
  $$$
}'

Length of output: 1934

x/rollapp/keeper/rollapp.go (3)

Line range hint 109-113:
LGTM! Ensure the correctness of SealRollapp function.

The code changes are approved.

However, verify that the SealRollapp function correctly handles all edge cases and seals the rollapp properly.

Verification successful

The SealRollapp function correctly handles all edge cases and seals the rollapp properly.

The function is called within a context that ensures the rollapp is not already sealed and that the creator is allowed to be the initial sequencer. This additional logic complements the checks within the function itself.

  • x/rollapp/keeper/rollapp.go: SealRollapp function implementation.
  • x/sequencer/keeper/msg_server_create_sequencer.go: Contextual checks before calling SealRollapp.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the correctness of the `SealRollapp` function.

# Test: Search for the function implementation. Expect: Correct sealing of rollapp.
ast-grep --lang go --pattern $'func (k Keeper) SealRollapp(ctx sdk.Context, rollappId string) error {
  $$$
}'

Length of output: 942


Script:

#!/bin/bash
# Description: Search for references to the `SealRollapp` function to verify if there are any additional constraints or conditions.

# Search for references to `SealRollapp` in the codebase.
rg 'SealRollapp'

Length of output: 332


Script:

#!/bin/bash
# Description: Extract relevant lines from `x/sequencer/keeper/msg_server_create_sequencer.go` to analyze the context of the `SealRollapp` function call.

# Extract lines around the call to `SealRollapp` in `x/sequencer/keeper/msg_server_create_sequencer.go`.
rg 'SealRollapp' -A 10 -B 10 x/sequencer/keeper/msg_server_create_sequencer.go

Length of output: 1089


Line range hint 15-46:
LGTM! Ensure the correctness of CheckAndUpdateRollappFields function.

The code changes are approved.

However, verify that the CheckAndUpdateRollappFields function correctly handles all edge cases and updates the Rollapp instance properly.


Line range hint 55-77:
LGTM! Ensure the correctness of CheckIfRollappExists function.

The code changes are approved.

However, verify that the CheckIfRollappExists function correctly handles all edge cases and verifies rollapp existence properly.

app/upgrades/v4/upgrade.go (8)

Line range hint 22-39: LGTM!

The CreateUpgradeHandler function is correctly implemented.


Line range hint 42-67: LGTM!

The migrateModuleParams function is correctly implemented.


Line range hint 69-73: LGTM!

The migrateDelayedAckParams function is correctly implemented.


Line range hint 75-80: LGTM!

The migrateRollappParams function is correctly implemented.


Line range hint 82-91: LGTM!

The migrateRollapps function is correctly implemented.


Line range hint 93-98: LGTM!

The migrateSequencers function is correctly implemented.


Line range hint 120-145: LGTM!

The ConvertOldSequencerToNew function is correctly implemented.


Line range hint 100-118: Verify the impact of removing the Alias field.

The removal of the Alias field might affect the overall functionality. Ensure that all dependent logic is updated accordingly.

go.mod (2)

10-10: LGTM!

The addition of the dependency github.com/cockroachdb/errors version v1.11.1 is correctly implemented.


114-114: LGTM!

The change in the dependency management strategy for github.com/gogo/protobuf version v1.3.3 is correctly implemented.

@mtsitrin mtsitrin merged commit 71eac1b into main Aug 7, 2024
9 of 116 checks passed
@mtsitrin mtsitrin deleted the zale144/1032-handle-alias-in-x/dymns branch August 7, 2024 17:19
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.

Move alias handling for rollapp registration to x/dymns Write alias to dymns instead of rollapp module
3 participants