-
Notifications
You must be signed in to change notification settings - Fork 906
chore(evm): Remove unused ChainID from Evm keeper. #2873
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
Conversation
WalkthroughThe changes in this pull request focus on the removal of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (3)
Files skipped from review as they are similar to previous changes (1)
Additional comments not posted (8)
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The changelog checker complains because of |
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 and nitpick comments (5)
app/ante/evm/eth_benchmark_test.go (1)
32-35
: Approved: Chain ID retrieval simplified and centralized.The change to use
config.GetChainConfig().ChainID
instead ofs.GetNetwork().App.EvmKeeper.ChainID()
aligns with the PR objective of removingChainID
from the EVM keeper. This approach ensures consistency in chain ID usage across the codebase.Consider adding a brief comment explaining the purpose of
evmChainID
for improved code readability:+// Retrieve the chain ID from the global configuration evmChainID := config.GetChainConfig().ChainID
precompiles/gov/gov_test.go (1)
90-93
: LGTM: Updated ChainID retrieval methodThe change from
s.network.App.EvmKeeper.ChainID()
toconfig.GetChainConfig().ChainID
aligns with the PR's objective of using a globally configuredChainID
. This modification ensures consistency between the test environment and the main application code.Consider adding a brief comment explaining the reason for this change, to improve code readability:
- + // Use the globally configured ChainID instead of the block-specific one evmChainID := config.GetChainConfig().ChainIDapp/post/setup_test.go (1)
Line range hint
1-150
: Overall assessment: Changes align with PR objectivesThe modifications in this file successfully transition from using the EVM keeper's
ChainID
to a globally configuredChainID
. This change is consistent with the PR's objective of removing unusedChainID
from the EVM keeper following the recent refactor.A few points to consider:
- Ensure that the global chain configuration is properly set up in all test environments.
- Update any other test files that might be using the old
ChainID
retrieval method.- Consider adding a comment explaining the reason for this change, to provide context for future developers.
As part of this refactoring effort, it might be beneficial to review other parts of the codebase that interact with the
ChainID
to ensure consistency. Consider creating a centralized method or helper function forChainID
retrieval to make future updates easier and maintain consistency across the codebase.testutil/tx/eth.go (1)
32-32
: LGTM! Consider removing the unused parameter.The changes align with the PR objectives by removing the dependency on
appEvmos.EvmKeeper.ChainID()
and usingevmconfig.GetChainConfig().ChainID
instead. This centralizes the chain ID configuration and removes unused code.Consider removing the unused
_ *app.Evmos
parameter entirely from the function signature for better code clarity:-func PrepareEthTx(txCfg client.TxConfig, _ *app.Evmos, priv cryptotypes.PrivKey, msgs ...sdk.Msg) (authsigning.Tx, error) { +func PrepareEthTx(txCfg client.TxConfig, priv cryptotypes.PrivKey, msgs ...sdk.Msg) (authsigning.Tx, error) {Also applies to: 38-38
testutil/contract.go (1)
63-63
: LGTM: Updated chain ID retrieval method.The change to use
config.GetChainConfig().ChainID
is appropriate and aligns with the PR objectives. It centralizes the chain ID configuration, improving maintainability.Consider adding a brief comment explaining why we're using the config package for chain ID, for better code readability:
// Retrieve chain ID from the global configuration chainID := config.GetChainConfig().ChainID
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (25)
- CHANGELOG.md (1 hunks)
- app/ante/evm/ante_test.go (11 hunks)
- app/ante/evm/eth_benchmark_test.go (1 hunks)
- app/ante/evm/interfaces.go (0 hunks)
- app/ante/evm/setup_ctx_test.go (1 hunks)
- app/ante/evm/signverify_test.go (1 hunks)
- app/ante/evm/sigs_test.go (2 hunks)
- app/app.go (0 hunks)
- app/post/setup_test.go (2 hunks)
- precompiles/distribution/distribution_test.go (2 hunks)
- precompiles/gov/gov_test.go (2 hunks)
- precompiles/staking/staking_test.go (2 hunks)
- precompiles/testutil/contracts/contracts.go (2 hunks)
- testutil/contract.go (3 hunks)
- testutil/tx/eth.go (3 hunks)
- x/evm/genesis.go (0 hunks)
- x/evm/keeper/abci.go (0 hunks)
- x/evm/keeper/benchmark_test.go (10 hunks)
- x/evm/keeper/keeper.go (0 hunks)
- x/evm/keeper/keeper_test.go (0 hunks)
- x/evm/keeper/state_transition_benchmark_test.go (6 hunks)
- x/evm/keeper/state_transition_test.go (1 hunks)
- x/evm/keeper/statedb_test.go (2 hunks)
- x/evm/keeper/utils_test.go (6 hunks)
- x/evm/module.go (1 hunks)
Files not reviewed due to no reviewable changes (6)
- app/ante/evm/interfaces.go
- app/app.go
- x/evm/genesis.go
- x/evm/keeper/abci.go
- x/evm/keeper/keeper.go
- x/evm/keeper/keeper_test.go
Additional comments not posted (78)
app/ante/evm/sigs_test.go (3)
7-7
: LGTM: Import statement added for accessing chain configurationThe addition of the
config
package import aligns with the PR objective of using global configuration for ChainID.
Line range hint
1-54
: Summary: Changes align with PR objectives and improve consistencyThe modifications in this file successfully implement the PR objective of removing the unused ChainID from the EVM keeper. By retrieving the ChainID from the global configuration, the test now ensures consistency with the rest of the system. This change simplifies ChainID management and reduces potential discrepancies between different parts of the codebase.
18-21
: LGTM: ChainID now retrieved from global configurationThe change to retrieve the ChainID from the global configuration aligns with the PR objective of removing unused ChainID from the EVM keeper. This ensures consistency across the system and simplifies ChainID management.
To ensure this change is consistent throughout the codebase, let's verify that other occurrences of ChainID retrieval have been updated similarly:
Verification successful
Verification Complete: ChainID Retrieval Updated Consistently
The ChainID retrieval has been successfully updated across the codebase to use the global configuration, with no remaining references to EvmKeeper. This ensures consistency and aligns with the PR objectives.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining uses of EvmKeeper for ChainID retrieval # Test: Search for EvmKeeper ChainID usage rg --type go 'EvmKeeper.*ChainID' # Test: Search for new config ChainID usage rg --type go 'config\.GetChainConfig\(\)\.ChainID'Length of output: 3626
app/ante/evm/setup_ctx_test.go (4)
12-12
: LGTM: Import statement addition is appropriate.The addition of the
config
package import aligns with the PR objectives to use global configuration forChainID
instead of retrieving it from the EVM keeper.
22-22
: LGTM: Test case updated to use new ChainID source.The update to use
evmChainID
in theethContractCreationTxParams
is consistent with the earlier changes and ensures that the test case uses the globally configured chain ID.
Line range hint
1-62
: Overall assessment: Changes align with PR objectives and maintain test integrity.The modifications in this file successfully transition from using the EVM keeper's ChainID to the globally configured ChainID. This change is consistent across the file and maintains the overall structure and integrity of the test. The updates align well with the PR's objective of removing the unused ChainID from the EVM keeper.
18-19
: LGTM: ChainID retrieval updated to use global configuration.The change to retrieve
evmChainID
from the global configuration is in line with the PR objectives. This ensures consistency with the rest of the system.To ensure this change doesn't inadvertently affect test behavior, please verify that the global configuration's
ChainID
matches the previously used value from the EVM keeper. You can run the following script to check this:Verification successful
Verified:
ChainID
is correctly updated to use global configuration without remnants from EvmKeeper.The change ensures that
evmChainID
is now sourced from the global configuration, aligning with the PR objectives. No usages ofChainID
related toEvmKeeper
were found, confirming the update does not affect test behavior adversely.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Compare the ChainID from global config with the one previously used in EVM keeper # Search for previous ChainID usage in EVM keeper old_chain_id=$(rg --type go -g '!*_test.go' 'ChainID.*EvmKeeper' x/evm) # Get the new ChainID from global config new_chain_id=$(rg --type go 'func GetChainConfig\(\).*ChainID' x/evm/config) echo "Old ChainID usage: $old_chain_id" echo "New ChainID from config: $new_chain_id" # Note: Manual comparison might be needed as the exact format may varyLength of output: 264
Script:
#!/bin/bash # Description: Comprehensive search for ChainID usage in EVM keeper and global configuration echo "Searching for 'ChainID' in the EVM package..." rg --type go 'ChainID' x/evm echo "Searching for 'ChainID' in the configuration files..." rg --type go 'ChainID' x/evm/config echo "Using ast-grep to find ChainID declarations in Go files..." ast-grep --lang go --pattern 'var $_ = $_ChainID' x/...Length of output: 12671
Script:
#!/bin/bash # Description: Comprehensive search for ChainID declarations in EVM keeper and global configuration echo "Searching for 'ChainID' in the EVM package..." rg --type go 'ChainID' x/evm echo "Searching for 'ChainID' in the configuration files..." rg --type go 'ChainID' x/evm/config echo "Using ast-grep to find ChainID declarations in Go files..." ast-grep --lang go --pattern 'var $_ = $_ChainID' x/Length of output: 12615
app/ante/evm/signverify_test.go (4)
11-11
: LGTM: New import for EVM configurationThe addition of the
config
import from the EVM module aligns with the PR objective of using global configuration for ChainID retrieval.
23-23
: LGTM: Updated ChainID in test parametersThe ChainID in the
ethContractCreationTxParams
struct is correctly updated to use theevmChainID
obtained from the global configuration. This change maintains consistency with the new ChainID retrieval method and ensures the test cases remain valid.
Line range hint
1-94
: Overall assessment: Changes successfully implement PR objectivesThe modifications in this file consistently replace the direct ChainID retrieval from the EVM keeper with the new method using global configuration. These changes align well with the PR's goal of removing the unused ChainID from the EVM keeper. The test cases have been appropriately updated to reflect these changes, maintaining the integrity of the tests.
17-20
: LGTM: Updated ChainID retrieval methodThe changes correctly implement the PR objective by retrieving the ChainID from the global configuration instead of the EVM keeper. This centralization improves consistency across the codebase.
To ensure this change is consistently applied throughout the codebase, let's verify other occurrences of ChainID retrieval:
Verification successful
Verified: ChainID retrieval is consistently centralized
All instances of ChainID retrieval have been successfully updated to use
config.GetChainConfig().ChainID
. No direct accesses toEvmKeeper.*ChainID
were found, ensuring consistency across the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining direct ChainID retrievals from EvmKeeper # Test: Search for direct ChainID access from EvmKeeper rg --type go 'EvmKeeper.*ChainID' # Test: Search for new config-based ChainID retrieval rg --type go 'config\.GetChainConfig\(\)\.ChainID'Length of output: 3626
app/ante/evm/eth_benchmark_test.go (1)
32-35
: Verify benchmark integrity after chain ID retrieval change.While the change to use a globally configured chain ID is an improvement, it's crucial to ensure that this modification doesn't inadvertently affect the benchmark's ability to accurately measure performance.
Please run the benchmark tests before and after this change to confirm that there's no significant impact on the performance metrics. You can use the following command:
Compare the results to ensure that the performance characteristics remain consistent.
precompiles/testutil/contracts/contracts.go (1)
73-73
: Approve change with verification suggestionThe modification from
app.EvmKeeper.ChainID()
toconfig.GetChainConfig().ChainID
aligns with the PR objective of removing ChainID from the EVM keeper and using a global configuration. This change promotes consistency in ChainID retrieval across the codebase.To ensure this change is consistently applied throughout the codebase, please run the following verification script:
This script will help identify any inconsistencies in ChainID retrieval across the codebase, ensuring that the refactoring is complete and consistent.
Verification successful
ChainID Retrieval Consistently Updated
All instances of
app.EvmKeeper.ChainID()
have been successfully replaced withconfig.GetChainConfig().ChainID
. This refactoring ensures consistent ChainID retrieval across the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistent usage of ChainID retrieval method # Test 1: Check for any remaining usage of EvmKeeper.ChainID() echo "Checking for remaining usage of EvmKeeper.ChainID():" rg --type go 'EvmKeeper\.ChainID\(\)' # Test 2: Verify the new usage of config.GetChainConfig().ChainID echo "Verifying usage of config.GetChainConfig().ChainID:" rg --type go 'config\.GetChainConfig\(\)\.ChainID' # Test 3: Check for any other methods of retrieving ChainID that might need updating echo "Checking for other ChainID retrieval methods:" rg --type go 'ChainID'Length of output: 45428
precompiles/gov/gov_test.go (2)
11-11
: LGTM: New import aligns with PR objectivesThe addition of the
config
package import is consistent with the PR's goal of transitioning to a globally configuredChainID
.
Line range hint
1-145
: Overall impact: Minimal and focused changesThe modifications in this file are limited to importing the
config
package and updating theChainID
retrieval method. These changes align well with the PR objectives and the recent refactor, while maintaining the overall structure and functionality of the test suite.To ensure that these changes haven't inadvertently affected other parts of the codebase, please run the following verification script:
This script will help identify any inconsistencies in ChainID retrieval methods across the codebase.
Verification successful
Verification Successful: ChainID Retrieval Method Consistently Updated
The shell script results confirm that the old
EvmKeeper.ChainID()
method is no longer present and the newconfig.GetChainConfig().ChainID
method is consistently used across the codebase. This ensures that the changes are fully integrated without affecting other parts of the system.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the ChainID is consistently retrieved using the new method across the codebase. # Test: Search for any remaining instances of the old ChainID retrieval method rg --type go 'EvmKeeper\.ChainID\(\)' # Test: Confirm that the new ChainID retrieval method is used consistently rg --type go 'config\.GetChainConfig\(\)\.ChainID'Length of output: 3630
app/post/setup_test.go (2)
23-24
: LGTM: Import addition is appropriateThe addition of the
config
package import from theevm
module is consistent with the PR's objective of transitioning to a globally configuredChainID
. This import is necessary for the subsequent changes in theBuildEthTx
method.
73-74
: LGTM: ChainID retrieval updated correctlyThe modification to use
config.GetChainConfig().ChainID
instead ofs.unitNetwork.App.EvmKeeper.ChainID()
is in line with the PR's objective of removing theChainID
from the EVM keeper. This change ensures consistency inChainID
retrieval across the application.To ensure this change doesn't introduce any unexpected behavior, please verify that the global chain configuration is properly set up in the test environment. You can add a simple assertion before this line to check if the
ChainID
is set correctly:chainID := config.GetChainConfig().ChainID s.Require().NotNil(chainID, "ChainID should not be nil") s.Require().NotEqual(chainID.Int64(), int64(0), "ChainID should not be zero")This will help catch any potential issues with the global configuration in the test setup.
testutil/tx/eth.go (2)
32-32
: Summary: Successful removal of EvmKeeper.ChainID() dependencyThe changes in this file successfully remove the dependency on
EvmKeeper.ChainID()
and replace it withevmconfig.GetChainConfig().ChainID
. This modification:
- Centralizes the chain ID configuration management.
- Removes unused code from the Evm keeper.
- Maintains consistency across the affected functions.
These changes align well with the PR objectives and contribute to a more streamlined codebase.
Also applies to: 38-38, 106-106, 125-125
106-106
: LGTM! Verify chain ID consistency across the codebase.The changes align with the PR objectives by replacing
appEvmos.EvmKeeper.ChainID()
withevmconfig.GetChainConfig().ChainID
. This centralizes the chain ID configuration and removes the dependency on the Evm keeper for this information.To ensure consistency across the codebase, let's verify that all instances of
EvmKeeper.ChainID()
have been replaced:Also applies to: 125-125
Verification successful
Verified: Chain ID consistency confirmed across the codebase.
All instances of
EvmKeeper.ChainID()
have been successfully replaced withGetChainConfig().ChainID
, including in the test files. This ensures centralized configuration of the chain ID and removes dependencies on the Evm keeper.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining instances of EvmKeeper.ChainID() # Test: Search for EvmKeeper.ChainID(). Expect: No results. rg --type go 'EvmKeeper\.ChainID\(\)' # Test: Search for GetChainConfig().ChainID. Expect: Multiple results including the changes in this file. rg --type go 'GetChainConfig\(\)\.ChainID'Length of output: 3622
testutil/contract.go (2)
23-23
: LGTM: New import for chain configuration.The addition of the
config
package import is appropriate and necessary for the changes made in this file.
109-109
: LGTM: Consistent chain ID retrieval method.The change to use
config.GetChainConfig().ChainID
is consistent with the modification in theDeployContract
function. This ensures uniformity in how the chain ID is obtained throughout the file.x/evm/module.go (3)
Line range hint
1-185
: Verify chain ID management after BeginBlock removal.The changes appear consistent throughout the file, with no obvious issues introduced. The
EndBlock
method remains intact, suggesting that necessary end-of-block operations are preserved.To ensure the removal of
BeginBlock
hasn't impacted chain ID management:
- Confirm that the chain ID is now being managed correctly through global configuration.
- Verify that all parts of the system that previously relied on
BeginBlock
for chain ID updates have been adjusted.Run the following script to check for chain ID references that might need attention:
#!/bin/bash # Description: Check for chain ID references that might need attention after BeginBlock removal # Test: Search for chain ID references in go files rg --type go 'ChainID|chainID|chain_id' x/
Line range hint
1-185
: Confirm all BeginBlock functionality has been appropriately handled.The
BeginBlock
method has been successfully removed from theAppModule
struct, which aligns with the PR objectives. This simplification is good for maintainability.To ensure no critical functionality has been lost, please confirm:
- Any important operations previously performed in
BeginBlock
have been relocated to appropriate places or are no longer needed.- The removal doesn't break any assumptions in other parts of the system.
Run the following script to check for any
BeginBlock
references in other modules that might have depended on the EVM module'sBeginBlock
:#!/bin/bash # Description: Check for BeginBlock references in other modules that might depend on EVM # Test: Search for BeginBlock references in go files, excluding the x/evm directory rg --type go 'BeginBlock.*evm' --glob '!x/evm/**'
37-37
: LGTM! Verify system-wide impact of removing BeginBlock.The removal of
appmodule.HasBeginBlocker
is consistent with the PR objectives and aligns with the recent refactor. Theappmodule.HasEndBlocker
interface implementation is correctly retained.To ensure this change doesn't have unintended consequences, please run the following script to check for any remaining references to
BeginBlock
in the EVM module:Verification successful
BeginBlock references have been successfully removed.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to BeginBlock in the EVM module # Test: Search for BeginBlock references in the x/evm directory rg --type go 'BeginBlock' x/evmLength of output: 17961
Script:
#!/bin/bash # Description: Check for any remaining references to BeginBlock in the EVM module # Test: Search for BeginBlock references in the x/evm directory rg --type go 'BeginBlock' x/evm || echo "No matches found or an error occurred"Length of output: 116
x/evm/keeper/utils_test.go (5)
7-8
: LGTM: Import statements reorganized and new imports added.The reorganization of import statements improves readability, and the new imports are appropriately added for the required functionality.
Also applies to: 16-19
93-93
: LGTM: Updated chainID retrieval in TransferERC20Token function.The change is consistent with the update in the DeployTestContract function, maintaining consistency across the codebase.
149-149
: LGTM: Updated chainID retrieval and gas cap configuration in DeployTestMessageCall function.The changes are consistent with the updates in other functions, maintaining consistency across different test utility functions.
Also applies to: 164-164
Line range hint
1-200
: Overall changes align with PR objectives and improve consistency.The modifications successfully implement the removal of
ChainID
from the EVM keeper and the transition to using a globally configuredChainID
. These changes improve consistency across the codebase and centralize the chain ID configuration. The updates to gas cap configuration also contribute to a more standardized approach.To ensure comprehensive test coverage for these changes, consider adding or updating tests that specifically verify:
- The correct retrieval of the chain ID from the global configuration.
- The proper application of the default gas cap in various scenarios.
- The behavior of the system when the chain ID or gas cap configurations are modified.
34-34
: LGTM: Updated chainID retrieval and gas cap configuration.The changes align with the PR objective of using a globally configured ChainID and are consistent with the updates mentioned in the summary.
To ensure these changes are consistently applied across the codebase, let's verify the usage:
Also applies to: 54-54
Verification successful
Verified: ChainID retrieval and gas cap configuration are consistently applied across the codebase.
All instances have been appropriately updated, ensuring consistency and alignment with the PR objectives.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify chainID retrieval and gas cap configuration # Check for any remaining uses of suite.network.App.EvmKeeper.ChainID() echo "Checking for remaining uses of suite.network.App.EvmKeeper.ChainID():" rg --type go "suite\.network\.App\.EvmKeeper\.ChainID\(\)" # Check for consistent use of evmconfig.GetChainConfig().ChainID echo "Checking for consistent use of evmconfig.GetChainConfig().ChainID:" rg --type go "evmconfig\.GetChainConfig\(\)\.ChainID" # Check for consistent use of servercfg.DefaultGasCap echo "Checking for consistent use of servercfg.DefaultGasCap:" rg --type go "servercfg\.DefaultGasCap"Length of output: 1198
x/evm/keeper/benchmark_test.go (7)
96-96
: LGTM: Consistent update of ChainID retrieval.The change to use
config.GetChainConfig().ChainID
is consistent with the previous modification and aligns with the PR objective of using a globally configured ChainID.
117-117
: LGTM: Consistent update of ChainID retrieval.The change to use
config.GetChainConfig().ChainID
is consistent with the previous modifications and aligns with the PR objective of using a globally configured ChainID.
138-138
: LGTM: Consistent update of ChainID retrieval.The change to use
config.GetChainConfig().ChainID
is consistent with the previous modifications and aligns with the PR objective of using a globally configured ChainID.
159-159
: LGTM: Consistent update of ChainID retrieval.The change to use
config.GetChainConfig().ChainID
is consistent with the previous modifications and aligns with the PR objective of using a globally configured ChainID.
181-181
: LGTM: Consistent updates of ChainID retrieval.Both changes to use
config.GetChainConfig().ChainID
are consistent with the previous modifications and align with the PR objective of using a globally configured ChainID. This ensures that the ChainID is retrieved consistently throughout the benchmark tests.Also applies to: 193-193
Line range hint
1-214
: Summary: Consistent update of ChainID retrieval across benchmark testsThe changes in this file consistently update the ChainID retrieval method from directly accessing the EvmKeeper to using
config.GetChainConfig().ChainID
. This modification:
- Aligns with the PR objective of removing the unused ChainID from the Evm keeper.
- Improves consistency in how the ChainID is accessed throughout the benchmark tests.
- Centralizes the ChainID configuration, which can make future updates easier to manage.
These changes contribute to a more maintainable and consistent codebase.
65-65
: LGTM: Updated ChainID retrieval method.The change from using the EvmKeeper's ChainID to
config.GetChainConfig().ChainID
aligns with the PR objective of removing the unused ChainID from the Evm keeper. This update ensures consistency with the global configuration.To ensure this change is consistent across the codebase, let's verify other occurrences:
Verification successful
[Verified] All direct accesses to
EvmKeeper
'sChainID
have been successfully removed and replaced withconfig.GetChainConfig().ChainID
. The change is consistent across the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining direct accesses to ChainID from EvmKeeper rg --type go 'EvmKeeper.*ChainID' # Search for new usage of GetChainConfig().ChainID rg --type go 'GetChainConfig\(\)\.ChainID'Length of output: 3618
precompiles/distribution/distribution_test.go (3)
14-14
: LGTM: New import for chain configuration.The addition of the
config
import is appropriate and necessary for the changes made in theTestRun
function.
Line range hint
1-290
: Overall assessment: Changes look good and align with PR objectives.The modifications to retrieve the
ChainID
from the global configuration are consistent with the PR's goal of removing unusedChainID
from the EVM keeper. The test cases remain intact, and the changes should not affect the overall functionality of the tests.
225-229
: LGTM: Updated ChainID retrieval method.The change from using
s.network.App.EvmKeeper.ChainID()
toconfig.GetChainConfig().ChainID
aligns with the PR objectives and uses a globally consistent configuration. This is a good improvement.To ensure consistency across the codebase, let's verify the usage of
ChainID
:This will help ensure that all instances have been updated consistently.
Verification successful
Verified: All
ChainID
usages have been updated appropriately.All instances of
EvmKeeper.ChainID()
have been successfully replaced withconfig.GetChainConfig().ChainID
, ensuring consistent configuration across the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of EvmKeeper.ChainID() and compare with the new config.GetChainConfig().ChainID usage echo "Checking for remaining EvmKeeper.ChainID() usage:" rg --type go 'EvmKeeper\.ChainID\(\)' echo "\nChecking new config.GetChainConfig().ChainID usage:" rg --type go 'config\.GetChainConfig\(\)\.ChainID'Length of output: 3856
x/evm/keeper/state_transition_benchmark_test.go (7)
167-167
: LGTM: Consistent use of global chain configurationThis change aligns with the PR objectives by replacing the EVM keeper's ChainID getter with the global chain configuration. This modification enhances consistency across the codebase and removes the dependency on the unused ChainID in the EVM keeper.
196-196
: LGTM: Consistent change for legacy transactionsThis modification mirrors the change made in the previous benchmark function, ensuring consistency in how the chain ID is obtained for different transaction types. This approach aligns with the overall goal of standardizing chain ID retrieval across the codebase.
225-225
: LGTM: Consistent change applied to dynamic fee transactionsThis change extends the standardized chain ID retrieval to dynamic fee transactions, which were introduced in Ethereum's London hard fork. This consistency across all transaction types, including the newest ones, ensures a uniform approach throughout the codebase.
256-256
: LGTM: Consistent change applied to message-level operationsThis modification extends the standardized chain ID retrieval to message-level operations, which are more granular than full transactions. This consistency ensures that the new approach is applied uniformly across different levels of the EVM implementation.
292-292
: LGTM: Consistent change applied to legacy transaction messagesThis change maintains the standardized chain ID retrieval for legacy transaction messages, ensuring that the new approach is applied consistently even for older transaction types at the message level.
327-327
: LGTM: Comprehensive application of change to all transaction types and levelsThis final change completes the standardization of chain ID retrieval across all transaction types and levels, including the newest dynamic fee transactions at the message level. This comprehensive approach ensures consistency throughout the entire EVM implementation in the codebase.
Line range hint
167-327
: Summary: Successful standardization of chain ID retrievalThe changes in this file consistently replace the use of
suite.network.App.EvmKeeper.ChainID()
withconfig.GetChainConfig().ChainID
across all benchmark functions. This modification:
- Removes the dependency on the unused ChainID in the EVM keeper.
- Standardizes chain ID retrieval across different transaction types (legacy, access list, and dynamic fee) and levels (full transactions and messages).
- Enhances code consistency and maintainability by using a global configuration.
These changes align perfectly with the PR objectives and contribute to a more streamlined and consistent codebase.
precompiles/staking/staking_test.go (1)
449-449
: LGTM: Simplified ChainID retrievalThe change from
s.network.App.EvmKeeper.ChainID()
toconfig.GetChainConfig().ChainID
aligns with the PR objective of removing the unused ChainID from the Evm keeper. This modification centralizes the ChainID retrieval to a single configuration source, which can improve consistency across the codebase.x/evm/keeper/state_transition_test.go (1)
262-262
: LGTM! Simplified chain ID retrievalThe change to obtain the chain ID directly from the configuration (
config.GetChainConfig().ChainID
) instead of using theEvmKeeper
instance is a good improvement. This simplification aligns with the PR objective of removing unusedChainID
from the EVM keeper and reduces unnecessary dependencies.x/evm/keeper/statedb_test.go (1)
693-693
: LGTM! Change aligns with PR objectives.The modification to use
config.GetChainConfig().ChainID
instead ofsuite.network.App.EvmKeeper.ChainID()
is consistent with the PR's goal of removing the unused ChainID from the EVM keeper. This change centralizes the ChainID retrieval to the global configuration, improving consistency across the codebase.app/ante/evm/ante_test.go (7)
46-48
: LGTM: Updated ChainID retrieval methodThe change to retrieve the
ChainID
fromconfig.GetChainConfig().ChainID
is consistent with the PR objective of removing the unusedChainID
from the EVM keeper. This update ensures that theChainID
is obtained from the global configuration, which is the correct approach after the recent refactor.
57-58
: LGTM: Consistent ChainID updateThe change to use
config.GetChainConfig().ChainID
for theethTxParams
struct is consistent with the previous update. This ensures that all test cases use the same method to retrieve theChainID
, maintaining consistency throughout the test suite.
170-171
: LGTM: ChainID update in test caseThe change to use
config.GetChainConfig().ChainID
in this specific test case maintains consistency with the earlier updates. This ensures that all parts of the test suite, including individual test cases, use the new method forChainID
retrieval.
189-190
: LGTM: Comprehensive ChainID updates across test casesThe changes to use
config.GetChainConfig().ChainID
have been consistently applied across multiple test cases. This comprehensive update ensures that all scenarios in the test suite use the new method forChainID
retrieval, maintaining consistency and aligning with the PR's objectives.Also applies to: 207-208, 225-226, 247-248
923-926
: LGTM: ChainID updates in dynamic fee testsThe changes to use
config.GetChainConfig().ChainID
have been correctly applied to theTestAnteHandlerWithDynamicTxFee
function. This ensures consistency across different types of tests, including those dealing with dynamic transaction fees.Also applies to: 936-939
1087-1090
: LGTM: Final ChainID updates and overall consistencyThe changes to use
config.GetChainConfig().ChainID
in theTestAnteHandlerWithParams
function complete the comprehensive update of theChainID
retrieval method throughout the test file. These final changes ensure that all test functions, including those testing specific parameters, use the new global configuration approach for obtaining theChainID
.Overall, the updates in this file consistently implement the new
ChainID
retrieval method across all test cases and functions. This change aligns perfectly with the PR's objective of removing the unusedChainID
from the EVM keeper and transitioning to a globally configuredChainID
.Also applies to: 1101-1104
Line range hint
1-1204
: Summary: Comprehensive and consistent ChainID updatesThis review has examined all changes made to the
app/ante/evm/ante_test.go
file. The modifications consistently update the method of retrieving theChainID
from using the EVM keeper to using the global configuration (config.GetChainConfig().ChainID
). These changes have been applied across all test functions and cases, including:
TestAnteHandler
TestAnteHandlerWithDynamicTxFee
TestAnteHandlerWithParams
The updates align perfectly with the PR's objective of removing the unused
ChainID
from the EVM keeper and transitioning to a globally configuredChainID
. The changes are thorough, maintain consistency throughout the test suite, and do not introduce any apparent issues or potential problems.Overall, these modifications successfully implement the intended changes and improve the codebase by centralizing the
ChainID
configuration.CHANGELOG.md (22)
62-62
: New EVM extension for ICS-20 transferThis change introduces a wrapper for ICS-20
transfer
to automatically convert ERC-20 tokens to native Cosmos coins. This is a significant improvement that enhances interoperability between EVM and Cosmos ecosystems.
Line range hint
66-67
: API Breaking Changes: Renaming inflation moduleThe
inflation
module has been renamed toinflation/v1
. This change may require updates to any code or scripts that interact with the inflation module.Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
68-68
: API Breaking Changes: Deprecating legacy EIP-712 ante handlerThe legacy EIP-712 ante handler has been deprecated. Ensure that any systems relying on this handler are updated accordingly.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
72-73
: Improvement: Addition of Golang dependency vulnerability checkerA new CI step has been added to check for vulnerabilities in Golang dependencies. This enhances the security of the project.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
74-75
: Improvement: Default File store listener addedA default File store listener has been added for the application, implementing ADR38. This improves the application's ability to handle state changes.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
76-76
: Documentation: Audits page addedAn audits page has been added to the documentation, which improves transparency and security awareness for the project.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
77-78
: Improvement: New message for updating vesting funderA new
MsgUpdateVestingFunder
has been added to update theFunder
field of a clawback vesting account. This provides more flexibility in managing vesting accounts.Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
79-80
: Improvement: IBC denom utility functionsNew utility functions for IBC denoms have been added, which should simplify working with IBC denominations.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
81-81
: Improvement: ERC-20 module utility functionsNew utility functions (iterator and params) have been added for the ERC-20 module, enhancing its functionality.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
82-82
: Improvement: Go version updateThe project has been updated to use Go v1.19. Ensure all development environments are updated accordingly.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
83-83
: Testing: Node upgrade end-to-end test suiteA new end-to-end test suite for node upgrades has been added, improving the robustness of upgrade processes.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
84-84
: CLI Improvement: Google CLI SyntaxThe CLI now uses Google CLI Syntax for required and optional args, improving usability and consistency.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
85-85
: Performance: AnteHandlers re-orderedAnteHandlers have been re-ordered for better performance. Monitor the system to ensure this change has the intended effect.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
88-88
: Documentation: Ethereum tx indexer docs addedDocumentation for the Ethereum transaction indexer has been added, which should help with understanding and using this feature.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
90-90
: CLI Improvement: Prune command addedA new
prune
command has been added to the CLI, providing more control over data management.Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
91-91
: CLI Improvement: Ledger support addedLedger CLI support has been added, enhancing security options for users.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
95-95
: Bug Fix: Ledger supported algorithmsThe Ledger supported algorithms have been updated to only consist of
EthSecp256k1
. Ensure this change doesn't break existing integrations.Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
96-96
: CLI Update: Default node snapshot intervalThe default node snapshot interval has been updated to
5000
. Monitor system performance to ensure this change is optimal.Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
97-97
: CLI Fix: Version commandThe
evmosd version
command has been fixed to show either tag or last commit. This improves version tracking.Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
98-98
: CLI Fix: Snapshot configurationThe snapshot configuration has been fixed. Verify that snapshots are working as expected after this change.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
99-99
: App Improvement: gRPC node serviceThe gRPC node service is now set up with the application, enhancing the application's API capabilities.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
Line range hint
100-100
: Metrics Fix: Unbound metrics and labelsUnbound metrics have been fixed and labels that keep increasing have been removed. This should improve the stability and usefulness of metrics.
Tools
Markdownlint
60-60: Expected: 120; Actual: 133
Line length(MD013, line-length)
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.
LGTM! Great work @0xstepit!!
Left one nit comment
Given the refactor made with #2860, we do not need the
ChainID
in the EVM keeper anymore. This PR:BeginBlock
ofx/evm
.ChainID
tests.ChainID
with getters to global config.Summary by CodeRabbit
New Features
Bug Fixes
BeginBlock
functionality in the EVM component.Refactor
AppModule
interface by eliminating theBeginBlock
functionality.Chores