-
Notifications
You must be signed in to change notification settings - Fork 340
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): enforce EIP155 chain ID for rollapp creation #1020
feat(rollapp): enforce EIP155 chain ID for rollapp creation #1020
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup in general
Left a few things
WalkthroughThe recent changes enhance the rollapp ID generation and validation processes, standardizing them across different components. The shift from random string generation to using the Changes
Assessment against linked issues
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this 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 (1)
x/rollapp/keeper/invariants.go (1)
Reintroduce EIP155 Format Check in
RollappByEIP155KeyInvariant
The EIP155 format is extensively used across the codebase, including in invariants, queries, and key management functions. Removing the EIP155 format check in the
RollappByEIP155KeyInvariant
function could compromise data integrity. Please reintroduce the EIP155 format check to ensure consistency and integrity of the rollapp data.
- Files Impacted:
x/rollapp/keeper/invariants.go
Analysis chain
Line range hint
39-57
:
LGTM! But verify the impact of removing the EIP155 format check.The removal of the EIP155 format check simplifies the logic and ensures that all rollapps are processed uniformly.
However, ensure that this change does not introduce any issues in other parts of the codebase.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of removing the EIP155 format check on the codebase. # Test: Search for any references to the removed EIP155 format check. Expect: No issues introduced. rg --type go 'NewChainID'Length of output: 1032
Script:
#!/bin/bash # Description: Extract the implementation of the NewChainID and MustNewChainID functions to verify their logic. # Extract the implementation of NewChainID function ast-grep --lang go --pattern 'func NewChainID($_) ($_, $_) { $$$ }' -A 20 # Extract the implementation of MustNewChainID function ast-grep --lang go --pattern 'func MustNewChainID($_) $_ { $$$ }' -A 20Length of output: 4437
Script:
#!/bin/bash # Description: Search for other invariants or checks related to the EIP155 format in the codebase. # Search for references to EIP155 in the codebase to identify other checks or invariants. rg --type go 'EIP155'Length of output: 10114
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
Files selected for processing (19)
- app/apptesting/test_suite.go (2 hunks)
- app/upgrades/v4/upgrade_test.go (1 hunks)
- go.mod (1 hunks)
- x/incentives/client/cli/query_test.go (2 hunks)
- x/incentives/keeper/suite_test.go (2 hunks)
- x/rollapp/genesis_test.go (3 hunks)
- x/rollapp/keeper/block_height_to_finalization_queue_test.go (14 hunks)
- x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go (9 hunks)
- x/rollapp/keeper/invariants.go (2 hunks)
- x/rollapp/keeper/invariants_test.go (3 hunks)
- x/rollapp/keeper/msg_server_create_rollapp_test.go (10 hunks)
- x/rollapp/keeper/msg_server_update_state_test.go (17 hunks)
- x/rollapp/keeper/rollapp.go (4 hunks)
- x/rollapp/keeper/rollapp_suite_test.go (2 hunks)
- x/rollapp/keeper/rollapp_test.go (2 hunks)
- x/rollapp/types/chain_id.go (1 hunks)
- x/rollapp/types/errors.go (1 hunks)
- x/sequencer/keeper/msg_server_create_sequencer_test.go (4 hunks)
- x/sequencer/keeper/sequencer_suite_test.go (2 hunks)
Files skipped from review due to trivial changes (1)
- x/rollapp/types/errors.go
Additional comments not posted (68)
x/rollapp/genesis_test.go (1)
15-18
: Good use of constants for readability and maintainability.Replacing hardcoded
RollappId
values with constants enhances the readability and maintainability of the test code.x/rollapp/types/chain_id.go (6)
43-43
: Improved error message for maintainability.Referencing
types.MaxChainIDLen
dynamically in the error message improves maintainability.
49-49
: Enhanced error handling for invalid chain IDs.The enhanced error handling improves the robustness of the
NewChainID
function.
54-54
: Base-10 integer format validation for EIP155 part.Ensuring that the EIP155 part is in base-10 integer format enhances the reliability of the chain ID parsing logic.
57-59
: Improved error reporting for revision number parsing.Enhanced error reporting for parsing the revision number improves the clarity of error messages.
62-67
: Streamlined chain ID parsing logic.The streamlined chain ID parsing logic makes the
NewChainID
function more straightforward and easier to understand.
70-75
: Introduction ofMustNewChainID
for simplified chain ID creation.The
MustNewChainID
function provides a more straightforward way to obtain aChainID
without handling errors explicitly, offering an alternative method for chain ID creation.x/rollapp/keeper/rollapp_test.go (4)
18-19
: Consistent renaming ofkeeper
tok
.Renaming the
keeper
variable tok
enhances the consistency and readability of the test code.
34-35
: Consistent renaming ofkeeper
tok
.Renaming the
keeper
variable tok
enhances the consistency and readability of the test code.
48-49
: Consistent renaming ofkeeper
tok
.Renaming the
keeper
variable tok
enhances the consistency and readability of the test code.
56-89
: Introduction ofTestKeeper_FindRollappByName
for expanded test coverage.The
TestKeeper_FindRollappByName
function expands the test coverage by introducing functionality tests for rollapp name retrieval, enhancing the robustness of the test suite.x/rollapp/keeper/rollapp_suite_test.go (2)
12-12
: Import statement approved.The import statement for the
urand
package is correct and necessary for the new functionality.
71-71
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
createNRollapp
are updated if necessary.x/sequencer/keeper/sequencer_suite_test.go (2)
13-13
: Import statement approved.The import statement for the
urand
package is correct and necessary for the new functionality.
55-55
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
CreateRollappWithInitialSequencer
are updated if necessary.x/incentives/client/cli/query_test.go (2)
13-13
: Import statement approved.The import statement for the
urand
package is correct and necessary for the new functionality.
35-35
: LGTM! But verify the function usage in the codebase.The code changes are approved.
However, ensure that all function calls to
CreateDefaultRollapp
are updated if necessary.x/rollapp/keeper/invariants_test.go (2)
62-62
: LGTM! Verify the identifier format consistency.The rollapp identifiers have been updated to the new format. Ensure that this format is consistent across the codebase.
Verification successful
Verification successful!
The new rollapp identifier format is used consistently across the codebase.
- Instances of
rollapp_
identifiers in various files follow the patternrollapp_<numeric>-<revision>
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type python -A 5 $'rollapp_'Length of output: 63
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type go -A 5 $'rollapp_'Length of output: 39203
34-34
: LGTM! Verify the identifier format consistency.The rollapp identifier has been updated to the new format. Ensure that this format is consistent across the codebase.
Verification successful
Let's correct the file type and re-run the search to verify the consistency of the rollapp identifier format.
The rollapp identifier format is consistent across the codebase.
The rollapp identifier "rollapp_-" is used consistently in various files and contexts. The changes in
x/rollapp/keeper/invariants_test.go
align with this format.
x/rollapp/keeper/invariants_test.go
x/rollapp/genesis_test.go
x/sequencer/types/tx.pb.go
x/incentives/types/query.pb.gw.go
x/eibc/types/demand_order.pb.go
x/eibc/types/types.go
x/sequencer/types/events.go
x/incentives/types/gauge.pb.go
x/eibc/types/query.pb.go
x/rollapp/types/events.go
x/rollapp/types/proposal.pb.go
x/rollapp/types/tx.pb.go
x/rollapp/types/rollapp.pb.go
x/eibc/client/cli/query_command_orders.go
x/rollapp/keeper/rollapp_test.go
x/rollapp/keeper/msg_server_update_rollapp_test.go
x/rollapp/keeper/block_height_to_finalization_queue_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
x/sequencer/keeper/msg_server_update_sequencer_test.go
x/common/types/events.go
x/common/types/rollapp_packet.pb.go
x/delayedack/types/genesis.pb.go
x/delayedack/keeper/invariants_test.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type python -A 5 $'rollapp_'Length of output: 63
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type go -A 5 $'rollapp_'Length of output: 39203
app/apptesting/test_suite.go (2)
34-34
: LGTM! Verify the identifier generation mechanism consistency.The rollapp identifier generation mechanism has been updated to use
urand.RollappID()
. Ensure that this mechanism is consistent across the codebase.Verification successful
LGTM! The rollapp identifier generation mechanism is consistent across the codebase.
The usage of
urand.RollappID()
is consistent in various files, ensuring uniformity in the rollapp identifier generation mechanism.
- Files with consistent usage:
x/sequencer/keeper/sequencer_suite_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
x/rollapp/keeper/msg_server_update_state_test.go
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
x/rollapp/keeper/rollapp_suite_test.go
x/incentives/keeper/suite_test.go
x/incentives/client/cli/query_test.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type python -A 5 $'urand.RollappID()'Length of output: 74
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'urand.RollappID()'Length of output: 12326
9-12
: LGTM! Verify the identifier format consistency.The rollapp identifier format has been updated. Ensure that this format is consistent across the codebase.
Verification successful
The new rollapp identifier format is consistent across the codebase.
The
rollapp_
identifier format is used uniformly in various files, confirming that the new format has been applied correctly.
- Verified files include
x/sequencer/types/tx.pb.go
,x/rollapp/genesis_test.go
,x/eibc/types/types.go
, and several others.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type python -A 5 $'rollapp_'Length of output: 63
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type go -A 5 'rollapp_'Length of output: 39203
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go (6)
62-62
: LGTM! Verify the identifier format consistency.The rollapp identifier has been updated to the new format. Ensure that this format is consistent across the codebase.
Verification successful
The rollapp identifier format is consistent across the codebase.
The rollapp identifier "rollapp_1234-1" is used consistently in various files and contexts, confirming that the new format is correctly applied throughout the codebase.
- Instances found in files such as
x/sequencer/types/events.go
,x/sequencer/types/tx.pb.go
,x/eibc/types/types.go
, and others.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type python -A 5 $'rollapp_'Length of output: 63
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier format. # Test: Search for the new rollapp identifier format. Expect: Consistent usage across the codebase. rg --type go -A 5 'rollapp_'Length of output: 39203
100-100
: LGTM! Verify the identifier generation mechanism consistency.The rollapp identifier generation mechanism has been updated to use
urand.RollappID()
. Ensure that this mechanism is consistent across the codebase.Verification successful
LGTM! The rollapp identifier generation mechanism is consistent.
The usage of
urand.RollappID()
is consistent across the codebase, confirming the uniform application of the new identifier generation mechanism.
- Instances found in multiple files such as:
x/sequencer/keeper/sequencer_suite_test.go
x/rollapp/keeper/msg_server_update_state_test.go
x/incentives/keeper/suite_test.go
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type python -A 5 $'urand.RollappID()'Length of output: 74
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()` in Go files. Expect: Consistent usage across the codebase. rg --type go -A 5 $'urand.RollappID()'Length of output: 12326
206-207
: LGTM! Verify the identifier generation mechanism consistency.The rollapp identifier generation mechanism has been updated to use
urand.RollappID()
. Ensure that this mechanism is consistent across the codebase.Verification successful
The rollapp identifier generation mechanism is consistent across the codebase.
The usage of
urand.RollappID()
is consistently applied in multiple files, confirming the uniformity of the new rollapp identifier generation mechanism.
x/sequencer/keeper/msg_server_create_sequencer_test.go
x/sequencer/keeper/sequencer_suite_test.go
x/incentives/keeper/suite_test.go
x/incentives/client/cli/query_test.go
x/rollapp/keeper/rollapp_suite_test.go
x/rollapp/keeper/msg_server_update_state_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type python -A 5 $'urand.RollappID()'Length of output: 74
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type go -A 5 'urand.RollappID()'Length of output: 12326
229-230
: LGTM! Verify the identifier generation mechanism consistency.The rollapp identifier generation mechanism has been updated to use
urand.RollappID()
. Ensure that this mechanism is consistent across the codebase.Verification successful
The rollapp identifier generation mechanism is consistent across the codebase.
The new mechanism using
urand.RollappID()
is applied consistently in various test files, ensuring uniformity in rollapp identifier generation.
- Verified in multiple files including:
x/sequencer/keeper/msg_server_create_sequencer_test.go
x/sequencer/keeper/sequencer_suite_test.go
x/incentives/keeper/suite_test.go
x/incentives/client/cli/query_test.go
x/rollapp/keeper/msg_server_update_state_test.go
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type python -A 5 $'urand.RollappID()'Length of output: 74
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type go -A 5 'urand.RollappID()'Length of output: 12326
126-127
: LGTM! Verify the identifier generation mechanism consistency.The rollapp identifier generation mechanism has been updated to use
urand.RollappID()
. Ensure that this mechanism is consistent across the codebase.Verification successful
The rollapp identifier generation mechanism is consistent across the codebase.
The new rollapp identifier generation mechanism using
urand.RollappID()
is consistently applied in various test files, ensuring uniformity.
x/sequencer/keeper/sequencer_suite_test.go
x/sequencer/keeper/msg_server_create_sequencer_test.go
x/rollapp/keeper/rollapp_suite_test.go
x/rollapp/keeper/msg_server_update_state_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
x/incentives/keeper/suite_test.go
x/incentives/client/cli/query_test.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type python -A 5 $'urand.RollappID()'Length of output: 74
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type go -A 5 $'urand.RollappID()'Length of output: 12326
78-78
: LGTM! Verify the identifier generation mechanism consistency.The rollapp identifier generation mechanism has been updated to use
urand.RollappID()
. Ensure that this mechanism is consistent across the codebase.Verification successful
Verification successful!
The rollapp identifier generation mechanism using
urand.RollappID()
is consistently used across the codebase, indicating proper integration.
x/incentives/keeper/suite_test.go
x/incentives/client/cli/query_test.go
x/rollapp/keeper/msg_server_create_rollapp_test.go
x/rollapp/keeper/rollapp_suite_test.go
x/rollapp/keeper/msg_server_update_state_test.go
x/rollapp/keeper/grpc_query_get_state_info_by_height_test.go
x/sequencer/keeper/msg_server_create_sequencer_test.go
x/sequencer/keeper/sequencer_suite_test.go
app/apptesting/test_suite.go
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type python -A 5 $'urand.RollappID()'Length of output: 74
Script:
#!/bin/bash # Description: Verify the consistency of the new rollapp identifier generation mechanism. # Test: Search for the usage of `urand.RollappID()`. Expect: Consistent usage across the codebase. rg --type go -A 5 'urand.RollappID()'Length of output: 12326
app/upgrades/v4/upgrade_test.go (1)
175-175
: LGTM! The use ofMustNewChainID
improves error handling.The change to use
MustNewChainID
ensures that any errors in rollapp ID creation are handled explicitly, improving the robustness of the code.x/incentives/keeper/suite_test.go (1)
213-213
: LGTM! The use ofurand.RollappID
improves ID generation.The change to use
urand.RollappID
for rollapp ID generation likely improves the randomness or consistency of the generated IDs.x/rollapp/keeper/rollapp.go (6)
241-257
: LGTM!The new function
GetRollappByName
is well-implemented and enhances the querying capabilities of theKeeper
class.
21-21
: LGTM!The change to use
types.MustNewChainID
enforces stricter error handling, ensuring that invalid chain IDs are not silently ignored.
126-145
: LGTM!The additional checks for rollapps by name enhance the validation process. The use of
types.MustNewChainID
for creatingexistingRollappChainId
ensures stricter error handling.
143-145
: LGTM!The use of
types.MustNewChainID
for creatingexistingRollappChainId
ensures stricter error handling.
172-173
: LGTM!The change to use
types.MustNewChainID
for creatingrollappID
ensures stricter error handling.
136-139
: Ensure proper testing for new validation logic.The new validation logic for checking rollapps by name should be thoroughly tested to ensure correctness.
Verification successful
The output indicates that the
GetRollappByName
function is tested inx/rollapp/keeper/rollapp_test.go
. To ensure thorough testing of the new validation logic, we need to confirm that these tests cover scenarios where rollapps with the same name are handled correctly.Let's examine the test cases in
x/rollapp/keeper/rollapp_test.go
to verify that they adequately cover the new validation logic.
To ensure thorough testing of the new validation logic, we need to see the complete test cases, including the setup and different scenarios being tested. This will help us confirm if the new validation logic is adequately tested.
The new validation logic for checking rollapps by name is thoroughly tested.
The
TestKeeper_FindRollappByName
function inx/rollapp/keeper/rollapp_test.go
covers both the positive and negative scenarios for rollapps with the same name.
TestKeeper_FindRollappByName
: Tests both cases where a rollapp with the same name is found and where it is not found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new validation logic for checking rollapps by name. # Test: Search for test cases that cover the new validation logic. Expect: Test cases for rollapps with the same name. rg --type go -A 5 'GetRollappByName'Length of output: 1030
Script:
#!/bin/bash # Description: Examine test cases for GetRollappByName function to verify thorough testing of new validation logic. # Print the relevant test cases from rollapp_test.go rg --type go -A 10 'GetRollappByName' x/rollapp/keeper/rollapp_test.goLength of output: 187
Script:
#!/bin/bash # Description: Extract full test cases for GetRollappByName function to verify thorough testing of new validation logic. # Print the full test cases from rollapp_test.go rg --type go -A 20 'func Test' x/rollapp/keeper/rollapp_test.goLength of output: 1403
go.mod (1)
20-20
: LGTM!The version update for
github.com/dymensionxyz/sdk-utils
may include bug fixes, improvements, or new features.However, ensure that the new version does not introduce breaking changes.
x/rollapp/keeper/msg_server_create_rollapp_test.go (7)
31-85
: LGTM!The test cases for
TestCreateRollappAlreadyExists
cover various scenarios and error conditions effectively.
Line range hint
90-115
:
LGTM!The test cases for
TestCreateRollappAliasAlreadyExists
cover the scenario effectively.
Line range hint
126-173
:
LGTM!The test cases for
TestCreateRollappId
cover various rollapp ID validation scenarios effectively.
Line range hint
179-219
:
LGTM!The test cases for
TestCreateRollappIdRevisionNumber
cover different revision number validation scenarios effectively.
Line range hint
225-275
:
LGTM!The test cases for
TestForkChainId
cover different forking scenarios effectively.
Line range hint
281-362
:
LGTM!The test cases for
TestOverwriteEIP155Key
cover different scenarios effectively.
Line range hint
402-456
:
LGTM!The function
createRollappWithCreatorAndVerify
ensures that rollapp creation is thoroughly tested.x/sequencer/keeper/msg_server_create_sequencer_test.go (6)
12-12
: LGTM!The addition of the
urand
package is necessary for generating unique rollapp IDs.
113-113
: LGTM!The introduction of the
numRollapps
constant improves maintainability and readability by centralizing the number of rollapps to be tested.
114-114
: LGTM!The introduction of the
rollappIDs
array is necessary for storing the generated rollapp IDs for later use during querying.
116-118
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
136-136
: LGTM!Storing the generated rollapp IDs in the
rollappIDs
array ensures they can be used later during querying.
194-195
: LGTM!Using the
rollappIDs
array for querying rollapps aligns with the new random ID generation approach and ensures consistency.x/rollapp/keeper/msg_server_update_state_test.go (12)
7-7
: LGTM!The addition of the
urand
package is necessary for generating unique rollapp IDs.
23-23
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
81-81
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
190-190
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
208-208
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
237-237
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
272-273
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
312-314
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
350-352
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
410-412
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
456-458
: LGTM!The use of
urand.RollappID()
ensures that rollapp IDs are unique and random, increasing the variability in the tests.
307-307
: LGTM!The correction of the function name improves clarity and correctness in the test naming conventions.
x/rollapp/keeper/block_height_to_finalization_queue_test.go (7)
134-139
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
156-160
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
182-199
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
Line range hint
208-225
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
Line range hint
230-249
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
258-263
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
272-272
: LGTM!The updated rollapp IDs enhance the clarity and consistency of the rollapp identifiers used in the tests.
…eip155-on-rollapp-registration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved with small comments (about left-over godocs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- app/apptesting/test_suite.go (2 hunks)
- app/export.go (1 hunks)
- x/incentives/client/cli/query_test.go (2 hunks)
- x/incentives/keeper/suite_test.go (2 hunks)
- x/rollapp/keeper/msg_server_create_rollapp_test.go (8 hunks)
- x/rollapp/keeper/rollapp.go (5 hunks)
- x/rollapp/types/errors.go (1 hunks)
Files skipped from review due to trivial changes (1)
- app/export.go
Files skipped from review as they are similar to previous changes (4)
- app/apptesting/test_suite.go
- x/incentives/client/cli/query_test.go
- x/incentives/keeper/suite_test.go
- x/rollapp/types/errors.go
Additional comments not posted (9)
x/rollapp/keeper/rollapp.go (4)
17-18
: LGTM! Enforcing stricter error handling withtypes.MustNewChainID
.The change ensures that invalid chain IDs will not propagate through the system.
134-137
: LGTM! Enhanced validation for rollapps by name.The additional check ensures that rollapps are not duplicated by name, maintaining uniqueness and preventing conflicts.
170-171
: LGTM! Enforcing stricter error handling withtypes.MustNewChainID
.The change ensures that invalid chain IDs will not propagate through the system.
238-254
: LGTM! New functionGetRollappByName
enhances querying capabilities.The function allows rollapps to be queried by name, improving the flexibility of rollapp management.
x/rollapp/keeper/msg_server_create_rollapp_test.go (5)
31-40
: LGTM! Enhanced uniqueness and coverage inTestCreateRollappAlreadyExists
.The changes improve the robustness and reliability of the test case by ensuring unique rollapp identifiers and covering more scenarios.
Also applies to: 42-87
Line range hint
92-113
:
LGTM! Enhanced uniqueness inTestCreateRollappAliasAlreadyExists
.The changes reduce the likelihood of conflicts during rollapp creation by ensuring unique rollapp identifiers.
129-178
: LGTM! Improved coverage inTestCreateRollappId
.The changes ensure that various invalid rollapp IDs lead to specific error responses, improving the robustness of the test case.
Line range hint
181-228
:
LGTM! Improved coverage inTestForkChainId
.The changes ensure that forked rollapp IDs are validated correctly, improving the robustness of the test case.
Line range hint
291-308
:
LGTM! Improved coverage inTestOverwriteEIP155Key
.The changes ensure that rollapp IDs with extra whitespace and same EIP ID are handled correctly, improving the robustness of the test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gj!
Description
Closes #1014
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...
Unreleased
section inCHANGELOG.md
godoc
commentsSDK Checklist
map
time.Now()
sendCoin
and notSendCoins
Full security checklist here
----;
For Reviewer:
---;
After reviewer approval:
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores