-
Notifications
You must be signed in to change notification settings - Fork 906
chore(evm): move chain_config to types #2898
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 encompass updates across various modules of the Evmos project, focusing on refining the handling of Ethereum-related configurations and enhancing functionality. Key modifications include replacing references to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
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 (
|
…nto GAtom22/evm-config
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: 24
🧹 Outside diff range and nitpick comments (30)
client/docs/swagger-ui/swagger.json (4)
2153-2160
: LGTM with a minor suggestion for improvement.The addition of the
trace_config.overrides.chain_id
parameter is well-structured and consistent with the PR objective. The use of string type with uint64 format is appropriate for chain IDs.Consider enhancing the description slightly for more clarity:
- "description": "chain_id is the id of the chain (EIP-155).", + "description": "The ID of the chain as per EIP-155 specification.",This minor change provides a bit more context about the EIP-155 reference.
22571-22575
: LGTM with a suggestion for title improvement.The addition of the
chain_id
field to the ChainConfig structure is consistent with the PR objective and matches the query parameter definition.Consider updating the title to match the improved description suggested earlier:
- "title": "chain_id is the id of the chain (EIP-155)" + "title": "The ID of the chain as per EIP-155 specification"This change would maintain consistency with the query parameter description and provide clearer context.
23172-23176
: Consistent duplication of ChainConfig structure with suggestion.This hunk adds the same
chain_id
field to the ChainConfig structure as in the previous hunk. This duplication is expected in Swagger files for different contexts requiring the same structure definition.The consistency between the two structure definitions is good, ensuring uniform API documentation.
As suggested for the previous occurrence, consider updating the title:
- "title": "chain_id is the id of the chain (EIP-155)" + "title": "The ID of the chain as per EIP-155 specification"This change would maintain consistency across all occurrences of this field in the Swagger file.
Inconsistencies found in
chain_id
definitionsThe
chain_id
field inclient/docs/swagger-ui/swagger.json
exhibits inconsistent definitions across multiple instances:
Type and Format:
int64
string
uint64
Descriptions and Titles:
- "chain_id is the eip155 chain id parsed from the requested block header."
- "chain_id is the id of the chain (EIP-155)"
These inconsistencies can lead to confusion and potential integration issues. Please standardize the type, format, and descriptions of
chain_id
to ensure uniformity across the Swagger documentation.🔗 Analysis chain
Line range hint
2153-23176
: Summary: PR objectives achieved with minor suggestions for improvementThe changes in this file successfully relocate the
chain_config
to the types section of the codebase, as per the PR objective. The additions of thechain_id
field to both the query parameters and the ChainConfig structure are consistent and well-implemented.Key points:
- The new query parameter
trace_config.overrides.chain_id
is correctly added and described.- The
chain_id
field is appropriately added to the ChainConfig structure.- The use of string type with uint64 format for chain_id is consistent throughout the file.
The changes enhance the API documentation by providing additional parameters related to chain configuration, specifically for trace configuration and chain identification. This aligns well with the PR's goal of moving chain_config to types.
To ensure consistency across the entire Swagger file, please run the following script:
This script will help identify any inconsistencies in the chain_id definitions throughout the Swagger file.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistency of chain_id definitions across the Swagger file # Test 1: Check for consistent type and format echo "Checking for consistent type and format of chain_id:" rg --json -e '"chain_id"' client/docs/swagger-ui/swagger.json | jq -r 'select(.data.submatches[0].match.text == "chain_id") | .data.lines.text' | sort | uniq # Test 2: Check for consistent description/title echo "Checking for consistent description/title of chain_id:" rg --json -e '"chain_id"' -A 3 client/docs/swagger-ui/swagger.json | jq -r 'select(.data.submatches[0].match.text == "chain_id") | .data.lines.text' | grep -E "description|title" | sort | uniqLength of output: 588
Script:
#!/bin/bash # Description: Count the number of occurrences of chain_id in swagger.json echo "Counting the number of 'chain_id' occurrences in swagger.json:" rg -c '"chain_id"' client/docs/swagger-ui/swagger.json # Description: List all lines containing chain_id with line numbers echo "Listing all lines containing 'chain_id' in swagger.json:" rg '"chain_id"' client/docs/swagger-ui/swagger.json -nLength of output: 2046
Script:
#!/bin/bash # Description: Extract unique type and format definitions for chain_id in swagger.json echo "Extracting unique type and format definitions for 'chain_id':" rg '"chain_id".*?' client/docs/swagger-ui/swagger.json -A 2 | \ grep -E '"type"| "format"' | \ jq -r 'split(":")[1] | gsub("[\", ]"; "")' | \ sort | uniq echo "" # Description: Extract unique descriptions and titles for chain_id in swagger.json echo "Extracting unique descriptions and titles for 'chain_id':" rg '"chain_id".*?' client/docs/swagger-ui/swagger.json -A 4 | \ grep -E '"description"| "title"' | \ jq -r 'split(": ")[1] | gsub("[\", ]"; "")' | \ sort | uniqLength of output: 875
Script:
#!/bin/bash # Description: Extract unique type and format definitions for chain_id in swagger.json echo "Extracting unique type and format definitions for 'chain_id':" rg '"chain_id"' client/docs/swagger-ui/swagger.json -A 5 | \ grep -E '"type"| "format"' | \ sed -E 's/.*"type":\s*"([^"]+)".*/\1/' | \ sed -E 's/.*"format":\s*"([^"]+)".*/\1/' | \ sort | uniq echo "" # Description: Extract unique descriptions and titles for chain_id in swagger.json echo "Extracting unique descriptions and titles for 'chain_id':" rg '"chain_id"' client/docs/swagger-ui/swagger.json -A 5 | \ grep -E '"description"| "title"' | \ sed -E 's/.*"description":\s*"([^"]+)".*/\1/' | \ sed -E 's/.*"title":\s*"([^"]+)".*/\1/' | \ sort | uniqLength of output: 798
x/evm/migrations/v8/migrate_test.go (2)
Line range hint
29-33
: LGTM! Consider adding a comment for clarity.The change to initialize
chainConfig
usingtypes.DefaultChainConfig(ctx.ChainID())
is a good improvement. It ensures that the chain configuration is correctly set based on the context's chain ID, which is more flexible and accurate.Consider adding a brief comment explaining why this initialization method is used, for example:
// Initialize chainConfig with the default configuration for the current chain ID chainConfig := types.DefaultChainConfig(ctx.ChainID())This would help future developers understand the reasoning behind this initialization method.
Inconsistent
chainConfig
Initializations FoundThe search identified instances where
chainConfig
is initialized without usingDefaultChainConfig
:
x/evm/types/chain_config.go: chainConfig = config.EthereumConfig(nil)
x/evm/config/configurator.go: ec.chainConfig = cc
These inconsistencies should be addressed to ensure uniform migration across the codebase.
🔗 Analysis chain
Line range hint
1-67
: Overall, the changes look good. Verify migration in other parts of the codebase.The modification to use
types.DefaultChainConfig(ctx.ChainID())
aligns well with the PR objective of movingchain_config
to types. The test coverage remains comprehensive, checking important parameters after migration.To ensure consistency across the codebase, please run the following script to check for any other occurrences of chain configuration initialization that might need similar updates:
This will help identify any other places in the codebase that might benefit from similar updates for consistency.
Update the search to identify chain configuration initializations not using
DefaultChainConfig
.The previous script failed due to unsupported look-around syntax in
rg
. Please run the updated script below with PCRE2 enabled to find any chain configuration initializations that do not useDefaultChainConfig
:🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for other occurrences of chain configuration initialization # Test: Look for patterns similar to the old initialization method rg --type go -i '(chainConfig|chain[cC]onfig)\s*:?=\s*(?!types\.DefaultChainConfig)' # Test: Verify usage of DefaultChainConfig rg --type go 'DefaultChainConfig'Length of output: 1219
Script:
# #!/bin/bash # Description: Search for chain configuration initializations not using DefaultChainConfig # Enable PCRE2 for look-around support rg --pcre2 --type go '(chainConfig|chain[cC]onfig)\s*[:]?=\s*(?!types\.DefaultChainConfig)'Length of output: 612
x/evm/wrappers/utils.go (1)
Line range hint
1-73
: Summary: Consistent package reference updates across the fileThe changes in this file successfully move the
chain_config
references from theconfig
package to theevmtypes
package. This is consistent across all functions (MustConvertEvmCoinTo18Decimals
,ConvertEvmCoinFrom18Decimals
,ConvertCoinsFrom18Decimals
, andAdjustExtraDecimalsBigInt
). The modifications maintain the existing function logic and signatures, ensuring backwards compatibility.These changes align well with the PR objective and appear to be part of a larger, systematic update to the codebase structure. No new bugs or issues were introduced by these changes.
To ensure the completeness of this refactoring:
- Verify that all necessary types and constants (e.g.,
EighteenDecimals
) have been properly moved to theevmtypes
package.- Confirm that any other files referencing the old
config
package for these EVM-related configurations have been updated similarly.- Update any relevant documentation or comments that might reference the old package structure.
tests/e2e/tx_test.go (1)
Remaining imports of the old
config
package found in the codebase. Please update or remove them to complete the refactoring.
x/evm/keeper/setup_test.go
x/evm/keeper/grpc_query_test.go
x/evm/config/configurator_test.go
app/config.go
app/ante/testutils/testutils.go
🔗 Analysis chain
Line range hint
1-68
: Overall changes look good. Verify consistency across the codebase.The changes in this file are part of the effort to move
chain_config
to thetypes
package. The modifications are limited to import statements and package references, with no functional changes to the test logic. This refactoring improves code organization without affecting the functionality of the tests.To ensure that this refactoring has been consistently applied across the entire codebase, please run the following script:
This script will help identify any inconsistencies in the refactoring across the codebase.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to the old evm config package # Test 1: Search for any remaining imports of the old package echo "Checking for remaining imports of the old package:" rg --type go 'github.com/evmos/evmos/v20/x/evm/config' # Test 2: Search for any remaining usage of 'config.GetEVMCoinDenom()' echo "Checking for remaining usage of 'config.GetEVMCoinDenom()':" rg --type go 'config\.GetEVMCoinDenom\(' # Test 3: Verify that all usages have been updated to 'evmtypes.GetEVMCoinDenom()' echo "Verifying updated usage to 'evmtypes.GetEVMCoinDenom()':" rg --type go 'evmtypes\.GetEVMCoinDenom\('Length of output: 4729
x/evm/types/denom_config.go (1)
Line range hint
89-92
: Clarify the purpose ofSetEVMCoinTEST
or consider removing it.The newly added
SetEVMCoinTEST
function is identical toSetEVMCoinInfo
. Its purpose is unclear, and it introduces redundancy in the codebase.Consider the following options:
- If this function is intended for testing, move it to a separate test file.
- If it's not needed, remove it to avoid confusion and maintain code cleanliness.
Please clarify the intention behind this addition and take appropriate action.
x/evm/config/configurator.go (1)
Line range hint
1-95
: Overall assessment: Changes look good, pending verificationThe modifications in this file consistently replace
geth
package references withtypes
package references forChainConfig
andEvmCoinInfo
. These changes align well with the PR objective of movingchain_config
to thetypes
package. The code structure and logic remain intact, with only type references being updated.To ensure the completeness of this change:
- Verify that all necessary types and functions (
ChainConfig
,EvmCoinInfo
,SetChainConfig
,SetEVMCoinInfo
) exist in thetypes
package as expected.- Confirm that there are no remaining references to the
geth
package for these types in other parts of the codebase.- Ensure that any dependent modules or packages are updated to use these new type references from the
types
package.Consider adding a brief comment in the file header or near the import statements to explain the rationale behind moving these types to the
types
package. This can help future maintainers understand the architectural decision.app/post/setup_test.go (2)
Line range hint
1-158
: Summary: Chain configuration access refactoredThe changes in this file are part of a larger refactoring effort to move the chain configuration from the
config
package to theevmtypes
package. This modification affects how the chain ID is accessed in theBuildEthTx
method.Key points:
- Import statements have been updated (not visible in the provided snippet).
config.GetChainConfig().ChainID
has been replaced withevmtypes.GetChainConfig().ChainID
.These changes appear to be minimal and focused. However, it's important to ensure that:
- All related files have been updated consistently.
- The test suite passes with these changes.
- There are no unintended side effects in other parts of the codebase that might still be using the old
config
package.Consider adding a comment in the
BuildEthTx
method to explain whyevmtypes.GetChainConfig()
is used instead of a more generic configuration access method. This could help future developers understand the reasoning behind this specific implementation.
Config import still present in app/post/setup_test.go
The
config
import is still present inapp/post/setup_test.go
. Please remove it if it's no longer needed.🔗 Analysis chain
Line range hint
1-70
: Verify import statement changesThe AI summary mentions a change in import statements, replacing
config
withevmtypes
. However, this change is not visible in the provided code snippet. Please ensure that the import statements have been updated correctly to include theevmtypes
package and remove theconfig
package if it's no longer needed.To verify the import changes, run the following script:
[/run_scripts]
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for the presence of evmtypes import and absence of config import # Test 1: Check for evmtypes import if rg --type go 'evmtypes "github.com/evmos/evmos/v20/x/evm/types"' app/post/setup_test.go; then echo "evmtypes import found" else echo "evmtypes import not found" fi # Test 2: Check for absence of config import if ! rg --type go '"github.com/evmos/evmos/v20/config"' app/post/setup_test.go; then echo "config import not found (as expected)" else echo "config import still present" fiLength of output: 231
Script:
#!/bin/bash # Description: Verify evmtypes import exists and config import does not in app/post/setup_test.go # Test 1: Check for the presence of evmtypes import if ast-grep --lang go --pattern 'import $_ "github.com/evmos/evmos/v20/x/evm/types"' app/post/setup_test.go; then echo "evmtypes import found" else echo "evmtypes import not found" fi # Test 2: Ensure config import is absent if ! ast-grep --lang go --pattern 'import $_ "github.com/evmos/evmos/v20/config"' app/post/setup_test.go; then echo "config import not found (as expected)" else echo "config import still present" fiLength of output: 326
precompiles/erc20/tx.go (1)
112-114
: Approved with a minor formatting suggestionThe change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is correct and aligns with the PR objective. However, the indentation of these lines seems to be inconsistent with the rest of the function.Consider adjusting the indentation to match the surrounding code:
-if p.tokenPair.Denom == evmtypes.GetEVMCoinDenom() { - p.SetBalanceChangeEntries(cmn.NewBalanceChangeEntry(from, msg.Amount.AmountOf(evmtypes.GetEVMCoinDenom()).BigInt(), cmn.Sub), - cmn.NewBalanceChangeEntry(to, msg.Amount.AmountOf(evmtypes.GetEVMCoinDenom()).BigInt(), cmn.Add)) +if p.tokenPair.Denom == evmtypes.GetEVMCoinDenom() { + p.SetBalanceChangeEntries(cmn.NewBalanceChangeEntry(from, msg.Amount.AmountOf(evmtypes.GetEVMCoinDenom()).BigInt(), cmn.Sub), + cmn.NewBalanceChangeEntry(to, msg.Amount.AmountOf(evmtypes.GetEVMCoinDenom()).BigInt(), cmn.Add)) }app/ante/testutils/testutils.go (1)
93-101
: Summary of changes to EVM chain configuration in test suiteThe modifications to the
SetupTest
method involve updating how the EVM chain configuration is set up for testing:
- The default chain configuration is now sourced from
evmtypes
instead ofconfig
.- Block parameters (LondonBlock, ArrowGlacierBlock, etc.) are assigned differently, potentially changing their type from
*big.Int
to*sdkmath.Int
.These changes may impact how the test suite interacts with the EVM module and could affect test behavior. Ensure that these modifications align with the intended updates to the EVM module and that all tests still pass correctly.
Consider adding comments explaining the rationale behind these changes, especially if they're part of a larger refactoring effort involving the EVM module.
x/evm/keeper/utils_test.go (4)
33-33
: LGTM: Updated to use evmtypes packageThe change from
evmconfig.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
is consistent with the PR objective of moving chain_config to types. This update ensures that the chain ID is retrieved from the correct package.Consider extracting the chain ID retrieval to a separate function in the test suite for better reusability across test functions. For example:
func (suite *KeeperTestSuite) getChainID() *big.Int { return evmtypes.GetChainConfig().ChainID }This would allow you to use
suite.getChainID()
in all test functions, making it easier to update if the retrieval method changes in the future.
92-92
: LGTM: Updated to use evmtypes packageThe change from
evmconfig.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
is consistent with the PR objective of moving chain_config to types. This update ensures that the chain ID is retrieved from the correct package.As suggested earlier, consider extracting the chain ID retrieval to a separate function in the test suite for better reusability. This would allow you to replace this line with
chainID := suite.getChainID()
, improving consistency across test functions.
148-148
: LGTM: Updated to use evmtypes packageThe change from
evmconfig.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
is consistent with the PR objective of moving chain_config to types. This update ensures that the chain ID is retrieved from the correct package.As suggested earlier, consider extracting the chain ID retrieval to a separate function in the test suite for better reusability. This would allow you to replace this line with
chainID := suite.getChainID()
, improving consistency across test functions.
Line range hint
1-196
: Overall LGTM: Consistent updates across the fileThe changes in this file are consistent with the PR objective of moving
chain_config
to types. All instances ofevmconfig.GetChainConfig().ChainID
have been replaced withevmtypes.GetChainConfig().ChainID
, which is the correct approach.To further improve the code, consider implementing a helper method in the test suite to retrieve the chain ID:
func (suite *KeeperTestSuite) getChainID() *big.Int { return evmtypes.GetChainConfig().ChainID }This would allow you to replace all occurrences of
evmtypes.GetChainConfig().ChainID
withsuite.getChainID()
, improving consistency and making future updates easier if the retrieval method changes.x/evm/keeper/statedb.go (2)
Line range hint
113-130
: Improved balance management with explicit minting/burning.The changes to the
SetBalance
function provide a more robust approach to managing account balances. The explicit comparison between the current and new balance, followed by appropriate minting or burning of tokens, is a good practice.Consider adding more detailed error messages to help with debugging:
if err := k.bankWrapper.MintAmountToAccount(ctx, cosmosAddr, delta); err != nil { - return err + return fmt.Errorf("failed to mint tokens: %w", err) }Similarly for the burning operation.
Line range hint
231-265
: Enhanced account deletion with improved safety checks.The changes to the
DeleteAccount
function significantly improve its safety and completeness. The addition of a check to ensure only smart contracts can be self-destructed is a crucial safety measure.Consider wrapping the error returned by
SetBalance
for better error context:// clear balance if err := k.SetBalance(ctx, addr, new(big.Int)); err != nil { - return err + return fmt.Errorf("failed to clear balance: %w", err) }Also, consider adding error handling for the
DeleteState
operation in theForEachStorage
loop, as it might fail silently if there's an issue.app/ante/evm/mono.go (1)
Line range hint
91-96
: LGTM: Improved error handling for base feeThis change enhances error handling by ensuring that the base fee is properly set when London rules are in effect. The error message is clear and informative.
Consider slightly rewording the error message for clarity:
- "base fee is supported but evm block context value is nil", + "base fee is expected but not set in the EVM block context",This minor change makes the error message more precise about the nature of the issue.
x/evm/keeper/state_transition_benchmark_test.go (2)
166-166
: LGTM. Consider extracting chain config.The change aligns with the PR objective of moving
chain_config
to types. However, for better readability and potential reuse, consider extracting the chain config into a variable:chainConfig := evmtypes.GetChainConfig() ethSigner := ethtypes.LatestSignerForChainID(chainConfig.ChainID)This approach would make the code more readable and allow for easier reuse of the chain config if needed elsewhere in the function.
254-255
: LGTM. Consider using the extracted config.Good job on extracting the chain config into a variable. However,
GetChainConfig()
is called twice. Consider optimizing this:ethCfg := evmtypes.GetChainConfig() signer := ethtypes.LatestSignerForChainID(ethCfg.ChainID)This approach avoids calling
GetChainConfig()
twice and improves code efficiency.rpc/backend/node_info_test.go (2)
Line range hint
181-208
: LGTM: Enhanced test coverage for Syncing functionality.The new test cases improve the robustness of the Syncing functionality by covering additional scenarios. This is a good improvement to the test suite.
Consider adding a test case for when the node is fully synced but not catching up, to ensure all possible states are covered. You could add something like:
{ "pass - Node is fully synced", func() { client := suite.backend.clientCtx.Client.(*mocks.Client) RegisterStatus(client) status, _ := client.Status(suite.backend.ctx) status.SyncInfo.CatchingUp = false status.SyncInfo.LatestBlockHeight = 1000 status.SyncInfo.EarliestBlockHeight = 1 }, false, true, },
Line range hint
215-295
: LGTM: Improved test coverage for SetEtherbase functionality.The expanded test cases for TestSetEtherbase significantly improve the coverage of various scenarios. This enhancement will help ensure the robustness of the SetEtherbase functionality.
There's a TODO comment for an incomplete test case. Would you like assistance in completing this test case? I can help draft the implementation or create a GitHub issue to track this task.
CHANGELOG.md (2)
Missing Implementations for State Machine Breaking Changes
- The following functions and precompiles mentioned in the review comment were not found in the codebase:
secp256r1
curve precompileClaimRewards
custom transactionbech32
conversion precompileCreateValidator
function for staking precompiled contractRestrictedFeeTokens
🔗 Analysis chain
Line range hint
31-35
: State Machine Breaking ChangesThese changes are significant and will require careful consideration during the upgrade process:
- Addition of the
secp256r1
curve precompile (RIP-7212)- New
ClaimRewards
custom transaction in the distribution precompile- Addition of the
bech32
conversion precompile- Implementation of the
CreateValidator
function for staking precompiled contract- Restriction of transaction fee tokens
These changes enhance the functionality of the chain but may require updates to existing applications and smart contracts interacting with these features.
To ensure these changes are properly implemented, run the following commands:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for the presence of new precompiles and functions grep -R "secp256r1" . grep -R "ClaimRewards" . grep -R "bech32" . grep -R "CreateValidator" . grep -R "RestrictedFeeTokens" .Length of output: 1212
🧰 Tools
🪛 Markdownlint
67-67: Expected: 120; Actual: 150
Line length(MD013, line-length)
Changelog Does Not Reflect API Breaking Changes
The changelog mentions API breaking changes regarding the renaming of the
inflation
module toinflation/v1
and the deprecation of the legacy EIP-712 ante handler. However, the provided shell script results do not show any occurrences ofinflation/v1
or deprecation warnings for EIP-712.
- The
inflation/v1
module is not found in the codebase.- The deprecated EIP-712 ante handler is still present.
🔗 Analysis chain
Line range hint
36-40
: API Breaking ChangesThe following API changes may affect existing integrations:
- Renaming the
inflation
module toinflation/v1
- Deprecation of the legacy EIP-712 ante handler
Developers should update their applications to use the new module names and remove any dependencies on the deprecated EIP-712 ante handler.
To verify these changes, run:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for the new inflation module name and deprecated EIP-712 handler grep -R "inflation/v1" . grep -R "Deprecated.*EIP-712" .Length of output: 1212
🧰 Tools
🪛 Markdownlint
67-67: Expected: 120; Actual: 150
Line length(MD013, line-length)
x/evm/types/chain_config.go (1)
4-4
: Fix typo in comment: "convenient"There's a typo in the comment. "convinient" should be "convenient".
Apply this diff to correct the typo:
-// This config provides a convinient way to modify x/evm params and values. +// This config provides a convenient way to modify x/evm params and values.x/evm/keeper/state_transition_test.go (2)
552-552
: Remove redundant variablenetworkConfig
The variable
networkConfig
is assigned the value oftypes.GetChainConfig()
, which should be obtained from the keeper after thechain_config
move. Additionally, this comparison is redundant since it was already performed a few lines above.Consider removing these lines to clean up the code:
- networkConfig := types.GetChainConfig() - suite.Require().Equal(networkConfig, cfg.ChainConfig)
552-552
: Avoid reassigning and comparing already tested configurationsThe comparison at this line duplicates a previous test. Since
cfg.ChainConfig
has already been compared to the keeper'sChainConfig()
, reassigningnetworkConfig
and comparing again is unnecessary.Remove the redundant code:
- networkConfig := types.GetChainConfig() - suite.Require().Equal(networkConfig, cfg.ChainConfig)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
x/evm/types/evm.pb.go
is excluded by!**/*.pb.go
📒 Files selected for processing (72)
- CHANGELOG.md (1 hunks)
- api/ethermint/evm/v1/evm.pulsar.go (16 hunks)
- app/ante/cosmos/authz_test.go (2 hunks)
- app/ante/evm/05_signature_verification.go (1 hunks)
- app/ante/evm/08_vesting.go (1 hunks)
- app/ante/evm/11_gas_wanted.go (2 hunks)
- app/ante/evm/ante_test.go (10 hunks)
- app/ante/evm/eth_benchmark_test.go (2 hunks)
- app/ante/evm/fee_checker.go (1 hunks)
- app/ante/evm/fee_checker_test.go (1 hunks)
- app/ante/evm/fee_market_test.go (1 hunks)
- app/ante/evm/mono.go (1 hunks)
- app/ante/evm/setup_ctx_test.go (1 hunks)
- app/ante/evm/signverify_test.go (1 hunks)
- app/ante/evm/sigs_test.go (1 hunks)
- app/ante/evm/utils_test.go (1 hunks)
- app/ante/testutils/testutils.go (1 hunks)
- app/config.go (2 hunks)
- app/post/setup_test.go (1 hunks)
- client/docs/swagger-ui/swagger.json (4 hunks)
- ethereum/eip712/eip712_test.go (2 hunks)
- ethereum/eip712/preprocess_test.go (2 hunks)
- precompiles/distribution/distribution_test.go (1 hunks)
- precompiles/distribution/tx.go (5 hunks)
- precompiles/erc20/tx.go (2 hunks)
- precompiles/gov/gov_test.go (1 hunks)
- precompiles/ics20/tx.go (2 hunks)
- precompiles/staking/staking_test.go (1 hunks)
- precompiles/staking/tx.go (2 hunks)
- precompiles/testutil/contracts/contracts.go (1 hunks)
- precompiles/vesting/tx.go (3 hunks)
- proto/ethermint/evm/v1/evm.proto (1 hunks)
- rpc/backend/backend_suite_test.go (1 hunks)
- rpc/backend/call_tx.go (2 hunks)
- rpc/backend/call_tx_test.go (1 hunks)
- rpc/backend/chain_info.go (1 hunks)
- rpc/backend/node_info.go (3 hunks)
- rpc/backend/node_info_test.go (2 hunks)
- rpc/backend/sign_tx.go (1 hunks)
- rpc/backend/sign_tx_test.go (1 hunks)
- rpc/backend/tracing_test.go (1 hunks)
- tests/e2e/tx_test.go (2 hunks)
- testutil/contract.go (2 hunks)
- testutil/integration/evmos/network/network.go (1 hunks)
- testutil/tx/eth.go (3 hunks)
- x/evm/client/cli/tx.go (1 hunks)
- x/evm/config/chain_config.go (0 hunks)
- x/evm/config/configurator.go (3 hunks)
- x/evm/keeper/benchmark_test.go (7 hunks)
- x/evm/keeper/config.go (1 hunks)
- x/evm/keeper/fees_test.go (1 hunks)
- x/evm/keeper/grpc_query.go (2 hunks)
- x/evm/keeper/grpc_query_test.go (5 hunks)
- x/evm/keeper/keeper.go (1 hunks)
- x/evm/keeper/keeper_test.go (1 hunks)
- x/evm/keeper/setup_test.go (3 hunks)
- x/evm/keeper/state_transition.go (1 hunks)
- x/evm/keeper/state_transition_benchmark_test.go (6 hunks)
- x/evm/keeper/state_transition_test.go (3 hunks)
- x/evm/keeper/statedb.go (1 hunks)
- x/evm/keeper/statedb_test.go (1 hunks)
- x/evm/keeper/utils_test.go (4 hunks)
- x/evm/migrations/v8/migrate_test.go (1 hunks)
- x/evm/types/chain_config.go (4 hunks)
- x/evm/types/chain_config_test.go (20 hunks)
- x/evm/types/denom_config.go (2 hunks)
- x/evm/types/msg_test.go (1 hunks)
- x/evm/types/params.go (0 hunks)
- x/evm/types/params_test.go (0 hunks)
- x/evm/wrappers/bank.go (2 hunks)
- x/evm/wrappers/utils.go (4 hunks)
- x/evm/wrappers/utils_test.go (6 hunks)
💤 Files with no reviewable changes (3)
- x/evm/config/chain_config.go
- x/evm/types/params.go
- x/evm/types/params_test.go
🔇 Additional comments (162)
client/docs/swagger-ui/swagger.json (1)
2513-2520
: Consistent duplication of parameter definition.This hunk adds the same
trace_config.overrides.chain_id
parameter as in the previous hunk. This duplication is expected in Swagger files for different endpoints requiring the same parameter.The consistency between the two parameter definitions is good, ensuring uniform API documentation.
app/ante/evm/setup_ctx_test.go (1)
18-18
: LGTM! Verify consistency across the codebase.The change from
config.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
aligns with the PR objective of movingchain_config
to types. This modification is consistent with the import changes and should maintain the same functionality.To ensure this change is consistent across the codebase, please run the following script:
This script will help identify any inconsistencies in the usage of
GetChainConfig()
across the codebase, ensuring that the change has been applied uniformly.app/ante/evm/sigs_test.go (4)
Line range hint
1-50
: Summary: Changes align with PR objectivesThe modifications in this file are consistent with the PR's goal of moving
chain_config
to types. The main changes include:
- Updated import statement to include
evmtypes
.- Changed
evmChainID
retrieval to useevmtypes.GetChainConfig().ChainID
.These changes appear to be correctly implemented without affecting the overall test logic. The test still creates a transaction, retrieves signatures, and compares them as before.
To ensure the changes haven't introduced any regressions:
- Verify that all tests in this package still pass.
- Consider adding a test case that specifically checks the
evmChainID
value to ensure it's correctly retrieved from the new location.
Line range hint
1-7
: Verify removal of unused importsThe addition of the
evmtypes
import is consistent with the changes. However, ensure that any previously usedconfig
import has been removed if it's no longer needed.Run the following script to check for any remaining
config
imports:
Line range hint
19-50
: Confirm test logic integrity and resultsThe change in
evmChainID
retrieval doesn't appear to affect the overall test logic or expected results. The test still correctly creates a transaction, retrieves signatures, and compares them as before.To ensure the test results remain consistent with the changes, please run the following command and verify that the test passes:
17-17
: LGTM: Consistent change inevmChainID
retrievalThe change in retrieving
evmChainID
fromevmtypes.GetChainConfig().ChainID
is consistent with the PR objective of movingchain_config
to types. This modification aligns well with the updated import statement.To ensure the
GetChainConfig()
method inevmtypes
package is correctly implemented, run the following script:app/ante/evm/11_gas_wanted.go (3)
35-35
: LGTM. Consistent with import change.The modification to use
evmtypes.GetChainConfig()
is consistent with the earlier import change. The function's logic remains intact, maintaining the existing behavior while improving code organization.
Line range hint
1-80
: Overall assessment: Changes are minimal and aligned with PR objectives.The modifications in this file are focused on relocating
chain_config
to types, as per the PR objectives. The changes are minimal, don't introduce new functionality, and maintain existing behavior. TheCheckGasWanted
function and other parts of the file remain unchanged, which is appropriate given the scope of this PR.
12-12
: LGTM. Verify impact on other imports.The change from
config
toevmtypes
for importingGetChainConfig
aligns with the PR objective of movingchain_config
to types. This modification improves the organization of the codebase.To ensure this change doesn't introduce issues elsewhere, please run the following script to check for any remaining imports of
GetChainConfig
from the old location:If the script returns any results, those files may need to be updated as well.
app/config.go (3)
14-14
: LGTM: Import addition is correct and necessary.The addition of the
evmtypes
import is appropriate and aligns with the changes made in theInitializeAppConfiguration
function.
41-41
: LGTM: Package change aligns with PR objective.The change from
evmconfig.EighteenDecimals
toevmtypes.EighteenDecimals
is consistent with the PR objective of moving configurations to types.To ensure this change doesn't introduce any issues, please run the following script to check for any remaining references to
evmconfig.EighteenDecimals
:#!/bin/bash # Description: Check for any remaining references to evmconfig.EighteenDecimals # Test: Search for evmconfig.EighteenDecimals. Expect: No results. rg --type go 'evmconfig\.EighteenDecimals'
Line range hint
1-85
: Overall LGTM: Changes align with PR objective, but require comprehensive verification.The changes in this file are consistent with the PR objective of moving
chain_config
to types. However, given that these changes are likely part of a larger refactoring effort, it's crucial to ensure consistency across the entire codebase.To ensure these changes don't introduce any issues and are consistently applied throughout the codebase, please run the following comprehensive check:
#!/bin/bash # Description: Comprehensive check for evmconfig to evmtypes migration # Test 1: Search for any remaining imports of evmconfig. Expect: Only in this file. echo "Checking for remaining evmconfig imports:" rg --type go 'import.*"github.com/evmos/evmos/v20/x/evm/config"' # Test 2: Search for any remaining uses of evmconfig package. Expect: No results. echo "Checking for remaining evmconfig package uses:" rg --type go 'evmconfig\.' # Test 3: Verify that evmtypes is now used instead. Expect: Multiple results, including in this file. echo "Verifying evmtypes usage:" rg --type go 'evmtypes\.(DefaultChainConfig|EighteenDecimals)'Please review the results of these checks to ensure the migration from
evmconfig
toevmtypes
is complete and consistent across the codebase.app/ante/evm/signverify_test.go (1)
17-17
: LGTM! Verify consistency across the codebase.The change from
config.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
aligns with the PR objective of movingchain_config
to types. This refactoring improves code organization.To ensure consistency and correctness:
- Verify that
evmtypes.GetChainConfig().ChainID
returns the same value as the previous implementation.- Check for other occurrences of
config.GetChainConfig()
in the codebase that may need updating.Run the following script to find other potential occurrences:
Review the results to ensure all relevant occurrences have been updated consistently.
✅ Verification successful
All instances of
config.GetChainConfig()
have been successfully replaced withevmtypes.GetChainConfig()
, ensuring consistency across the codebase. The refactoring aligns with the PR objectives and poses no issues.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find other occurrences of config.GetChainConfig() that may need updating # Search for config.GetChainConfig() usage echo "Occurrences of config.GetChainConfig():" rg --type go 'config\.GetChainConfig\(\)' # Search for evmtypes.GetChainConfig() usage to compare echo -e "\nOccurrences of evmtypes.GetChainConfig():" rg --type go 'evmtypes\.GetChainConfig\(\)'Length of output: 3600
x/evm/wrappers/utils.go (4)
12-12
: LGTM: Import statement added correctlyThe addition of the
evmtypes
import is necessary for the subsequent changes in the file and follows the correct package structure.
32-33
: LGTM: Consistent package reference updatesThe changes from
config
toevmtypes
are consistent with the PR objective and previous function changes. The function logic and signature remain unchanged, preserving backwards compatibility.Also applies to: 36-36
45-45
: LGTM: Package references updated consistentlyThe changes from
config
toevmtypes
are consistent with the PR objective and previous function modifications. The function logic and signature remain intact, ensuring backwards compatibility.Also applies to: 50-50
66-67
: LGTM: Package references updated consistentlyThe changes from
config
toevmtypes
are consistent with the PR objective and previous function modifications. The function logic and signature remain intact, ensuring backwards compatibility.To ensure the correctness of the
EighteenDecimals
constant, please run the following verification script:✅ Verification successful
Verification Complete:
EighteenDecimals
Exists inevmtypes
The
EighteenDecimals
identifier is defined in theevmtypes
package withinx/evm/types/denom_config.go
. The changes fromconfig
toevmtypes
correctly reference this identifier, ensuring consistent and accurate package usage.
- Defined in
x/evm/types/denom_config.go
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the existence of EighteenDecimals constant in evmtypes ast-grep --lang go --pattern 'const EighteenDecimals = $_'Length of output: 60
Script:
#!/bin/bash # Search for any occurrences of EighteenDecimals in the codebase rg 'EighteenDecimals' --glob 'evmtypes/*.go' -A 2Length of output: 198
Script:
#!/bin/bash # Search for any declarations or usages of EighteenDecimals across all Go files rg 'EighteenDecimals' --type go -A 2Length of output: 3005
tests/e2e/tx_test.go (1)
28-28
: LGTM! Function usage updated correctly.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the import statement modification and aligns with the PR objective.x/evm/types/denom_config.go (2)
68-71
: FunctionSetEVMCoinInfo
is now public.The renaming of
setEVMCoinInfo
toSetEVMCoinInfo
makes the function public. This change is correct and aligns with Go conventions for exported functions.To ensure this change is intentional and doesn't introduce unintended access, please run the following script:
#!/bin/bash # Description: Check for usage of SetEVMCoinInfo across the codebase # Test: Search for usage of SetEVMCoinInfo rg --type go 'SetEVMCoinInfo' # Note: Review the results to ensure that making this function public is intentional and doesn't introduce any security or architectural concerns.
7-7
: Package declaration change looks good.The change from
package config
topackage types
aligns with the PR objective of movingchain_config
to types.To ensure this change doesn't break existing imports, please run the following script:
✅ Verification successful
It appears the previous script didn’t capture any import statements related to the old
config
package. Let's ensure we accurately search for any remaining imports ofconfig
.Please run the following script to check for any remaining imports of the
config
package:
Import statements updated successfully.
No remaining imports of the old
config
package were found in the codebase. The package declaration change frompackage config
topackage types
has been successfully verified.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining imports of the old package and suggest updates # Test: Search for imports of the old package rg --type go 'import.*".*config"' # Note: If any results are found, they may need to be updated to import from "types" instead.Length of output: 277
Script:
#!/bin/bash # Description: Verify that there are no remaining imports of the old 'config' package. # Search for import statements importing 'config' rg --type go '^import\s+"[^"]*config"' .Length of output: 42
x/evm/client/cli/tx.go (1)
62-62
: LGTM! Verify the new function exists and works as expected.The change from
config.GetEVMCoinDenom()
totypes.GetEVMCoinDenom()
aligns with the PR objective of movingchain_config
to types. This modification appears to improve the module's structure.To ensure the change is implemented correctly, please run the following verification:
This script will help confirm that the function has been moved correctly and that there are no remaining references to the old
config.GetEVMCoinDenom()
.app/ante/evm/eth_benchmark_test.go (3)
Line range hint
1-95
: Overall assessment: Changes look good and align with PR objectives.The modifications in this file successfully move the chain configuration and EVM coin denomination retrieval from a
config
package to theevmtypes
package. This change improves code organization and centralizes EVM-related configurations.To ensure a smooth transition:
- Run the provided verification scripts to check for any remaining usages of the old
config
package methods.- Update the import statements if necessary (although no changes were required in this file).
- Ensure that all tests pass after these changes.
Great job on improving the code structure!
80-80
: LGTM. Verify impact on other parts of the codebase.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the PR objective of moving chain_config to types. This modification centralizes EVM-related configurations in theevmtypes
package, improving code organization.To ensure this change doesn't introduce inconsistencies, please run the following script to check for any remaining usage of
config.GetEVMCoinDenom()
:
31-31
: LGTM. Verify impact on other parts of the codebase.The change from
config.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
aligns with the PR objective of moving chain_config to types. This modification improves code organization by centralizing chain configuration in theevmtypes
package.To ensure this change doesn't introduce inconsistencies, please run the following script to check for any remaining usage of
config.GetChainConfig()
:x/evm/keeper/setup_test.go (4)
17-17
: LGTM: Import statement added correctly.The addition of the
evmtypes
import is necessary and consistent with the changes made in the file. It allows the use ofevmtypes.GetEVMCoinDenom()
andevmtypes.DefaultChainConfig()
.
67-67
: LGTM: Coin denomination retrieval updated correctly.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with movingchain_config
to types. The functionality remains the same, only the source package has changed.To ensure this change doesn't affect other parts of the codebase, please run the following script:
#!/bin/bash # Description: Check for any remaining usage of config.GetEVMCoinDenom() # Test: Search for any remaining usage of config.GetEVMCoinDenom(). Expect: No results. rg --type go 'config\.GetEVMCoinDenom\(\)' # Test: Confirm that evmtypes.GetEVMCoinDenom() is now used. Expect: At least one result. rg --type go 'evmtypes\.GetEVMCoinDenom\(\)'
91-91
: LGTM: Chain configuration retrieval updated correctly.The change from
config.DefaultChainConfig()
toevmtypes.DefaultChainConfig()
is consistent with movingchain_config
to types. The functionality remains the same, only the source package has changed.To ensure this change doesn't affect other parts of the codebase, please run the following script:
✅ Verification successful
Verification Passed: Chain configuration retrieval updated successfully.
All instances of
config.DefaultChainConfig()
have been replaced withevmtypes.DefaultChainConfig()
, ensuring consistency across the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of config.DefaultChainConfig() # Test: Search for any remaining usage of config.DefaultChainConfig(). Expect: No results. rg --type go 'config\.DefaultChainConfig\(' # Test: Confirm that evmtypes.DefaultChainConfig() is now used. Expect: At least one result. rg --type go 'evmtypes\.DefaultChainConfig\('Length of output: 458
93-99
: Verify the impact of changing block parameter types.The change from
maxInt.BigInt()
to&maxInt
alters the type of the assigned values from*big.Int
to*sdkmath.Int
. This modification might affect how these parameters are used elsewhere in the codebase. Additionally, using a pointer (&maxInt
) instead of a value could potentially lead to unexpected behavior if the value ofmaxInt
is modified elsewhere.Please run the following script to check for potential impacts:
Please review the results to ensure that all usages of these block parameters are compatible with the new
*sdkmath.Int
type.✅ Verification successful
The type changes for block parameters are consistent and compatible.
After reviewing the usage of
LondonBlock
,ArrowGlacierBlock
,GrayGlacierBlock
,MergeNetsplitBlock
,ShanghaiBlock
, andCancunBlock
across the codebase, it is evident that all references are consistently using*sdkmath.Int
. There are no conflicting type usages or incompatible operations identified. Therefore, the change from*big.Int
to*sdkmath.Int
does not introduce any issues.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of LondonBlock, ArrowGlacierBlock, GrayGlacierBlock, MergeNetsplitBlock, ShanghaiBlock, and CancunBlock # Test: Search for usage of these block parameters. # Expect: Results showing how these parameters are used, to verify compatibility with *sdkmath.Int rg --type go -A 5 '(LondonBlock|ArrowGlacierBlock|GrayGlacierBlock|MergeNetsplitBlock|ShanghaiBlock|CancunBlock)' # Test: Check for any comparisons or operations involving these block parameters # Expect: Results showing how these parameters are compared or operated on, to ensure *sdkmath.Int is handled correctly rg --type go '(LondonBlock|ArrowGlacierBlock|GrayGlacierBlock|MergeNetsplitBlock|ShanghaiBlock|CancunBlock).*(\+|-|\*|/|==|!=|<|>|<=|>=)'Length of output: 67408
app/ante/evm/05_signature_verification.go (2)
Line range hint
1-86
: Overall assessment: The change is minimal and aligned with PR objectives.The modification to use
evmtypes.GetChainConfig()
instead ofconfig.GetChainConfig()
is the only change in this file. It appears to be a straightforward update that aligns with the PR's goal of movingchain_config
to types. The overall functionality of the Ethereum signature verification logic remains unchanged.
34-34
: LGTM. Verify the newGetChainConfig()
implementation.The change from
config.GetChainConfig()
toevmtypes.GetChainConfig()
aligns with the PR objective of movingchain_config
to types. This modification should not affect the logic of theAnteHandle
function.To ensure the change doesn't introduce any regressions, please verify the implementation of
evmtypes.GetChainConfig()
:✅ Verification successful
Verified:
evmtypes.GetChainConfig()
is correctly implemented in./x/evm/types/chain_config.go
and matches the expected signature.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of evmtypes.GetChainConfig() # Test: Check the implementation of GetChainConfig in evmtypes ast-grep --lang go --pattern $'func GetChainConfig() *params.ChainConfig {'Length of output: 542
Script:
#!/bin/bash # Description: Verify the implementation of evmtypes.GetChainConfig() # Test: Check the implementation of GetChainConfig in evmtypes with corrected pattern ast-grep --lang go --pattern 'func GetChainConfig() *params.ChainConfig'Length of output: 74
Script:
#!/bin/bash # Description: Search for the GetChainConfig function in evmtypes package # Test: Use ripgrep to find the GetChainConfig function definition in evmtypes rg 'func GetChainConfig' ./app/ante/evm/Length of output: 42
Script:
#!/bin/bash # Description: Search for the GetChainConfig function across the entire codebase # Test: Use ripgrep to find the GetChainConfig function definition rg 'func GetChainConfig' .Length of output: 100
x/evm/config/configurator.go (4)
24-25
: LGTM: Type changes in EVMConfigurator structThe changes to the
chainConfig
andevmDenom
field types in theEVMConfigurator
struct are consistent with the PR objective of movingchain_config
to thetypes
package. This modification aligns well with the overall goal of the pull request.
49-49
: LGTM: Updated WithChainConfig method signatureThe change in the
WithChainConfig
method signature to use*types.ChainConfig
is consistent with the modifications made to theEVMConfigurator
struct. This update maintains the coherence of the type changes throughout the file.
56-57
: LGTM: Updated WithEVMCoinInfo methodThe changes in the
WithEVMCoinInfo
method, including the updated signature usingtypes.Decimals
and the use oftypes.EvmCoinInfo
, are consistent with the overall modifications in this file. These updates maintain type consistency and align with the PR objective.
69-72
: LGTM: Updated Configure method with new type referencesThe changes in the
Configure
method, replacinggeth.SetChainConfig
withtypes.SetChainConfig
andgeth.SetEVMCoinInfo
withtypes.SetEVMCoinInfo
, are consistent with the overall modifications in this file. These updates align well with the PR objective.Please run the following script to verify the existence of these new functions in the
types
package:✅ Verification successful
Verification Successful: New Functions Confirmed
The functions
SetChainConfig
andSetEVMCoinInfo
exist within thetypes
package as confirmed by the search results. The updates in theConfigure
method correctly reference these functions and are aligned with the overall modifications in the file.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of SetChainConfig and SetEVMCoinInfo functions in the types package # Test: Search for SetChainConfig function echo "Searching for SetChainConfig function:" rg --type go "func SetChainConfig" x/evm/types # Test: Search for SetEVMCoinInfo function echo "Searching for SetEVMCoinInfo function:" rg --type go "func SetEVMCoinInfo" x/evm/typesLength of output: 410
precompiles/ics20/tx.go (3)
18-18
: LGTM: Import change is appropriate.The addition of the
evmtypes
import and removal of theconfig
import aligns with the changes made in theTransfer
function. This modification suggests a more direct approach to accessing EVM-specific types and functions.
Line range hint
1-100
: Overall: Changes look good, but verify broader refactoring impact.The modifications in this file are minimal and focused, involving the shift from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
. These changes appear to be part of a larger refactoring effort to centralize EVM-related functionality.To ensure consistency across the codebase, please run the following script to check for any remaining uses of
config.GetEVMCoinDenom()
:#!/bin/bash # Description: Check for any remaining uses of config.GetEVMCoinDenom() # Search for any remaining uses of config.GetEVMCoinDenom() rg --type go 'config\.GetEVMCoinDenom\(\)'If this script returns any results, those occurrences should also be updated to use
evmtypes.GetEVMCoinDenom()
for consistency.
72-72
: LGTM: Function update is consistent, but verify denomination retrieval.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the import changes and likely part of a larger refactoring effort. The function's logic remains intact.To ensure the change doesn't introduce any unintended effects, please verify that
evmtypes.GetEVMCoinDenom()
returns the same value as the previousconfig.GetEVMCoinDenom()
. Run the following script to check the implementation:precompiles/gov/gov_test.go (2)
Line range hint
1-146
: Overall assessment: Changes align with PR objectivesThe modification to use
evmtypes.GetChainConfig().ChainID
instead ofconfig.GetChainConfig().ChainID
is consistent with the PR's goal of movingchain_config
to types. The change maintains the existing functionality while improving code organization. No other significant changes were observed in this file, and the overall structure of the tests remains intact.
90-90
: LGTM! Verify consistent usage across the codebase.The change from
config.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
aligns with the PR objective of movingchain_config
to types. This refactoring centralizes EVM-related functionality in theevmtypes
package, which is a good practice.To ensure consistency, let's verify that this change has been applied throughout the codebase:
✅ Verification successful
Change Verified!
All instances of
config.GetChainConfig().ChainID
have been successfully replaced withevmtypes.GetChainConfig().ChainID
across the codebase. The refactoring aligns with the PR objectives and maintains consistency throughout the tests.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of config.GetChainConfig().ChainID # Test 1: Search for old usage echo "Searching for remaining instances of config.GetChainConfig().ChainID" rg --type go 'config\.GetChainConfig\(\)\.ChainID' # Test 2: Confirm new usage echo "Confirming usage of evmtypes.GetChainConfig().ChainID" rg --type go 'evmtypes\.GetChainConfig\(\)\.ChainID'Length of output: 2963
x/evm/keeper/keeper_test.go (1)
35-35
: LGTM. Verify the impact of this change across the codebase.The change from
config.GetChainConfig()
toevmtypes.GetChainConfig()
aligns with the PR objective of movingchain_config
to types. This modification appears correct and maintains the existing test logic.To ensure consistency across the codebase, please run the following script:
This will help identify any other occurrences that might need updating.
✅ Verification successful
Verified: Refactoring to
evmtypes.GetChainConfig()
is complete and consistent across the codebase.All instances of
config.GetChainConfig()
have been successfully replaced withevmtypes.GetChainConfig()
, ensuring the change aligns with the project's refactoring objectives.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of config.GetChainConfig() and compare with evmtypes.GetChainConfig() usage echo "Checking for remaining usage of config.GetChainConfig():" rg --type go "config\.GetChainConfig\(\)" echo "\nChecking usage of evmtypes.GetChainConfig():" rg --type go "evmtypes\.GetChainConfig\(\)"Length of output: 3638
app/post/setup_test.go (1)
71-71
: LGTM: Chain configuration access updatedThe change from
config.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
is consistent with the reported modification in the import statements. This update should maintain the same functionality while aligning with the new package structure.To ensure this change doesn't have unintended consequences, please run the following script to check for any remaining uses of
config.GetChainConfig()
in the codebase:If the script returns any results, those occurrences may need to be updated to use
evmtypes.GetChainConfig()
for consistency.app/ante/evm/fee_market_test.go (1)
27-27
: LGTM! Verify the implementation ofevmtypes.GetEVMCoinDenom()
The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
aligns with the PR objective of movingchain_config
to types. This refactoring centralizes EVM-related functionality in theevmtypes
package, which is a good practice.To ensure the correctness of this change, please run the following script to verify the implementation of
evmtypes.GetEVMCoinDenom()
:This script will help ensure that the
GetEVMCoinDenom()
function is properly implemented in theevmtypes
package and that it's being used consistently across the codebase.✅ Verification successful
Verified:
evmtypes.GetEVMCoinDenom()
is correctly implemented and utilized.The
GetEVMCoinDenom
function is properly defined in theevmtypes
package (x/evm/types/denom_config.go
) and is consistently used across the codebase. The change fromconfig.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
aligns with the PR's objective of centralizing EVM-related functionality.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of evmtypes.GetEVMCoinDenom() # Test: Check if the function is properly defined in the evmtypes package ast-grep --lang go --pattern 'func GetEVMCoinDenom() string { $$$$ }' # Test: Verify usage of the function across the codebase rg --type go 'evmtypes\.GetEVMCoinDenom\(\)'Length of output: 3956
Script:
#!/bin/bash # Description: Locate the definition of evmtypes.GetEVMCoinDenom() # Test 1: Use ast-grep with a flexible pattern to find any GetEVMCoinDenom function in evmtypes ast-grep --lang go --pattern 'func GetEVMCoinDenom($_*) $_* { $$$$ }' src/evmtypes/ # Test 2: Use ripgrep to search for the function definition across the codebase rg -A 5 'func GetEVMCoinDenom' --type goLength of output: 890
x/evm/wrappers/bank.go (3)
60-60
: Approve the consistent use oftypes.GetEVMCoinDenom()
The change to use
types.GetEVMCoinDenom()
is consistent with the modification in theMintAmountToAccount
method. This maintains uniformity across theBankWrapper
struct and aligns with the refactoring effort to centralize type-related functions in thetypes
package.
Line range hint
1-105
: Overall impact assessment of changes toBankWrapper
The changes made to the
BankWrapper
struct are consistent and isolated to the retrieval of the EVM coin denomination. While the impact on overall functionality should be minimal, it's crucial to ensure that:
- The
types.GetEVMCoinDenom()
function is properly implemented and returns the correct value.- These changes are reflected in any relevant tests for the
BankWrapper
.- The behavior of
MintAmountToAccount
andBurnAmountFromAccount
remains unchanged in the broader context of the application.To verify the changes, please run the following script:
#!/bin/bash # Description: Verify the implementation and usage of types.GetEVMCoinDenom() # Test 1: Check the implementation of GetEVMCoinDenom in the types package rg --type go -A 10 'func GetEVMCoinDenom\(\)' ./x/evm/types # Test 2: Verify that all occurrences of GetEVMCoinDenom in the bank wrapper use the types package rg --type go 'GetEVMCoinDenom\(\)' ./x/evm/wrappers/bank.go # Test 3: Check for any existing tests related to BankWrapper that might need updating rg --type go 'func Test.*BankWrapper' ./x/evmAdditionally, ensure that all relevant tests are updated and passing with these changes.
42-42
: Approve the change to usetypes.GetEVMCoinDenom()
The modification to use
types.GetEVMCoinDenom()
instead ofconfig.GetEVMCoinDenom()
appears to be a refactoring to centralize type-related functions. This change should maintain the same functionality, assuming both methods return the same value.To ensure consistency, please run the following script to verify that
types.GetEVMCoinDenom()
returns the expected value:precompiles/erc20/tx.go (2)
18-18
: LGTM: Import statement updated correctlyThe addition of the
evmtypes
import aligns with the PR objective of movingchain_config
to types. This change suggests thatGetEVMCoinDenom()
function has been moved to theevmtypes
package, which is a good step towards better code organization.
Line range hint
1-143
: Summary of changes and their impactThe changes in this file successfully move the
GetEVMCoinDenom()
function fromconfig
toevmtypes
, which aligns with the PR objective of movingchain_config
to types. This refactoring improves code organization without altering the core functionality of the ERC-20 transfer logic.The modifications are minimal and focused, affecting only the import statement and a single condition in the
transfer
function. The overall structure and logic of the file remain intact, which reduces the risk of introducing bugs or unintended side effects.These changes contribute to a more modular and maintainable codebase by centralizing EVM-related types and functions in the
evmtypes
package.testutil/tx/eth.go (4)
36-36
: LGTM: Updated chain config referenceThe change from
evmconfig
toevmtypes
for getting the chain config is correct and aligns with the PR objective.
40-40
: LGTM: Updated EVM coin denom referenceThe change from
evmconfig
toevmtypes
for getting the EVM coin denomination is correct and consistent with the PR objective.
104-104
: LGTM: Consistent updates to chain config referencesThe changes from
evmconfig
toevmtypes
for getting the chain config are correct and align with the PR objective. These updates are consistent with the changes made in thePrepareEthTx
function, demonstrating a uniform approach throughout the file.Also applies to: 123-123
36-36
: Summary: Successful migration of chain_config referencesThe changes in this file successfully migrate the references from
evmconfig
toevmtypes
for chain configuration and EVM coin denomination. These updates are consistent across thePrepareEthTx
andCreateEthTx
functions, maintaining the existing functionality while aligning with the PR objective of movingchain_config
to types.The changes are minimal and focused, reducing the risk of introducing new issues. The consistent approach across functions also improves maintainability.
Also applies to: 40-40, 104-104, 123-123
testutil/contract.go (2)
108-108
: LGTM. Consistent change with DeployContract function.The modification to use
evm.GetChainConfig().ChainID
for retrieving the chain ID is consistent with the change made in theDeployContract
function. This consistency is commendable and reinforces the refactoring effort to centralize chain configuration access.
62-62
: Verify consistency of chain ID retrieval across the codebase.The changes in this file consistently update the chain ID retrieval method to use
evm.GetChainConfig().ChainID
in bothDeployContract
andDeployContractWithFactory
functions. This appears to be part of a broader refactoring effort to centralize chain configuration access.To ensure consistency across the entire codebase, please run the following verification script:
If the script returns any results, please review those instances to determine if they also need to be updated for consistency.
Also applies to: 108-108
✅ Verification successful
Chain ID retrieval is consistent across the codebase.
No outdated methods of retrieving the chain ID were found, confirming that the refactoring has been successfully applied throughout.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining instances of the old chain ID retrieval method # Test: Search for potential outdated chain ID retrieval methods echo "Checking for potential outdated chain ID retrieval methods:" rg --type go 'config\.GetChainConfig\(\)\.ChainID' # Note: If this search returns results, it may indicate inconsistencies in the refactoring process.Length of output: 181
app/ante/testutils/testutils.go (1)
96-101
:⚠️ Potential issueUpdate block parameter assignments for consistency.
The block parameters (LondonBlock, ArrowGlacierBlock, etc.) are now assigned
&maxInt
instead ofmaxInt.BigInt()
. This change affects how these parameters are referenced and might impact subsequent logic.Consider updating the assignments to maintain consistency with the
sdkmath.Int
type:- chainConfig.LondonBlock = &maxInt - chainConfig.ArrowGlacierBlock = &maxInt - chainConfig.GrayGlacierBlock = &maxInt - chainConfig.MergeNetsplitBlock = &maxInt - chainConfig.ShanghaiBlock = &maxInt - chainConfig.CancunBlock = &maxInt + chainConfig.LondonBlock = maxInt.BigInt() + chainConfig.ArrowGlacierBlock = maxInt.BigInt() + chainConfig.GrayGlacierBlock = maxInt.BigInt() + chainConfig.MergeNetsplitBlock = maxInt.BigInt() + chainConfig.ShanghaiBlock = maxInt.BigInt() + chainConfig.CancunBlock = maxInt.BigInt()This change ensures that the block parameters are assigned
*big.Int
values, which is likely the expected type for these fields in theChainConfig
struct.To verify the correct type for these fields, run:
app/ante/evm/fee_checker.go (3)
48-49
: Summary: Changes align with PR objectives and improve code organization.The modifications in this file are focused on moving chain configuration from the
config
package to thetypes
package. This change:
- Improves code organization by centralizing configuration-related code.
- Aligns with the PR objective of moving
chain_config
to types.- Maintains the existing logic of the fee checker, reducing the risk of introducing bugs.
These changes are part of a larger refactoring effort and should be applied consistently across the codebase. The verification steps suggested in the previous comments will help ensure this consistency.
48-48
: LGTM. Verify consistent usage across the codebase.The change from
config.GetEVMCoinDenom()
totypes.GetEVMCoinDenom()
aligns with the PR objective of moving chain configuration to types. This should improve code organization and maintainability.To ensure consistency, let's verify that this change has been applied throughout the codebase:
✅ Verification successful
Verified: No remaining usages of
config.GetEVMCoinDenom()
found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining usage of config.GetEVMCoinDenom() rg --type go 'config\.GetEVMCoinDenom\(\)'Length of output: 44
49-49
: LGTM. Verify consistent usage and consider renaming for clarity.The change from
config.GetChainConfig()
totypes.GetChainConfig()
aligns with the PR objective of moving chain configuration to types, improving code organization.To ensure consistency, let's verify that this change has been applied throughout the codebase:
Consider renaming
ethConfig
tochainConfig
for consistency with the function name, unless it specifically contains Ethereum-only configurations.✅ Verification successful
Verified removal of
config.GetChainConfig()
.The replacement with
types.GetChainConfig()
has been successfully applied throughout the codebase, ensuring no residual dependencies remain.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for any remaining usage of config.GetChainConfig() rg --type go 'config\.GetChainConfig\(\)'Length of output: 43
Script:
#!/bin/bash # Using ast-grep to search for any remaining usage of config.GetChainConfig() ast-grep --lang go --pattern $'config.GetChainConfig()'Length of output: 56
rpc/backend/sign_tx.go (1)
70-70
: LGTM. Verify impact on other files.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
aligns with the PR objective of movingchain_config
to types. The functionality remains the same, and theevmtypes
import is already present.To ensure this change doesn't introduce any issues, please run the following script to check for any remaining usages of
config.GetEVMCoinDenom()
in the codebase:This will help ensure that all instances have been updated consistently across the codebase.
✅ Verification successful
Verification Successful. No remaining usages of
config.GetEVMCoinDenom()
found.All instances of
config.GetEVMCoinDenom()
have been successfully replaced withevmtypes.GetEVMCoinDenom()
. The changes are consistent across the codebase, and no remnants of the old method remain.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usages of config.GetEVMCoinDenom() # Test: Search for config.GetEVMCoinDenom(). Expect: No results. rg --type go 'config\.GetEVMCoinDenom\(\)' # Test: Search for evmtypes.GetEVMCoinDenom(). Expect: Results including this file. rg --type go 'evmtypes\.GetEVMCoinDenom\(\)'Length of output: 3929
rpc/backend/backend_suite_test.go (1)
185-185
: LGTM! Verify consistency and imports.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
looks good and aligns with the PR objective of movingchain_config
to types. This refactoring should improve code organization by using a more specific package for EVM-related functionality.To ensure consistency across the codebase:
- Verify that all occurrences of
config.GetEVMCoinDenom()
have been updated.- Check if the import statement for the
config
package is still necessary.Run the following script to assist with the verification:
Please review the script output and make any necessary adjustments to ensure consistency across the codebase.
✅ Verification successful
Verified Refactoring of
GetEVMCoinDenom
UsageThe replacement from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
has been successfully verified. There are no remaining instances of the old method, and all usages are consistently updated across the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of GetEVMCoinDenom usage and imports # Test 1: Check for any remaining usage of config.GetEVMCoinDenom() echo "Checking for remaining usage of config.GetEVMCoinDenom():" rg --type go 'config\.GetEVMCoinDenom\(\)' # Test 2: Check for any unnecessary imports of the config package echo "Checking for imports of the config package:" rg --type go '^import\s+\([^)]*"github.com/evmos/evmos/v20/config"[^)]*\)' # Test 3: Verify the usage of evmtypes.GetEVMCoinDenom() echo "Verifying usage of evmtypes.GetEVMCoinDenom():" rg --type go 'evmtypes\.GetEVMCoinDenom\(\)'Length of output: 4331
ethereum/eip712/preprocess_test.go (2)
106-106
: LGTM! Consistent usage of renamed import.The update from
evmconfig.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the import renaming. This change suggests that the relocation ofchain_config
to types was done without altering the API, which is a good practice for maintaining backwards compatibility.
Line range hint
1-238
: Summary: Minimal changes align with PR objective.The changes in this file are focused on renaming the
evmconfig
package toevmtypes
, which aligns with the PR objective of movingchain_config
to types. This refactoring improves code organization without altering the existing test cases, maintaining the integrity of the test suite. The consistent application of these changes suggests a well-executed refactoring effort.x/evm/keeper/utils_test.go (1)
24-24
: LGTM: Updated to use evmtypes packageThe change from
evmconfig.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the PR objective of moving chain_config to types. This update ensures that the EVM coin denomination is retrieved from the correct package.x/evm/keeper/benchmark_test.go (6)
64-64
: LGTM: Updated chain ID retrievalThe change from
config.GetChainConfig().ChainID
totypes.GetChainConfig().ChainID
is consistent with the PR objective of moving chain_config to types. This ensures that the benchmark tests use the correct chain configuration for signing Ethereum transactions.
95-95
: LGTM: Consistent chain ID update in BenchmarkTokenTransferThe change from
config.GetChainConfig().ChainID
totypes.GetChainConfig().ChainID
in the EvmTxArgs structure is consistent with the PR objective and the previous change. This ensures that the token transfer benchmark uses the correct chain configuration.
116-116
: LGTM: Consistent chain ID update in BenchmarkEmitLogsThe change from
config.GetChainConfig().ChainID
totypes.GetChainConfig().ChainID
in the EvmTxArgs structure for the BenchmarkEmitLogs function is consistent with the PR objective and the previous changes. This ensures that the log emission benchmark uses the correct chain configuration.
137-137
: LGTM: Consistent chain ID update in BenchmarkTokenTransferFromThe change from
config.GetChainConfig().ChainID
totypes.GetChainConfig().ChainID
in the EvmTxArgs structure for the BenchmarkTokenTransferFrom function is consistent with the PR objective and the previous changes. This ensures that the token transfer-from benchmark uses the correct chain configuration.
158-158
: LGTM: Consistent chain ID updates in BenchmarkTokenMint and BenchmarkMessageCallThe changes from
config.GetChainConfig().ChainID
totypes.GetChainConfig().ChainID
in the EvmTxArgs structures for both BenchmarkTokenMint and BenchmarkMessageCall functions, as well as in the transaction signing process, are consistent with the PR objective and the previous changes. These modifications ensure that the token minting and message call benchmarks use the correct chain configuration.Also applies to: 180-192
Line range hint
1-211
: Summary: Consistent updates to chain ID retrieval across benchmark testsThe changes in this file consistently update the chain ID retrieval method from
config.GetChainConfig().ChainID
totypes.GetChainConfig().ChainID
across various benchmark functions. These modifications align with the PR objective of moving chain_config to types and ensure that all benchmark tests use the correct chain configuration. The changes affect the following functions:
- DoBenchmark
- BenchmarkTokenTransfer
- BenchmarkEmitLogs
- BenchmarkTokenTransferFrom
- BenchmarkTokenMint
- BenchmarkMessageCall
These updates maintain consistency throughout the file and should improve the overall organization of the codebase by centralizing the chain configuration in the types package.
x/evm/keeper/statedb.go (1)
Line range hint
1-265
: Overall improvements in EVM state management.The changes in this file represent a significant enhancement in the management of Ethereum accounts and contract states. The refactoring of the
SetBalance
andDeleteAccount
functions provides more explicit handling of operations and improved safety checks.The removal of the
config
package import and the use oftypes.GetEVMCoinDenom()
instead ofconfig.GetEVMCoinDenom()
suggests a broader refactoring effort to improve code organization. This change aligns with the PR objective of movingchain_config
to types.These modifications contribute to a more robust and maintainable codebase. However, ensure that these changes are consistently applied across the entire project and that all affected components are updated accordingly.
To ensure consistency across the codebase, please run the following script:
This will help identify any places where the old
config.GetEVMCoinDenom()
might still be in use and confirm the correct usage oftypes.GetEVMCoinDenom()
.✅ Verification successful
Refactoring Verified Successfully.
All instances ofconfig.GetEVMCoinDenom()
have been removed and replaced withtypes.GetEVMCoinDenom()
. The refactoring is consistent across the codebase, ensuring improved code organization and maintainability.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify the usage of GetEVMCoinDenom() across the codebase echo "Checking for any remaining usage of config.GetEVMCoinDenom():" rg "config\.GetEVMCoinDenom\(\)" --type go echo "Verifying the usage of types.GetEVMCoinDenom():" rg "types\.GetEVMCoinDenom\(\)" --type goLength of output: 5467
x/evm/wrappers/utils_test.go (7)
14-14
: LGTM: Import statement added correctly.The new import for
evmtypes
is correctly added and aliased, which is consistent with the PR objective of movingchain_config
to types.
25-25
: LGTM: Consistent updates to EvmCoinInfo references.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are applied consistently across all test cases. TheSetEVMCoinTEST
function call is also correctly updated. These changes align well with the PR objective of movingchain_config
to types.Also applies to: 32-32, 39-39, 46-46, 53-53, 60-60, 80-80
96-96
: LGTM: Consistent updates to EvmCoinInfo references in TestConvertEvmCoinFrom18Decimals.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are applied consistently across all test cases in this function. TheSetEVMCoinTEST
function call is also correctly updated. These changes are in line with the PR objective.Also applies to: 103-103, 110-110, 117-117, 122-122, 129-129, 136-136, 144-144
164-164
: LGTM: Consistent updates to EvmCoinInfo references in TestConvertCoinsFrom18Decimals.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are applied consistently across all test cases in this function. TheSetEVMCoinTEST
function call is also correctly updated. These changes are in line with the PR objective.Also applies to: 170-170, 176-176, 182-182, 188-188, 194-194, 202-202
248-250
: LGTM: Consistent updates to EvmCoinInfo and related references in TestZeroExtraDecimalsBigInt.The changes from
config
toevmtypes
forEvmCoinInfo
,SetEVMCoinTEST
, andEighteenDecimals
are applied consistently. These updates align well with the PR objective of movingchain_config
to types.Also applies to: 254-254, 256-256
Line range hint
1-262
: LGTM: Consistent and complete updates throughout the file.The changes from
config
toevmtypes
have been applied consistently throughout the entire file. All instances ofEvmCoinInfo
,SetEVMCoinTEST
,EighteenDecimals
, andSixDecimals
have been updated correctly. These changes align well with the PR objective of movingchain_config
to types.
Line range hint
1-262
: Verify test execution after changes.While the changes are primarily related to import paths and type references, and the actual test logic remains unchanged, it's crucial to ensure that all tests still pass after these modifications. Please verify that the test suite executes successfully with these changes.
precompiles/distribution/distribution_test.go (1)
225-225
: LGTM: Chain ID retrieval updated correctly.The change from
config.GetChainConfig().ChainID
toevmtypes.GetChainConfig().ChainID
aligns with the PR objective of movingchain_config
to types. This update appears to be implemented correctly.To ensure consistency across the codebase, let's verify that this change has been applied uniformly:
✅ Verification successful
✅ Verified: Chain ID retrievals are consistently updated to use
evmtypes.GetChainConfig().ChainID
.All instances of
config.GetChainConfig().ChainID
have been successfully replaced withevmtypes.GetChainConfig().ChainID
, ensuring uniformity across the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining instances of config.GetChainConfig().ChainID # Test: Search for old usage of config.GetChainConfig().ChainID rg --type go 'config\.GetChainConfig\(\)\.ChainID' # Test: Confirm new usage of evmtypes.GetChainConfig().ChainID rg --type go 'evmtypes\.GetChainConfig\(\)\.ChainID'Length of output: 2699
app/ante/evm/mono.go (3)
84-84
: LGTM: Centralized chain configuration retrievalThis change aligns with the PR objective of moving
chain_config
to types. It centralizes the chain configuration retrieval, which can improve maintainability and reduce dependencies on theconfig
package.
89-89
: LGTM: Centralized EVM coin denomination retrievalThis change is consistent with the PR objective of moving
chain_config
to types. It centralizes the EVM coin denomination retrieval, which can improve maintainability and reduce dependencies on theconfig
package.
Line range hint
1-329
: Overall assessment: Changes align with PR objectives and improve code qualityThe modifications in this file successfully move the chain configuration and EVM coin denomination retrieval to the
evmtypes
package, aligning with the PR's main objective. These changes enhance code maintainability by centralizing configuration retrieval and reducing dependencies on theconfig
package.The updated error handling for the base fee adds robustness to the code, ensuring proper validation when London rules are in effect.
No major issues were identified during the review. The changes appear to be well-implemented and consistent with the project's goals.
x/evm/keeper/state_transition_benchmark_test.go (5)
195-195
: Consistent change. See previous comment.This change is consistent with the modification in the
BenchmarkApplyTransaction
function. The same suggestion for extracting the chain config into a variable applies here as well.
224-224
: Consistent change. See previous comments.This change in the
BenchmarkApplyTransactionWithDynamicFeeTx
function is consistent with the modifications in the previous benchmark functions. The same suggestion for extracting the chain config into a variable applies here as well.
290-291
: Consistent change. See previous comment.These changes in the
BenchmarkApplyMessageWithLegacyTx
function are identical to those in theBenchmarkApplyMessage
function. The same optimization suggestion applies here: use the extractedethCfg
for the signer initialization to avoid callingGetChainConfig()
twice.
325-326
: Consistent change. See previous comments.These changes in the
BenchmarkApplyMessageWithDynamicFeeTx
function are identical to those in the previous two benchmark functions. The same optimization suggestion applies here: use the extractedethCfg
for the signer initialization to avoid callingGetChainConfig()
twice.
Line range hint
1-353
: Summary: Changes align with PR objective, minor optimizations suggestedThe modifications in this file consistently replace references to the
config
package with calls toevmtypes.GetChainConfig()
, aligning with the PR objective of movingchain_config
to types. The changes are applied consistently across all benchmark functions.Key points:
- All changes are approved and align with the PR objective.
- Minor optimizations were suggested to improve code efficiency:
- Extracting
chainConfig := evmtypes.GetChainConfig()
to avoid multiple calls.- Using the extracted config for both
ethCfg
andsigner
initialization.These optimizations, while not critical, would enhance code readability and efficiency. Overall, the changes achieve the intended goal without introducing any significant issues.
rpc/backend/node_info_test.go (3)
73-74
: LGTM: Test case updated to reflect import change.The test case has been correctly updated to use
evmtypes.GetEVMCoinDenom()
, which is consistent with the import statement change.
Line range hint
297-337
: LGTM: Added test case for invalid private key in ImportRawKey.The new test case for an invalid private key enhances the error handling and robustness of the ImportRawKey functionality. This is a valuable addition to the test suite.
17-17
: Verify the impact of the import change across the codebase.The import statement has been updated from
evmconfig
toevmtypes
. This change might affect other parts of the codebase that rely on the old import path.Run the following script to check for any remaining usage of the old import path:
✅ Verification successful
Import change verified successfully across the codebase. No remaining usages of
evmconfig
found.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of the old import path. # Test: Search for the old import path. Expect: No results. rg --type go "evmconfig.GetEVMCoinDenom" # Test: Search for the new import path. Expect: Results showing the updated usage. rg --type go "evmtypes.GetEVMCoinDenom"Length of output: 3918
precompiles/vesting/tx.go (4)
16-16
: LGTM: Import statement updated correctly.The addition of the
evmtypes
import is consistent with the refactoring to useevmtypes.GetEVMCoinDenom()
instead ofconfig.GetEVMCoinDenom()
. This change improves the code organization by centralizing EVM-related types and functions.
127-127
: LGTM: Function updated to use new import.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the import changes and maintains the same functionality. This refactoring improves code organization without altering the logic.
194-194
: LGTM: Function updated to use new import.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the import changes and the modifications in other functions. This refactoring maintains the same functionality while improving code organization.
Line range hint
1-294
: Summary: Consistent refactoring improves code organization.The changes in this file are part of a broader refactoring effort to centralize EVM-related functionality. The modifications include:
- Adding an import for
evmtypes
.- Replacing
config.GetEVMCoinDenom()
withevmtypes.GetEVMCoinDenom()
in multiple functions.These changes improve code organization and maintainability without altering the core functionality of the vesting-related operations. The refactoring is consistent throughout the file and aligns with best practices for code structure.
precompiles/distribution/tx.go (6)
95-95
: LGTM: Consistent use ofevmtypes.GetEVMCoinDenom()
The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the refactoring mentioned in the PR summary. This modification ensures that the correct coin denomination is used when setting balance change entries.
174-174
: LGTM: Consistent use ofevmtypes.GetEVMCoinDenom()
The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
in theWithdrawDelegatorRewards
function is consistent with the previous changes and ensures the correct coin denomination is used for balance changes.
220-220
: LGTM: Consistent use ofevmtypes.GetEVMCoinDenom()
The change in the
WithdrawValidatorCommission
function fromconfig.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
maintains consistency with the previous changes and ensures the correct coin denomination is used for commission withdrawals.
261-261
: LGTM: Consistent use ofevmtypes.GetEVMCoinDenom()
The change in the
FundCommunityPool
function fromconfig.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the previous changes and ensures the correct coin denomination is used when funding the community pool.
17-17
: LGTM: Added import forevmtypes
The addition of the
evmtypes
import is necessary to support the changes made in the functions, allowing the use ofevmtypes.GetEVMCoinDenom()
.
Line range hint
1-280
: Summary: Consistent refactoring of EVM coin denomination accessThe changes in this file consistently replace
config.GetEVMCoinDenom()
withevmtypes.GetEVMCoinDenom()
across multiple functions (ClaimRewards
,WithdrawDelegatorRewards
,WithdrawValidatorCommission
, andFundCommunityPool
). This refactoring aligns with the PR objective of movingchain_config
to types and improves the consistency of how the EVM coin denomination is accessed throughout the codebase.The modifications do not alter the core logic of the functions but ensure that the correct coin denomination is used in various distribution-related operations. This change enhances code maintainability and type safety.
To ensure that this change has been consistently applied across the codebase, please run the following command:
This will help verify that no instances of the old method call remain, ensuring complete refactoring.
x/evm/types/chain_config_test.go (9)
1-1
: LGTM: Package name change and import addition are appropriate.The change from
package types
topackage types_test
follows Go conventions for test files. The addition of the import"github.com/evmos/evmos/v20/x/evm/types"
is necessary to reference thetypes
package after the package name change.Also applies to: 7-7
23-23
: LGTM: Test case updates are consistent with package changes.The change of the
config
field type totypes.ChainConfig
and the use of*types.DefaultChainConfig("")
for the default test case are consistent with the package name change. These updates ensure that theChainConfig
is correctly referenced from thetypes
package.Also applies to: 26-26
29-29
: LGTM: Correct usage oftypes.ChainConfig
.The change to
types.ChainConfig
is consistent with the package name change and ensures that theChainConfig
is correctly referenced from thetypes
package.
50-50
: LGTM: Correct usage oftypes.ChainConfig
in nil values test case.The change to
types.ChainConfig
is consistent with the package name change and ensures that theChainConfig
is correctly referenced from thetypes
package in the test case for nil values.
71-71
: LGTM: Correct usage oftypes.ChainConfig
in empty test case.The change to
types.ChainConfig
is consistent with the package name change and ensures that theChainConfig
is correctly referenced from thetypes
package in the empty test case.
76-76
: LGTM: Correct usage oftypes.ChainConfig
in invalid HomesteadBlock test case.The change to
types.ChainConfig
is consistent with the package name change and ensures that theChainConfig
is correctly referenced from thetypes
package in the invalid HomesteadBlock test case.
83-83
: LGTM: Correct usage oftypes.ChainConfig
in invalid DAOForkBlock test case.The change to
types.ChainConfig
is consistent with the package name change and ensures that theChainConfig
is correctly referenced from thetypes
package in the invalid DAOForkBlock test case.
91-91
: LGTM: Consistent usage oftypes.ChainConfig
across all test cases.The changes to
types.ChainConfig
are consistent across all remaining test cases. This ensures that theChainConfig
is correctly referenced from thetypes
package throughout the entire test file. The uniform application of these changes maintains consistency and correctness in the test suite.Also applies to: 100-100, 110-110, 121-121, 133-133, 146-146, 160-160, 175-175, 191-191, 208-208, 226-226, 245-245, 265-265, 286-286, 308-308, 326-326, 349-349
Line range hint
1-383
: Summary: Successful refactoring ofchain_config_test.go
The changes in this file successfully accomplish the goal of moving
chain_config
to the types section of the codebase. Key points:
- The package name has been changed from
types
totypes_test
, which is appropriate for a test file.- All references to
ChainConfig
have been updated to usetypes.ChainConfig
.- The
DefaultChainConfig
function is now called withtypes.DefaultChainConfig("")
.- These changes are consistently applied across all test cases in the file.
The refactoring maintains the integrity of the tests while correctly referencing the
ChainConfig
from thetypes
package. This change improves the organization of the codebase and aligns with the PR objectives.testutil/integration/evmos/network/network.go (2)
Line range hint
1-368
: Overall assessment: LGTM with minor verification needed.The change in this file appears to be part of a larger refactoring effort to better organize EVM-related configurations. The modification is minimal and doesn't introduce any apparent issues. However, it's crucial to ensure that this change is consistent across the entire codebase and doesn't lead to any regressions.
To maintain the integrity of the system:
- Verify that all other parts of the codebase that might have depended on
config.GetChainConfig()
have been updated accordingly.- Run comprehensive integration tests to ensure that this change doesn't affect the behavior of the system in any unexpected ways.
- Update any relevant documentation that might reference the old
config.GetChainConfig()
method.To ensure consistency across the codebase, run the following script:
#!/bin/bash # Description: Check for any remaining references to config.GetChainConfig() echo "Searching for any remaining references to config.GetChainConfig():" rg --type go 'config\.GetChainConfig\(\)' echo "Verifying that evmtypes.GetChainConfig() is now used where appropriate:" rg --type go 'evmtypes\.GetChainConfig\(\)'This script will help identify any places where the old method might still be in use and confirm that the new method is being used appropriately throughout the codebase.
267-267
: LGTM. Verify consistency with previous implementation.The change from
config.GetChainConfig()
toevmtypes.GetChainConfig()
looks good. It appears to be part of a refactoring effort to better organize EVM-related configurations within the EVM module. This change should improve code organization and maintainability.However, to ensure this change doesn't introduce any unintended side effects:
- Please verify that
evmtypes.GetChainConfig()
returns the same structure and data as the previousconfig.GetChainConfig()
.- Ensure that all necessary chain configuration parameters are correctly set in the new implementation.
To verify the consistency of the new implementation, you can run the following script:
This script will help identify any potential discrepancies between the old and new implementations.
✅ Verification successful
Script Execution Failed: Syntax Error Detected
The previous shell script encountered a syntax error. Please run the corrected script below to continue the verification process:
Refactoring Verified Successfully
The transition from
config.GetChainConfig()
toevmtypes.GetChainConfig()
has been thoroughly verified. There are no remaining references to the old implementation, and the new method is consistently utilized throughout the codebase. TheChainConfig
struct is correctly defined within theevmtypes
package, ensuring structural consistency with the previous implementation.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Compare the output of the old and new GetChainConfig implementations # Search for any tests or code that used the old config.GetChainConfig() echo "Searching for usages of the old config.GetChainConfig():" rg --type go 'config\.GetChainConfig\(\)' # Search for the implementation of the new evmtypes.GetChainConfig() echo "Searching for the implementation of evmtypes.GetChainConfig():" rg --type go 'func GetChainConfig\(\)' x/evm/types/ # Compare the struct fields of the returned ChainConfig echo "Comparing ChainConfig struct fields:" rg --type go 'type ChainConfig struct' x/evm/types/Length of output: 3920
Script:
#!/bin/bash # Description: Compare the output of the old and new GetChainConfig implementations # Search for any tests or code that used the old config.GetChainConfig() echo "Searching for usages of the old config.GetChainConfig():" rg --type go 'config\.GetChainConfig\(\)' # Search for the implementation of the new evmtypes.GetChainConfig() echo "Searching for the implementation of evmtypes.GetChainConfig():" rg --type go 'evmtypes\.GetChainConfig\(\)' # Compare the struct fields of the returned ChainConfig echo "Comparing ChainConfig struct fields:" rg --type go 'type ChainConfig struct' x/evm/types/Length of output: 3855
x/evm/keeper/keeper.go (2)
Line range hint
1-338
: Overall assessment: Clean and focused change.The modification in this file is minimal and aligns well with the PR objective of moving
chain_config
to types. The change is isolated to theGetBalance
method, which reduces the risk of introducing unintended side effects. The rest of theKeeper
struct and its methods remain unchanged, indicating a clean implementation of the required change.
271-271
: LGTM. Verify all occurrences ofGetEVMCoinDenom()
.The change from
config.GetEVMCoinDenom()
totypes.GetEVMCoinDenom()
aligns with the PR objective of movingchain_config
to types. This is a good practice for maintaining consistency and ease of future updates.Please ensure that all occurrences of
config.GetEVMCoinDenom()
have been updated throughout the codebase. Run the following script to verify:✅ Verification successful
Verified successfully. All occurrences of
config.GetEVMCoinDenom()
have been updated totypes.GetEVMCoinDenom()
throughout the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining occurrences of config.GetEVMCoinDenom() # Test: Search for config.GetEVMCoinDenom(). Expect: No results. rg --type go 'config\.GetEVMCoinDenom\(\)' # Test: Search for types.GetEVMCoinDenom(). Expect: At least one result (the one we just reviewed). rg --type go 'types\.GetEVMCoinDenom\(\)'Length of output: 5229
rpc/backend/node_info.go (4)
29-29
: LGTM: Import statement updated to useevmtypes
This change aligns with the PR objective of moving
chain_config
to types. It suggests that EVM-related types are now located in a dedicated package, which can improve code organization and maintainability.
Line range hint
1-348
: Summary: EVM-related type references updated consistentlyThe changes in this file are part of the larger effort to move
chain_config
to types. All modifications are consistent and focused on updating the package reference for EVM-related types fromevmconfig
toevmtypes
. The core logic of the functions remains unchanged, which suggests that this refactoring aims to improve code organization without altering functionality.Key points:
- Import statement updated to use
evmtypes
.GenerateMinGasCoin
andRPCMinGasPrice
functions now useevmtypes.GetEVMCoinDenom()
.- No other functional changes were made to the file.
These changes appear to be well-executed and align with the PR objectives. However, it's crucial to ensure that all related files in the project have been updated consistently to use the new
evmtypes
package where necessary.
338-338
: LGTM: Updated to useevmtypes.GetEVMCoinDenom()
This change is consistent with the previous modifications and ensures that the EVM coin denomination is retrieved consistently across the codebase. The function's core logic remains unchanged.
To ensure this change doesn't introduce any unintended side effects, please run the following verification script:
✅ Verification successful
Verification Successful: RPCMinGasPrice Function Update Confirmed
The
RPCMinGasPrice
function correctly utilizesevmtypes.GetEVMCoinDenom()
and appropriately returnstypes.DefaultGasPrice
when the configured value is 0. All verification steps have passed without issues.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the RPCMinGasPrice function works as expected with the new changes # Test: Check if the RPCMinGasPrice function is using the correct import and method # Expect: The function should use evmtypes.GetEVMCoinDenom() ast-grep --lang go --pattern $'func (b *Backend) RPCMinGasPrice() int64 { $$$ baseDenom := evmtypes.GetEVMCoinDenom() $$$ }' # Test: Ensure that the default gas price is still used when the configured value is 0 # Expect: The function should return types.DefaultGasPrice when the configured value is 0 ast-grep --lang go --pattern $'func (b *Backend) RPCMinGasPrice() int64 { $$$ if amt == 0 { return types.DefaultGasPrice } $$$ }'Length of output: 1402
284-284
: LGTM: Updated to useevmtypes.GetEVMCoinDenom()
This change is consistent with the updated import statement and ensures that the EVM coin denomination is retrieved from the new location. The function's logic remains unchanged.
To ensure this change doesn't introduce any unintended side effects, please run the following verification script:
✅ Verification successful
Verified: All instances of
evmconfig.GetEVMCoinDenom
have been successfully replaced withevmtypes.GetEVMCoinDenom
.The verification script confirms that there are no remaining references to
evmconfig.GetEVMCoinDenom
and thatevmtypes.GetEVMCoinDenom
is correctly used in the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all occurrences of GetEVMCoinDenom are updated consistently # Test: Search for any remaining instances of evmconfig.GetEVMCoinDenom # Expect: No results, as all instances should now use evmtypes.GetEVMCoinDenom rg --type go 'evmconfig\.GetEVMCoinDenom' # Test: Confirm that evmtypes.GetEVMCoinDenom is now used # Expect: At least one result, showing the updated usage rg --type go 'evmtypes\.GetEVMCoinDenom'Length of output: 1402
x/evm/keeper/state_transition.go (1)
190-190
: LGTM! Verify usage ofGetEVMCoinDenom
across the codebase.The change from
config.GetEVMCoinDenom()
totypes.GetEVMCoinDenom()
aligns with the PR objective of movingchain_config
to types. This modification appears correct and consistent with the intended changes.To ensure consistency across the codebase, let's verify the usage of
GetEVMCoinDenom
:✅ Verification successful
Verification Successful:
config.GetEVMCoinDenom()
Fully ReplacedAll instances of
config.GetEVMCoinDenom()
have been successfully replaced withtypes.GetEVMCoinDenom()
. No remaining usages found in the codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining usage of config.GetEVMCoinDenom() and confirm all occurrences now use types.GetEVMCoinDenom() # Search for any remaining usage of config.GetEVMCoinDenom() echo "Checking for any remaining usage of config.GetEVMCoinDenom():" rg --type go 'config\.GetEVMCoinDenom\(\)' # Confirm all occurrences now use types.GetEVMCoinDenom() echo "Confirming usage of types.GetEVMCoinDenom():" rg --type go 'types\.GetEVMCoinDenom\(\)'Length of output: 5461
ethereum/eip712/eip712_test.go (1)
15-16
: LGTM! Import change aligns with PR objective.The addition of the
evmtypes
import is consistent with the PR's goal of movingchain_config
to types. This change suggests that EVM-related types are now accessed from a dedicated types package, which is a good practice for code organization.CHANGELOG.md (4)
68-68
: Refactor to useChainConfig
fromevm/types
This change improves code organization by moving the
ChainConfig
to a more appropriate location. It's a good practice to keep related types together.
Line range hint
42-63
: ImprovementsNotable improvements include:
- Addition of Golang dependency vulnerability checker
- Implementation of File store listener (ADR38)
- Addition of
MsgUpdateVestingFunder
for clawback vesting accounts- Various improvements to IBC, ERC-20, and other modules
- CLI enhancements and pruning command addition
- Performance improvements in RPC and EVM operations
These improvements enhance security, functionality, and performance of the Evmos chain.
To check the implementation of these improvements, run:
#!/bin/bash # Check for new vulnerability checker, ADR38 implementation, and other improvements grep -R "vulnerability checker" . grep -R "ADR38" . grep -R "MsgUpdateVestingFunder" . grep -R "prune command" .🧰 Tools
🪛 Markdownlint
67-67: Expected: 120; Actual: 150
Line length(MD013, line-length)
65-67
: Bug FixesSeveral important bug fixes have been implemented:
- Fixed Ledger supported algorithms
- Updated default node snapshot interval
- Fixed
evmosd version
command- Corrected snapshot configuration
- Fixed setup of gRPC node service
- Addressed issues with unbound metrics
These fixes improve the stability and reliability of the Evmos chain.
To verify these bug fixes, run:
#!/bin/bash # Check for bug fix implementations grep -R "Ledger supported algorithms" . grep -R "node snapshot interval" . grep -R "evmosd version" . grep -R "snapshot configuration" . grep -R "gRPC node service" . grep -R "unbound metrics" .🧰 Tools
🪛 Markdownlint
67-67: Expected: 120; Actual: 150
Line length(MD013, line-length)
Line range hint
1-68
: Overall Assessment of v16.0.0 ChangesThe v16.0.0 release introduces substantial changes to the Evmos chain, including state machine breaking changes, API modifications, and numerous improvements and bug fixes. Key highlights include:
- Addition of new precompiles and custom transactions
- Module renaming and deprecations
- Security enhancements and vulnerability checks
- Performance improvements in various components
- CLI and configuration updates
- Critical bug fixes
These changes collectively represent a significant upgrade to the Evmos ecosystem. However, due to the breaking changes, it's crucial that all stakeholders (validators, developers, and users) carefully review and test these changes before upgrading to ensure compatibility with existing systems and applications.
To get an overview of the changes, run:
#!/bin/bash # Get a high-level summary of changes git diff --name-only v15.0.0..v16.0.0🧰 Tools
🪛 Markdownlint
67-67: Expected: 120; Actual: 150
Line length(MD013, line-length)
api/ethermint/evm/v1/evm.pulsar.go (14)
1941-1941
: New field added to ChainConfig structA new field
chain_id
has been added to theChainConfig
struct. This field represents the ID of the chain (EIP-155).The addition of this field is appropriate as it allows for proper identification of the chain, which is crucial for EVM compatibility and transaction signing.
1966-1966
: Field descriptor added for chain_idA field descriptor
fd_ChainConfig_chain_id
has been added for the newchain_id
field.This is a necessary addition to properly handle the new field in the protobuf implementation.
2148-2153
: Implementation of chain_id in Range methodThe
Range
method of theChainConfig
struct has been updated to include the newchain_id
field.The implementation correctly checks if the
ChainId
is not zero before adding it to the range, which is the appropriate way to handle optional fields in protobuf.
2207-2208
: Has method updated for chain_idThe
Has
method has been updated to check for the presence of thechain_id
field.The implementation correctly returns true if the
ChainId
is not zero, which is consistent with protobuf's handling of optional fields.
2263-2264
: Clear method updated for chain_idThe
Clear
method has been updated to reset thechain_id
field to zero.This is the correct way to clear an optional uint64 field in protobuf.
2338-2340
: Get method updated for chain_idThe
Get
method has been updated to return the value of thechain_id
field.The implementation correctly returns the value of
ChainId
as aprotoreflect.ValueOfUint64
.
2399-2400
: Set method updated for chain_idThe
Set
method has been updated to set the value of thechain_id
field.The implementation correctly sets the
ChainId
field using theUint()
method of the provided value.
2512-2513
: NewField method updated for chain_idThe
NewField
method has been updated to return a default value for thechain_id
field.The implementation correctly returns a
protoreflect.ValueOfUint64(uint64(0))
as the default value for the new field.
2658-2660
: Size method updated for chain_idThe
Size
method has been updated to include the size calculation for thechain_id
field.The implementation correctly calculates the size of the
ChainId
field when it's non-zero.
2690-2696
: Marshal method updated for chain_idThe
Marshal
method has been updated to include the marshaling of thechain_id
field.The implementation correctly marshals the
ChainId
field when it's non-zero.
3490-3508
: Unmarshal method updated for chain_idThe
Unmarshal
method has been updated to include the unmarshaling of thechain_id
field.The implementation correctly unmarshals the
ChainId
field when it's present in the input data.
8078-8079
: ChainId field added to ChainConfig structThe
ChainId
field has been added to theChainConfig
struct with proper protobuf tags.The field is correctly defined as a
uint64
type with the appropriate protobuf field number (24).Also applies to: 8883-8890
8235-8240
: Getter method added for ChainIdA getter method
GetChainId()
has been added for theChainId
field.The getter method is correctly implemented, returning the
ChainId
value or 0 if the struct is nil.
Line range hint
1-9000
: Summary of ChainId addition to ChainConfigThe addition of the
ChainId
field to theChainConfig
struct has been implemented correctly and consistently throughout the file. All necessary methods (Range, Has, Clear, Get, Set, NewField, Size, Marshal, Unmarshal) have been updated to handle the new field properly. This change allows for proper identification of the chain, which is crucial for EVM compatibility and transaction signing.The implementation follows protobuf best practices for optional fields, such as checking for non-zero values and proper marshaling/unmarshaling. The new field is well-integrated into the existing code structure without introducing any apparent issues.
Overall, this change enhances the functionality of the
ChainConfig
struct by adding important chain identification information, and it has been implemented in a clean and consistent manner.app/ante/evm/fee_checker_test.go (1)
56-56
: Update aligns with the newchain_config
locationThe
baseDenom
is now correctly retrieved usingevmtypes.GetEVMCoinDenom()
, which reflects the relocation ofchain_config
to the types section as intended by the PR objectives.rpc/backend/sign_tx_test.go (1)
260-260
: UpdatebaseDenom
retrieval method toevmtypes.GetEVMCoinDenom()
The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
correctly reflects the relocation ofchain_config
to the types section, aligning with the PR's objectives.x/evm/types/chain_config.go (1)
29-34
: Verify all callers ofEthereumConfig
are updated to handle the new return typeThe function
EthereumConfig
now returns a*geth.ChainConfig
instead of*params.ChainConfig
. Ensure that all code areas invoking this function have been updated to handle the new return type to prevent type mismatch errors.Run the following script to locate all usages of
EthereumConfig
:rpc/backend/tracing_test.go (1)
39-39
: Ensure consistent usage ofevmtypes.GetEVMCoinDenom()
All instances of
config.GetEVMCoinDenom()
should be replaced withevmtypes.GetEVMCoinDenom()
to maintain consistency across the codebase.Run the following script to verify that all references have been updated:
rpc/backend/chain_info.go (1)
47-47
: Ensureevmtypes.GetChainConfig()
returns the correct chain configurationBy replacing
config.GetChainConfig()
withevmtypes.GetChainConfig()
, please verify thatevmtypes.GetChainConfig()
provides the appropriate chain configuration for the current chain context. Ifevmtypes.GetChainConfig()
returns a default or static configuration, it may not account for dynamic chain parameters, which could lead to inconsistencies or incorrect behavior in environments with multiple chain configurations.Run the following script to check whether
evmtypes.GetChainConfig()
returns a static configuration or depends on the chain context:app/ante/cosmos/authz_test.go (2)
320-320
: Update Base Denomination Retrieval MethodSimilarly, in the
TestRejectMsgsInAuthz
function,baseDenom
is now retrieved usingevmtypes.GetEVMCoinDenom()
. This ensures consistency in how the base denomination is accessed throughout the tests after relocatingchain_config
totypes
.Run the following script to confirm that no other test files are still using
config.GetEVMCoinDenom()
:#!/bin/bash # Description: Find all references to config.GetEVMCoinDenom() in test files rg --type go 'config\.GetEVMCoinDenom\(\)' --glob '*_test.go'
50-50
: Update Base Denomination Retrieval MethodThe
baseDenom
is now being obtained usingevmtypes.GetEVMCoinDenom()
instead ofconfig.GetEVMCoinDenom()
. This change aligns with movingchain_config
to thetypes
package, ensuring that the base denomination is sourced directly from the EVM types.Run the following script to verify that all instances of
config.GetEVMCoinDenom()
have been updated across the codebase:✅ Verification successful
Verification Successful: All References Updated
All instances of
config.GetEVMCoinDenom()
have been successfully updated toevmtypes.GetEVMCoinDenom()
across the entire Go codebase.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find all references to config.GetEVMCoinDenom() rg --type go 'config\.GetEVMCoinDenom\(\)'Length of output: 63
Script:
#!/bin/bash # Description: Verify that all references to config.GetEVMCoinDenom() have been updated across the entire Go codebase rg --type go 'config\.GetEVMCoinDenom\(\)'Length of output: 44
proto/ethermint/evm/v1/evm.proto (1)
148-149
: Verify backward compatibility after addingchain_id
toChainConfig
The addition of the
chain_id
field to theChainConfig
message with field number24
aligns with EIP-155 specifications. Please ensure this change does not introduce any unintended side effects, particularly concerning serialization, existing configurations, and interfacing clients.Run the following script to identify potential impacts:
✅ Verification successful
Backward compatibility verified for the addition of
chain_id
inChainConfig
.No unintended side effects were found regarding serialization, existing configurations, or interfacing clients.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for usages of 'ChainConfig' to detect any areas affected by the addition of 'chain_id'. # Find initializations of 'ChainConfig' in Go files rg --type go 'ChainConfig\{' -A 5 # Search for custom serialization or copying methods involving 'ChainConfig' rg --type go 'Marshal.*ChainConfig|Unmarshal.*ChainConfig|Copy.*ChainConfig' -A 5 # Check for any protobuf definitions that might conflict grep -rn 'ChainConfig' proto/Length of output: 14752
rpc/backend/call_tx.go (1)
125-125
: EnsureGetEVMCoinDenom
is accessed correctly fromevmtypes
The function
GetEVMCoinDenom()
is now called fromevmtypes
instead ofconfig
. Confirm thatevmtypes.GetEVMCoinDenom()
returns the expected EVM coin denomination and that all references toconfig.GetEVMCoinDenom()
have been updated to prevent any inconsistencies.Run the following script to locate any remaining references to the old function:
#!/bin/bash # Description: Find any occurrences of deprecated `config.GetEVMCoinDenom()` usage. # Search the codebase for the old function call rg --type go 'config\.GetEVMCoinDenom\('rpc/backend/call_tx_test.go (1)
295-295
: UpdatedbaseDenom
retrieval to reflectchain_config
relocationThe
baseDenom
variable now correctly usesevmtypes.GetEVMCoinDenom()
instead ofconfig.GetEVMCoinDenom()
, aligning with the relocation ofchain_config
to thetypes
package as per the PR objectives.x/evm/keeper/fees_test.go (2)
502-502
: Update to useevmtypes.GetChainConfig()
aligns with PR objectivesThis change appropriately updates the reference from
config.GetChainConfig()
toevmtypes.GetChainConfig()
, adhering to the goal of movingchain_config
to thetypes
package.
506-506
: Update to useevmtypes.GetEVMCoinDenom()
aligns with PR objectivesReplacing
config.GetEVMCoinDenom()
withevmtypes.GetEVMCoinDenom()
ensures consistency with the relocatedchain_config
in thetypes
package, as intended by the PR.precompiles/staking/tx.go (2)
18-19
: Imports added forvm
andevmtypes
.The inclusion of the
vm
andevmtypes
packages is appropriate and aligns with their usage in the updated code.
Line range hint
237-243
: Synchronizing balance changes with EVMstateDB
.The added code correctly updates the EVM
stateDB
when the contract caller is not the origin and the denomination is the EVM coin. This ensures that balance changes in the bank keeper are mirrored in thestateDB
, preventing it from overwriting the updated balance when committing the EVM state.x/evm/keeper/grpc_query.go (2)
333-333
: Use oftypes.GetEVMCoinDenom()
Enhances ConfigurabilityReplacing the static denomination with
types.GetEVMCoinDenom()
allows for dynamic retrieval of the EVM coin denomination, improving flexibility and maintainability.
701-701
: Refactored to Usetypes.GetChainConfig()
for ConsistencyUpdating the chain configuration retrieval to
types.GetChainConfig()
ensures consistency across the codebase and centralizes configuration management.x/evm/types/msg_test.go (1)
121-121
: Change aligns with relocation ofchain_config
totypes
packageThe update from
config.GetEVMCoinDenom()
totypes.GetEVMCoinDenom()
reflects the intended move ofchain_config
to thetypes
package. This ensures that the code correctly references the new location ofGetEVMCoinDenom()
.app/ante/evm/utils_test.go (1)
129-129
: Ensure consistent usage ofevmtypes.GetEVMCoinDenom()
.The change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
seems appropriate. Please ensure that all other references toconfig.GetEVMCoinDenom()
in the codebase are updated accordingly to maintain consistency.Run the following script to verify:
✅ Verification successful
Verification Successful: No instances of
config.GetEVMCoinDenom()
found. All references have been consistently updated toevmtypes.GetEVMCoinDenom()
.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that no instances of `config.GetEVMCoinDenom()` remain in the codebase. # Test: Search for any remaining instances of `config.GetEVMCoinDenom()`. # Expect: No matches found. rg 'config\.GetEVMCoinDenom\(\)'Length of output: 34
Script:
#!/bin/bash # Description: Confirm that `config.GetEVMCoinDenom()` does not exist in the codebase by checking the exit status of the previous search. # Search for any instances of `config.GetEVMCoinDenom()` rg 'config\.GetEVMCoinDenom\(\)' # Capture the exit status EXIT_STATUS=$? # Output the result based on the exit status if [ $EXIT_STATUS -eq 1 ]; then echo "No instances of config.GetEVMCoinDenom() found." elif [ $EXIT_STATUS -eq 0 ]; then echo "Instances of config.GetEVMCoinDenom() still exist in the codebase." else echo "An error occurred while running the search." fiLength of output: 173
x/evm/keeper/grpc_query_test.go (4)
36-36
: Update base denomination retrieval is appropriateThe change from
evmconfig.GetEVMCoinDenom()
totypes.GetEVMCoinDenom()
ensures that the code aligns with the relocation ofchain_config
totypes
.
194-194
: Consistent update of base denomination retrieval methodUsing
types.GetEVMCoinDenom()
here maintains consistency after thechain_config
has been moved totypes
.
617-617
: Consistent denomination retrieval in balance checkUpdating to
types.GetEVMCoinDenom()
ensures the balance retrieval uses the correct base denomination following the relocation.
636-636
: Consistent denomination usage in balance calculationThe change to
types.GetEVMCoinDenom()
maintains consistency with the updated codebase.app/ante/evm/ante_test.go (5)
45-45
: Update chain ID retrieval to use 'evmtypes' packageThe chain ID is now obtained using
evmtypes.GetChainConfig().ChainID
, which is appropriate after movingchain_config
to thetypes
package.
65-65
: Update base denomination retrieval to use 'evmtypes' packageThe base denomination is now retrieved using
evmtypes.GetEVMCoinDenom()
, aligning with the changes in the codebase.
605-605
: Update denomination retrieval to use 'evmtypes' packageThe
evmDenom
is now retrieved fromevmtypes.GetEVMCoinDenom()
, which is consistent with moving configurations to thetypes
package.
923-923
: Update chain ID retrieval to use 'evmtypes' packageThe chain ID is now obtained using
evmtypes.GetChainConfig().ChainID
, reflecting the relocation ofchain_config
to thetypes
package.
1087-1087
: Update chain ID retrieval to use 'evmtypes' packageConsistent with the changes,
evmChainID
is now assigned usingevmtypes.GetChainConfig().ChainID
.
…nto GAtom22/evm-config
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: 8
🧹 Outside diff range and nitpick comments (4)
x/evm/types/denom_config_testing.go (3)
20-29
: LGTM with suggestion: Consider using an enum-like pattern for Decimals.The
Decimals
type and constants are well-defined. However, to ensure only valid values (6 and 18) are used, consider implementing an enum-like pattern:type Decimals uint32 const ( SixDecimals Decimals = 6 EighteenDecimals Decimals = 18 ) func (d Decimals) IsValid() bool { return d == SixDecimals || d == EighteenDecimals }This addition would allow for easy validation of
Decimals
values throughout the code.
42-58
: LGTM with suggestions: Improve error handling and nil checks.The
setEVMCoinDecimals
andsetEVMCoinDenom
functions are well-structured with appropriate validation. However, there are a few areas for improvement:
- Add nil checks for
testingEvmCoinInfo
.- Consider using error returns instead of panics for more flexible error handling.
Here's a suggested improvement for
setEVMCoinDecimals
:func setEVMCoinDecimals(d Decimals) error { if testingEvmCoinInfo == nil { return errors.New("testingEvmCoinInfo is not initialized") } if d != SixDecimals && d != EighteenDecimals { return fmt.Errorf("invalid decimal value %d; the evm supports only 6 and 18 decimals", d) } testingEvmCoinInfo.Decimals = d return nil }Apply a similar pattern to
setEVMCoinDenom
.
71-93
: LGTM with suggestion: Improve error handling in setTestingEVMCoinInfo.The
setTestingEVMCoinInfo
andConversionFactor
functions are well-implemented. TheConversionFactor
method is particularly well-documented and handles the conversion correctly.However, the error handling in
setTestingEVMCoinInfo
could be improved:Consider modifying
setTestingEVMCoinInfo
to return an error instead of panicking:func setTestingEVMCoinInfo(evmdenom EvmCoinInfo) error { if testingEvmCoinInfo != nil { return errors.New("testing EVM coin info already set. Make sure you run the configurator's ResetTestChainConfig before trying to set a new evm coin info") } testingEvmCoinInfo = new(EvmCoinInfo) if err := setEVMCoinDenom(evmdenom.Denom); err != nil { return err } if err := setEVMCoinDecimals(evmdenom.Decimals); err != nil { return err } return nil }This change allows for more flexible error handling in the calling code.
app/config_testing.go (1)
50-56
: Consider making evmosActivators a constant map.The
evmosActivators
map is well-defined and serves its purpose of associating opcode modifiers with EIPs. However, as a global variable, it could potentially be modified elsewhere in the codebase, which might lead to unexpected behavior.To prevent unintended modifications, consider making it a constant map:
var evmosActivators = map[string]func(*vm.JumpTable){ "evmos_0": eips.Enable0000, "evmos_1": eips.Enable0001, "evmos_2": eips.Enable0002, }This change would ensure that the map remains immutable throughout the program's execution.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (8)
- app/ante/testutils/testutils.go (1 hunks)
- app/config_testing.go (1 hunks)
- x/evm/keeper/setup_test.go (3 hunks)
- x/evm/types/config_testing.go (1 hunks)
- x/evm/types/configurator.go (6 hunks)
- x/evm/types/denom_config.go (3 hunks)
- x/evm/types/denom_config_testing.go (1 hunks)
- x/evm/wrappers/utils_test.go (6 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- x/evm/types/config_testing.go
- x/evm/types/configurator.go
- x/evm/types/denom_config.go
🧰 Additional context used
🪛 GitHub Check: CodeQL
app/ante/testutils/testutils.go
[warning] 106-106: Useless assignment to local variable
This definition of denom is never used.
[warning] 107-107: Useless assignment to local variable
This definition of decimals is never used.
🪛 GitHub Check: Run golangci-lint
app/ante/testutils/testutils.go
[failure] 106-106:
SA4006: this value ofdenom
is never used (staticcheck)
[failure] 107-107:
SA4006: this value ofdecimals
is never used (staticcheck)x/evm/keeper/setup_test.go
[failure] 102-102:
SA4006: this value ofdenom
is never used (staticcheck)
[failure] 103-103:
SA4006: this value ofdecimals
is never used (staticcheck)x/evm/wrappers/utils_test.go
[failure] 82-82:
Error return value of(*github.com/evmos/evmos/v20/x/evm/types.EVMConfigurator).Configure
is not checked (errcheck)
[failure] 148-148:
Error return value of(*github.com/evmos/evmos/v20/x/evm/types.EVMConfigurator).Configure
is not checked (errcheck)
[failure] 208-208:
Error return value of(*github.com/evmos/evmos/v20/x/evm/types.EVMConfigurator).Configure
is not checked (errcheck)
🔇 Additional comments (22)
x/evm/keeper/setup_test.go (6)
16-16
: LGTM: Import statement added for EVM typesThe addition of the
evmtypes
import is appropriate and aligns with the PR objective of moving chain_config to types.
66-66
: LGTM: Updated EVM coin denomination retrievalThe change from
config.GetEVMCoinDenom()
toevmtypes.GetEVMCoinDenom()
is consistent with the new import and reflects the move of chain_config to types.
90-90
: LGTM: Updated chain configuration initializationThe change to use
evmtypes.DefaultChainConfig()
is appropriate and consistent with the move of chain_config to types.
102-103
: Clarify the usage ofdenom
anddecimals
variablesThe
denom
anddecimals
variables are initialized but appear to be unused in the visible code. They might be used in theConfigure()
method, but this is not clear from the current context.Could you please clarify the purpose of these variables? If they are indeed used in the
Configure()
method, consider adding a comment explaining their usage. If they are not used, consider removing them to avoid confusion.🧰 Tools
🪛 GitHub Check: Run golangci-lint
[failure] 102-102:
SA4006: this value ofdenom
is never used (staticcheck)
[failure] 103-103:
SA4006: this value ofdecimals
is never used (staticcheck)
105-110
: LGTM: Added EVM configurator usageThe introduction of the EVM configurator is a good addition. It provides a clear and structured way to set up the chain configuration. The usage of
denom
anddecimals
in theWithEVMCoinInfo()
method clarifies their purpose.
Line range hint
16-110
: Summary: Changes align well with PR objectivesThe modifications in this file successfully move the chain_config to types and enhance the clarity of EVM-related configurations. The changes include:
- Adding the
evmtypes
import- Updating EVM coin denomination retrieval
- Modifying chain configuration initialization
- Updating block parameter assignments
- Introducing an EVM configurator for setup
These changes make the code more modular and type-safe, which aligns well with the PR objectives of moving chain_config to types.
🧰 Tools
🪛 GitHub Check: Run golangci-lint
[failure] 102-102:
SA4006: this value ofdenom
is never used (staticcheck)
[failure] 103-103:
SA4006: this value ofdecimals
is never used (staticcheck)x/evm/types/denom_config_testing.go (3)
1-18
: LGTM: File header and package declaration are correct.The file header contains appropriate copyright and license information. The build tag
test
ensures this file is only compiled during tests, which is suitable for configuration used in testing. The package name "types" is appropriate for defining types and related functions.
95-98
: LGTM: resetEVMCoinInfo function is correct and useful.The
resetEVMCoinInfo
function is simple and effectively resets thetestingEvmCoinInfo
to nil. This is useful for cleaning up between tests and ensuring a clean state for each test run.
1-98
: Overall assessment: Well-structured file with room for improvements in error handling and safety.This new file introduces useful types and functions for EVM coin configuration in testing. The code is generally well-written and serves its purpose. However, there are several areas where improvements can be made:
- Consider implementing an enum-like pattern for the
Decimals
type to ensure only valid values are used.- Initialize the
testingEvmCoinInfo
variable to prevent potential nil pointer dereferences.- Improve error handling in setter functions by returning errors instead of using panics.
- Add nil checks in getter functions to handle cases where
testingEvmCoinInfo
is not initialized.These changes would enhance the robustness and safety of the code, making it more resilient to errors and easier to use in testing scenarios.
app/config_testing.go (5)
1-8
: LGTM: File header and package declaration are correct.The file header includes the necessary copyright notice and license identifier. The build tag
test
is correctly used to ensure this file is only included in test builds. The package declarationapp
is appropriate for the file's location and purpose.
9-17
: LGTM: Import statements are well-organized.The import statements are correctly grouped and formatted. All imported packages appear to be used in the file, and there are no unused imports.
19-48
: LGTM: InitializeAppConfiguration function is well-implemented.The function correctly sets up the global configuration for tests, including setting the base denomination and configuring the EVM. Error handling is appropriate, and the function follows a clear logical flow.
It's worth noting that this implementation addresses the concerns raised in past review comments about thread safety. The
sealed
variable is no longer used, eliminating the potential data race issue.
58-98
: LGTM: Denomination setting functions are well-implemented.The
setBaseDenomWithChainID
,setTestnetBaseDenom
, andsetMainnetBaseDenom
functions are well-structured and handle errors appropriately. The use of deferred error handling insetTestnetBaseDenom
andsetMainnetBaseDenom
ensures consistent base denomination setting even if registration fails.It's worth noting that this implementation addresses the concern raised in a past review comment about code duplication. The logic for testnet and mainnet configurations has been separated into distinct functions, improving readability and maintainability.
1-98
: Overall, the implementation is well-done and addresses previous concerns.This new file,
app/config_testing.go
, effectively provides testing configurations for the Evmos EVM application. The code is well-structured, error handling is appropriate, and it addresses concerns raised in previous reviews, such as thread safety and code duplication.There's a minor suggestion to make the
evmosActivators
map constant to prevent unintended modifications, but this is a small optimization.Great job on implementing a clean and effective testing configuration setup!
app/ante/testutils/testutils.go (1)
92-102
: LGTM: Chain configuration setup updated correctly.The changes to the chain configuration setup look good:
- Using
evmtypes.DefaultChainConfig
aligns with the PR objective of movingchain_config
to types.- The switch to
sdkmath.Int
pointers for London hard fork parameters is more idiomatic for the Cosmos SDK ecosystem.The logic for disabling the London hard fork when
suite.enableLondonHF
is false remains intact.To verify the impact of these changes, please run the following script:
x/evm/wrappers/utils_test.go (7)
14-14
: LGTM: Import statement added correctly.The addition of the
evmtypes
import is consistent with the refactoring changes made throughout the file.
25-25
: LGTM: Type changes are consistent.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are consistent with the overall refactoring and have been applied correctly throughout the test cases.Also applies to: 32-32, 39-39, 46-46, 53-53, 60-60
98-98
: LGTM: Type changes are consistent.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are consistent with the overall refactoring and have been applied correctly throughout the test cases.Also applies to: 105-105, 112-112, 119-119, 124-124, 131-131, 138-138
168-168
: LGTM: Type changes are consistent.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are consistent with the overall refactoring and have been applied correctly throughout the test cases.Also applies to: 174-174, 180-180, 186-186, 192-192, 198-198
254-256
: LGTM: Type changes and new condition are correct.The changes from
config.EvmCoinInfo
toevmtypes.EvmCoinInfo
are consistent with the overall refactoring. The new condition checking forevmtypes.EighteenDecimals
is a necessary adjustment due to the refactoring.Also applies to: 264-266
Line range hint
1-270
: LGTM: Overall consistency in refactoring.The changes from
config
toevmtypes
have been consistently applied throughout the file. The EVM configuration process has been standardized across all test functions, which improves the consistency and maintainability of the tests.🧰 Tools
🪛 GitHub Check: Run golangci-lint
[failure] 148-148:
Error return value of(*github.com/evmos/evmos/v20/x/evm/types.EVMConfigurator).Configure
is not checked (errcheck)
Line range hint
1-270
: PR objectives met in this file.The changes in this file align with the PR objective of moving
chain_config
to types. The refactoring fromconfig
toevmtypes
is consistent and complete throughout the file.🧰 Tools
🪛 GitHub Check: Run golangci-lint
[failure] 148-148:
Error return value of(*github.com/evmos/evmos/v20/x/evm/types.EVMConfigurator).Configure
is not checked (errcheck)
…nto GAtom22/evm-config
// get the denom and decimals set when initialized the chain | ||
// to set them again | ||
// when resetting the chain config | ||
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning test
// to set them again | ||
// when resetting the chain config | ||
denom := evmtypes.GetEVMCoinDenom() //nolint:staticcheck | ||
decimals := evmtypes.GetEVMCoinDecimals() //nolint:staticcheck |
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning test
Description
Closes: #XXXX
Author Checklist
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.
I have...
Reviewers Checklist
All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.
I have...
Unreleased
section inCHANGELOG.md
Summary by CodeRabbit
New Features
Improvements
EthAccount
withBaseAccount
.Bug Fixes
Documentation