-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: add stateful precompiles support #2633
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughWalkthroughThe recent changes primarily involve updating import paths across multiple files to transition from the Changes
Sequence Diagram(s)sequenceDiagram
participant Node
participant Contracts
participant State
Node->>Contracts: Request stateful precompiled contract
Contracts->>State: Validate contract state
State-->>Contracts: Return validation result
Contracts-->>Node: Provide contract interaction result
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add Documentation and Community
|
e799619
to
4ca59cb
Compare
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.
Don't see particular issue so far
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2633 +/- ##
===========================================
+ Coverage 66.78% 66.83% +0.05%
===========================================
Files 364 368 +4
Lines 20516 20662 +146
===========================================
+ Hits 13702 13810 +108
- Misses 6186 6219 +33
- Partials 628 633 +5
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (9)
readme.md (2)
42-42
: Correct verb agreement.The verb "match" does not agree with the singular subject "version." Consider using "matches."
- Verify that the version of the binaries match the release tag. + Verify that the version of the binaries matches the release tag.Tools
LanguageTool
[uncategorized] ~42-~42: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...Verify that the version of the binaries match the release tag. ``` zetacored version...(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
33-33
: Specify language for code block.Consider specifying a language for the code block to improve readability and syntax highlighting.
- ``` + ```bashTools
Markdownlint
33-33: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
x/crosschain/types/expected_keepers.go (1)
11-11
: Import Path Issue: Verify or Correct the Import Path forevmtypes
The import path
"github.com/zeta-chain/ethermint/x/evm/types"
forevmtypes
does not exist in the current repository. This discrepancy suggests that the import path may be incorrect or the package is missing. Please review the import path to ensure it is correct and that the necessary package is available in the codebase.
- Verify the existence and correctness of the import path for
evmtypes
.- Ensure that the package is correctly integrated into the codebase.
Analysis chain
Verify the correctness of the import change.
The import path for
evmtypes
has been updated. Ensure that this package is compatible and that its usage in the code remains correct.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new import path for `evmtypes` is correct and used appropriately. # Test: Search for the usage of `evmtypes` in the codebase. rg --type go --word-regexp --fixed-strings 'evmtypes.'Length of output: 160
Script:
#!/bin/bash # Verify the definition of `evmtypes` in the new import path. ast-grep --lang go --pattern 'package evmtypes' -- 'github.com/zeta-chain/ethermint/x/evm/types' # Check the usage of `evmtypes` in `rpc/backend/call_tx.go` for compatibility. rg --type go --context 5 --word-regexp --fixed-strings 'evmtypes.' rpc/backend/call_tx.goLength of output: 645
testutil/keeper/fungible.go (2)
8-11
: Consider organizing imports.The import statements could be grouped by standard library, third-party, and local packages for better readability.
95-99
: Potential Issue withauthorityKeeper
InitializationThe
authoritytypes.StoreKey
does not appear to be explicitly initialized in thekeys
setup withinapp/app.go
. This might lead to improper initialization of theauthorityKeeper
. Please verify thatauthoritytypes.StoreKey
is correctly configured in thekeys
andmemKeys
initializations to ensure proper functionality.
- Check the initialization of
keys
inapp/app.go
to includeauthoritytypes.StoreKey
.- Ensure
memKeys
setup includes necessary configurations forauthorityKeeper
.Analysis chain
Ensure proper initialization of
authorityKeeper
.The initialization of
authorityKeeper
with specific keys improves modularity. Ensure that these keys are correctly configured elsewhere in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the configuration of keys for `authorityKeeper`. # Test: Ensure keys are correctly initialized and used. rg --type go 'authoritytypes.StoreKey'Length of output: 297
Script:
#!/bin/bash # Description: Check the initialization and usage of `keys` and `memKeys` in `app/app.go`. # Search for the initialization of `keys` in `app/app.go`. rg --type go 'keys\s*:=\s*' -A 5 app/app.go # Search for the initialization of `memKeys` in `app/app.go`. rg --type go 'memKeys\s*:=\s*' -A 5 app/app.goLength of output: 554
x/crosschain/keeper/evm_hooks.go (1)
Line range hint
56-56
: Reminder: Implement unit tests.The TODO comment indicates that unit tests for
ProcessLogs
are missing. Implementing these tests is crucial for ensuring the reliability and correctness of the log processing logic.Do you want me to generate the unit testing code or open a GitHub issue to track this task?
rpc/namespaces/ethereum/eth/api.go (1)
26-27
: Import Paths Verification: Issues FoundThe import paths
github.com/zeta-chain/ethermint/types
andgithub.com/zeta-chain/ethermint/x/evm/types
are extensively referenced throughout the codebase. However, attempts to locate corresponding directories or files failed, indicating that these paths might not exist within the repository.
- Potential Issues: The absence of these directories suggests that the import paths could be incorrect or the repository structure might have changed.
- Affected Files: The paths are used in multiple files, including
rpc/namespaces/ethereum/eth/api.go
,rpc/backend/chain_info.go
, and many others.Action Required:
- Verify the existence of these paths in the repository or update the import paths to reflect the correct structure.
- Ensure that any changes align with the project's objectives and dependencies.
Analysis chain
Verify the correctness of import paths.
The import paths have been updated to point to the
zeta-chain
repository. Ensure that these paths are correct and align with the project's objectives.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new import paths are valid and exist in the repository. # Test: Search for the existence of the new import paths in the repository. rg --files-with-matches "github.com/zeta-chain/ethermint/types" "github.com/zeta-chain/ethermint/x/evm/types"Length of output: 191
Script:
#!/bin/bash # Description: Verify the existence of directories corresponding to the import paths in the repository. # Search for the 'ethermint/types' and 'ethermint/x/evm/types' directories within the repository. fd 'types' --glob 'ethermint/types' --glob 'ethermint/x/evm/types' --full-pathLength of output: 245
Script:
#!/bin/bash # Description: Search for any references to the import paths within the repository. # Search for references to 'github.com/zeta-chain/ethermint/types' and 'github.com/zeta-chain/ethermint/x/evm/types' in the repository. rg "github.com/zeta-chain/ethermint/types" -A 3 rg "github.com/zeta-chain/ethermint/x/evm/types" -A 3Length of output: 26129
testutil/keeper/keeper.go (1)
Potential Compatibility Issue with
NewContext
Function Signature ChangeThe
NewContext
function now requires ansdk.MultiStore
, but intestutil/keeper/ibccrosschain.go
,stateStore
is initialized usingstore.NewCommitMultiStore
. This might not be compatible with the updated function signature. Consider reviewing and potentially refactoring this initialization to ensure compatibility withsdk.MultiStore
.
- File to Review:
testutil/keeper/ibccrosschain.go
Analysis chain
Line range hint
75-88
: Ensure compatibility with function signature changes.The
NewContext
function now takes asdk.MultiStore
instead ofsdk.CommitMultiStore
. Verify that this change is compatible with the rest of the codebase and does not introduce any issues.
To ensure compatibility with the function signature change, I will check the initialization and usage of
stateStore
in each file whereNewContext
is used. This will help confirm thatsdk.MultiStore
is appropriately handled.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the `NewContext` function signature change. # Test: Search for the usage of `NewContext` function in the repository. rg --type go --pcre2 'NewContext\('Length of output: 1667
Script:
#!/bin/bash # Check how `stateStore` is initialized and used in files where `NewContext` is called. # Find the initialization of `stateStore` in relevant files. rg --type go --pcre2 'stateStore\s*:=' testutil/keeper/authority.go testutil/keeper/emissions.go testutil/keeper/lightclient.go testutil/keeper/observer.go testutil/keeper/ibccrosschain.go testutil/keeper/fungible.goLength of output: 731
app/app.go (1)
563-572
: Refactor key management into a sub-function.Consider refactoring the key management logic into a separate sub-function to improve readability and maintainability.
func gatherAllKeys(keys map[string]storetypes.StoreKey, tkeys map[string]storetypes.StoreKey, memKeys map[string]storetypes.StoreKey) map[string]storetypes.StoreKey { allKeys := make(map[string]storetypes.StoreKey, len(keys)+len(tkeys)+len(memKeys)) for k, v := range keys { allKeys[k] = v } for k, v := range tkeys { allKeys[k] = v } for k, v := range memKeys { allKeys[k] = v } return allKeys }
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (1)
go.sum
is excluded by!**/*.sum
Files selected for processing (107)
- Makefile (7 hunks)
- app/ante/ante.go (1 hunks)
- app/ante/fees.go (2 hunks)
- app/ante/handler_options.go (2 hunks)
- app/ante/interfaces.go (3 hunks)
- app/app.go (5 hunks)
- app/encoding.go (1 hunks)
- app/init_genesis.go (1 hunks)
- app/prefix.go (1 hunks)
- changelog.md (1 hunks)
- cmd/zetacored/add_observer_list.go (1 hunks)
- cmd/zetacored/config/config.go (1 hunks)
- cmd/zetacored/genaccounts.go (1 hunks)
- cmd/zetacored/parse_genesis.go (1 hunks)
- cmd/zetacored/root.go (5 hunks)
- e2e/contracts/contextapp/bindings.go (1 hunks)
- e2e/txserver/zeta_tx_server.go (1 hunks)
- go.mod (7 hunks)
- pkg/mempool/custom_proposal_handler_test.go (1 hunks)
- pkg/mempool/mempool_test.go (1 hunks)
- pkg/mempool/senders_with_nonce.go (1 hunks)
- readme.md (3 hunks)
- rpc/apis.go (1 hunks)
- rpc/backend/account_info.go (2 hunks)
- rpc/backend/account_info_test.go (1 hunks)
- rpc/backend/backend.go (2 hunks)
- rpc/backend/backend_suite_test.go (1 hunks)
- rpc/backend/blocks.go (2 hunks)
- rpc/backend/blocks_test.go (1 hunks)
- rpc/backend/call_tx.go (3 hunks)
- rpc/backend/call_tx_test.go (1 hunks)
- rpc/backend/chain_info.go (2 hunks)
- rpc/backend/chain_info_test.go (1 hunks)
- rpc/backend/client_test.go (1 hunks)
- rpc/backend/evm_query_client_test.go (1 hunks)
- rpc/backend/feemarket_query_client_test.go (1 hunks)
- rpc/backend/filters.go (1 hunks)
- rpc/backend/filters_test.go (1 hunks)
- rpc/backend/mocks/evm_query_client.go (1 hunks)
- rpc/backend/mocks/feemarket_query_client.go (1 hunks)
- rpc/backend/node_info.go (2 hunks)
- rpc/backend/node_info_test.go (1 hunks)
- rpc/backend/sign_tx.go (2 hunks)
- rpc/backend/sign_tx_test.go (1 hunks)
- rpc/backend/tracing.go (2 hunks)
- rpc/backend/tracing_test.go (1 hunks)
- rpc/backend/tx_info.go (2 hunks)
- rpc/backend/tx_info_test.go (1 hunks)
- rpc/backend/utils.go (2 hunks)
- rpc/ethereum/pubsub/pubsub.go (1 hunks)
- rpc/namespaces/ethereum/debug/api.go (2 hunks)
- rpc/namespaces/ethereum/debug/utils.go (1 hunks)
- rpc/namespaces/ethereum/eth/api.go (2 hunks)
- rpc/namespaces/ethereum/eth/filters/api.go (2 hunks)
- rpc/namespaces/ethereum/eth/filters/filter_system.go (2 hunks)
- rpc/namespaces/ethereum/eth/filters/filters.go (1 hunks)
- rpc/namespaces/ethereum/eth/filters/subscription.go (1 hunks)
- rpc/namespaces/ethereum/eth/filters/utils.go (1 hunks)
- rpc/namespaces/ethereum/miner/api.go (1 hunks)
- rpc/namespaces/ethereum/miner/unsupported.go (1 hunks)
- rpc/namespaces/ethereum/net/api.go (2 hunks)
- rpc/namespaces/ethereum/personal/api.go (2 hunks)
- rpc/namespaces/ethereum/txpool/api.go (2 hunks)
- rpc/namespaces/ethereum/web3/api.go (1 hunks)
- rpc/types/addrlock.go (1 hunks)
- rpc/types/block.go (2 hunks)
- rpc/types/events.go (3 hunks)
- rpc/types/events_test.go (1 hunks)
- rpc/types/query_client.go (2 hunks)
- rpc/types/types.go (1 hunks)
- rpc/types/utils.go (2 hunks)
- rpc/websockets.go (2 hunks)
- scripts/protoc-gen-openapi.sh (1 hunks)
- server/config/config.go (1 hunks)
- server/config/toml.go (1 hunks)
- server/flags/flags.go (1 hunks)
- server/indexer_cmd.go (2 hunks)
- server/indexer_service.go (2 hunks)
- server/json_rpc.go (2 hunks)
- server/start.go (2 hunks)
- server/util.go (1 hunks)
- testutil/keeper/authority.go (3 hunks)
- testutil/keeper/codec.go (2 hunks)
- testutil/keeper/config.go (2 hunks)
- testutil/keeper/crosschain.go (5 hunks)
- testutil/keeper/emissions.go (3 hunks)
- testutil/keeper/fungible.go (6 hunks)
- testutil/keeper/ibccrosschain.go (2 hunks)
- testutil/keeper/keeper.go (7 hunks)
- testutil/keeper/lightclient.go (3 hunks)
- testutil/keeper/mocks/crosschain/fungible.go (1 hunks)
- testutil/keeper/mocks/fungible/evm.go (1 hunks)
- testutil/keeper/observer.go (4 hunks)
- testutil/network/genesis_state.go (1 hunks)
- testutil/network/network_setup.go (2 hunks)
- x/crosschain/client/querytests/suite.go (2 hunks)
- x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go (1 hunks)
- x/crosschain/keeper/evm_deposit.go (1 hunks)
- x/crosschain/keeper/evm_deposit_test.go (1 hunks)
- x/crosschain/keeper/evm_hooks.go (1 hunks)
- x/crosschain/keeper/msg_server_vote_inbound_tx_test.go (1 hunks)
- x/crosschain/keeper/utils_test.go (1 hunks)
- x/crosschain/types/expected_keepers.go (1 hunks)
- x/fungible/keeper/deposits.go (1 hunks)
- x/fungible/keeper/evm.go (1 hunks)
- x/fungible/keeper/evm_hooks.go (1 hunks)
- x/fungible/keeper/evm_test.go (1 hunks)
Files not processed due to max files limit (15)
- x/fungible/keeper/gas_coin_and_pool_test.go
- x/fungible/keeper/msg_server_deploy_system_contract_test.go
- x/fungible/keeper/msg_server_update_contract_bytecode_test.go
- x/fungible/keeper/msg_server_update_system_contract_test.go
- x/fungible/keeper/msg_server_update_zrc20_withdraw_fee_test.go
- x/fungible/keeper/zevm_message_passing_test.go
- x/fungible/keeper/zevm_msg_passing.go
- x/fungible/types/evm.go
- x/fungible/types/evm_test.go
- x/fungible/types/expected_keepers.go
- x/observer/client/querytests/suite.go
- zetaclient/zetacore/broadcast_test.go
- zetaclient/zetacore/client.go
- zetaclient/zetacore/client_query_ethermint.go
- zetaclient/zetacore/client_query_test.go
Files skipped from review due to trivial changes (72)
- app/ante/ante.go
- app/ante/fees.go
- app/ante/handler_options.go
- app/prefix.go
- cmd/zetacored/add_observer_list.go
- cmd/zetacored/config/config.go
- cmd/zetacored/parse_genesis.go
- e2e/txserver/zeta_tx_server.go
- pkg/mempool/custom_proposal_handler_test.go
- pkg/mempool/mempool_test.go
- pkg/mempool/senders_with_nonce.go
- rpc/backend/account_info.go
- rpc/backend/account_info_test.go
- rpc/backend/backend.go
- rpc/backend/blocks.go
- rpc/backend/call_tx.go
- rpc/backend/call_tx_test.go
- rpc/backend/chain_info.go
- rpc/backend/chain_info_test.go
- rpc/backend/client_test.go
- rpc/backend/feemarket_query_client_test.go
- rpc/backend/filters.go
- rpc/backend/node_info.go
- rpc/backend/node_info_test.go
- rpc/backend/sign_tx.go
- rpc/backend/sign_tx_test.go
- rpc/backend/tracing_test.go
- rpc/backend/tx_info.go
- rpc/backend/tx_info_test.go
- rpc/backend/utils.go
- rpc/ethereum/pubsub/pubsub.go
- rpc/namespaces/ethereum/debug/api.go
- rpc/namespaces/ethereum/debug/utils.go
- rpc/namespaces/ethereum/eth/filters/api.go
- rpc/namespaces/ethereum/eth/filters/filter_system.go
- rpc/namespaces/ethereum/eth/filters/filters.go
- rpc/namespaces/ethereum/eth/filters/subscription.go
- rpc/namespaces/ethereum/eth/filters/utils.go
- rpc/namespaces/ethereum/miner/api.go
- rpc/namespaces/ethereum/miner/unsupported.go
- rpc/namespaces/ethereum/net/api.go
- rpc/namespaces/ethereum/personal/api.go
- rpc/namespaces/ethereum/txpool/api.go
- rpc/namespaces/ethereum/web3/api.go
- rpc/types/addrlock.go
- rpc/types/block.go
- rpc/types/events.go
- rpc/types/query_client.go
- rpc/types/types.go
- rpc/types/utils.go
- rpc/websockets.go
- server/config/config.go
- server/config/toml.go
- server/flags/flags.go
- server/indexer_cmd.go
- server/indexer_service.go
- server/json_rpc.go
- server/start.go
- server/util.go
- testutil/keeper/mocks/crosschain/fungible.go
- testutil/keeper/mocks/fungible/evm.go
- testutil/network/genesis_state.go
- testutil/network/network_setup.go
- x/crosschain/client/querytests/suite.go
- x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go
- x/crosschain/keeper/evm_deposit.go
- x/crosschain/keeper/evm_deposit_test.go
- x/crosschain/keeper/msg_server_vote_inbound_tx_test.go
- x/fungible/keeper/deposits.go
- x/fungible/keeper/evm.go
- x/fungible/keeper/evm_hooks.go
- x/fungible/keeper/evm_test.go
Additional context used
Path-based instructions (31)
app/encoding.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.e2e/contracts/contextapp/bindings.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/codec.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.app/ante/interfaces.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.app/init_genesis.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/filters_test.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/authority.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.scripts/protoc-gen-openapi.sh (1)
Pattern
**/*.sh
: Review the shell scripts, point out issues relative to security, performance, and maintainability.testutil/keeper/lightclient.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/mocks/feemarket_query_client.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/emissions.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/config.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/ibccrosschain.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/tracing.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.x/crosschain/keeper/utils_test.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/apis.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/observer.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.cmd/zetacored/genaccounts.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/backend_suite_test.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.x/crosschain/types/expected_keepers.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/fungible.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.cmd/zetacored/root.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/types/events_test.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/mocks/evm_query_client.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.x/crosschain/keeper/evm_hooks.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/evm_query_client_test.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/crosschain.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/namespaces/ethereum/eth/api.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.testutil/keeper/keeper.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.app/app.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.rpc/backend/blocks_test.go (1)
Pattern
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
LanguageTool
readme.md
[uncategorized] ~42-~42: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...Verify that the version of the binaries match the release tag. ``` zetacored version...(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)
Markdownlint
readme.md
33-33: null
Fenced code blocks should have a language specified(MD040, fenced-code-language)
Additional comments not posted (100)
app/encoding.go (2)
4-5
: Import Path Update Approved.The import path change to
github.com/zeta-chain/ethermint/encoding
andgithub.com/zeta-chain/ethermint/types
is consistent with the PR objectives.
9-9
: Verify the impact of the return type change.The change in the return type from
params.EncodingConfig
toethermint.EncodingConfig
may affect other components expecting the previous type.e2e/contracts/contextapp/bindings.go (1)
15-15
: Import Path Update Approved.The import path change to
github.com/zeta-chain/ethermint/x/evm/types
aligns with the transition to thezeta-chain
repository.testutil/keeper/codec.go (2)
16-17
: Import Path Update Approved.The import path change to
github.com/zeta-chain/ethermint/types
andgithub.com/zeta-chain/ethermint/x/evm/types
aligns with the new dependency structure.
39-39
: Interface Registration Update Approved.The update to use
ethermint.RegisterInterfaces(registry)
ensures the correct interfaces are registered with the codec.app/ante/interfaces.go (2)
27-29
: Import path updates approved.The import paths have been correctly updated to reflect the transition to the
zeta-chain
namespace.
44-44
: Verify compatibility of return type change inNewEVM
.The return type of
NewEVM
has been changed fromevm.EVM
to*vm.EVM
. Ensure that this change is compatible with all usages ofNewEVM
in the codebase, as it may affect memory management and performance.app/init_genesis.go (1)
19-20
: Import path updates approved.The import paths for
evmtypes
andfeemarkettypes
have been correctly updated to reflect the transition to thezeta-chain
namespace.rpc/backend/filters_test.go (1)
9-9
: Import path update approved.The import path for
evmtypes
has been correctly updated to reflect the transition to thezeta-chain
namespace.testutil/keeper/authority.go (2)
50-50
: LGTM: Use oflog.NewNopLogger()
.The use of
log.NewNopLogger()
is appropriate for testing purposes, as it avoids unnecessary logging output.
32-33
: Consider implications of usingnil
for store initialization.Using
nil
for the database parameter inMountStoreWithDB
allows flexibility but ensure that this aligns with the intended use case and does not introduce unintended side effects.scripts/protoc-gen-openapi.sh (1)
8-8
: LGTM: Update ofETHERMINT
repository reference.The change to point
ETHERMINT
togithub.com/zeta-chain/ethermint
aligns with the PR objectives and ensures consistency with the updated project structure.testutil/keeper/lightclient.go (2)
55-58
: LGTM! But verify the impact of using a logger.The use of
rootmulti.NewStore
with a logger is a positive change for debugging. Ensure this does not alter the intended functionality of the store.Verification successful
Impact of Using
log.NewNopLogger()
withrootmulti.NewStore
VerifiedThe use of
log.NewNopLogger()
withrootmulti.NewStore
across multiple files indicates a consistent approach to disabling logging during tests. This ensures no functional changes are introduced by logging.
- The change is present in:
testutil/keeper/observer.go
testutil/keeper/fungible.go
testutil/keeper/lightclient.go
testutil/keeper/emissions.go
testutil/keeper/authority.go
This approach is suitable for maintaining clean test outputs without affecting the core functionality.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of using a logger with `rootmulti.NewStore`. # Test: Check for any logging-related changes in behavior. Expect: No functional changes. rg --type go 'rootmulti.NewStore\(.*log.NewNopLogger\(\)\)'Length of output: 496
39-40
: Verify store initialization withnil
.The removal of the
db
parameter inMountStoreWithDB
calls simplifies the code. Ensure that the stores are correctly initialized and can handlenil
without issues.rpc/backend/mocks/feemarket_query_client.go (1)
12-12
: Verify the new import path fortypes
.The import path has been updated to
zeta-chain
. Ensure that this new path is correct and that all dependencies are compatible.testutil/keeper/emissions.go (3)
41-41
: VerifystateStore
initialization with a logger.The use of
rootmulti.NewStore
with a logger is beneficial for debugging. Ensure that this change does not affect the intended functionality ofstateStore
.Verification successful
No Impact on
stateStore
Functionality with NopLoggerThe initialization of
stateStore
usingrootmulti.NewStore
withlog.NewNopLogger()
across multiple files does not affect its functionality. The use of a no-operation logger is consistent and does not introduce any dependencies or changes in behavior related to logging. The intended functionality remains intact.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of using a logger with `rootmulti.NewStore` for `stateStore`. # Test: Check for any logging-related changes in behavior. Expect: No functional changes. rg --type go 'rootmulti.NewStore\(.*log.NewNopLogger\(\)\)'Length of output: 496
Script:
#!/bin/bash # Description: Search for references to `stateStore` that might indicate reliance on logging behavior. # Find all references to `stateStore` in the Go codebase to check for dependencies on logging behavior. rg --type go 'stateStore'Length of output: 4845
47-47
: Verify the removal ofdb
parameter ininitAuthorityKeeper
.Ensure that the removal of the
db
parameter frominitAuthorityKeeper
does not affect its functionality.Verification successful
Verification of
db
Parameter Removal ininitAuthorityKeeper
The
initAuthorityKeeper
function, as defined intestutil/keeper/authority.go
, no longer includes adb
parameter. It currently takescdc
andss
as parameters, which aligns with the updated calls across the codebase. The function mounts stores withnil
as the third argument, indicating that thedb
parameter is no longer necessary.
- Function Definition:
testutil/keeper/authority.go
- Parameters:
cdc codec.Codec
,ss store.CommitMultiStore
The removal of the
db
parameter does not appear to affect the functionality, as the necessary store operations are handled with the current parameters.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of removing the `db` parameter from `initAuthorityKeeper`. # Test: Check for any issues related to the removal of `db` parameter. Expect: No issues. rg --type go 'initAuthorityKeeper\(.*stateStore\)'Length of output: 407
Script:
#!/bin/bash # Search for the definition of the `initAuthorityKeeper` function to verify its parameters. ast-grep --lang go --pattern 'func initAuthorityKeeper($_, $_) { $$$ }'Length of output: 73
Script:
#!/bin/bash # Use ripgrep to search for the definition of the `initAuthorityKeeper` function in Go files. rg --type go 'func initAuthorityKeeper'Length of output: 96
Script:
#!/bin/bash # Extract more lines around the definition of `initAuthorityKeeper` to verify its parameters and implementation. rg --type go 'func initAuthorityKeeper' -A 10Length of output: 720
56-56
: Verify the removal ofdb
parameter ininitLightclientKeeper
.Ensure that the removal of the
db
parameter frominitLightclientKeeper
does not affect its functionality.Verification successful
Removal of
db
Parameter ininitLightclientKeeper
VerifiedThe
initLightclientKeeper
function has been successfully refactored to remove thedb
parameter. The use ofnil
inss.MountStoreWithDB
indicates that the database parameter was not essential for the function's current operations. The function continues to initialize the keeper correctly without any apparent issues.
- Function definition and logic are consistent with the removal of the
db
parameter.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the impact of removing the `db` parameter from `initLightclientKeeper`. # Test: Check for any issues related to the removal of `db` parameter. Expect: No issues. rg --type go 'initLightclientKeeper\(.*stateStore,.*authorityKeeper\)'Length of output: 271
Script:
#!/bin/bash # Search for the definition of the `initLightclientKeeper` function to verify its parameters and implementation. ast-grep --lang go --pattern 'func initLightclientKeeper($_, $_, $_) { $$$ }'Length of output: 79
Script:
#!/bin/bash # Search for the definition of the `initLightclientKeeper` function to verify its parameters and implementation. rg --type go 'func initLightclientKeeper'Length of output: 102
Script:
#!/bin/bash # Extract the full definition and implementation of the `initLightclientKeeper` function. rg --type go -A 20 'func initLightclientKeeper' testutil/keeper/lightclient.goLength of output: 893
testutil/keeper/config.go (1)
55-102
: EnsureStoreKeys
function handles all key types correctly.The
StoreKeys
function aggregates various store keys into maps. Ensure that all necessary store keys are included and that the function is used correctly within the application. Consider adding comments to clarify the purpose of each key type if not already documented elsewhere.testutil/keeper/ibccrosschain.go (1)
72-73
: Confirm removal ofdb
parameter does not affect functionality.The
db
parameter has been removed from several function calls. Verify that these functions no longer require the database parameter and that their functionality remains intact.Verification successful
Removal of
db
Parameter is Valid and Maintains FunctionalityThe
initAuthorityKeeper
andinitLightclientKeeper
functions have been successfully refactored to remove thedb
parameter. They now utilizestore.CommitMultiStore
, which abstracts the database interactions, ensuring that the functionality remains intact.
initAuthorityKeeper
is defined intestutil/keeper/authority.go
.initLightclientKeeper
is defined intestutil/keeper/lightclient.go
.The change is consistent with the intended design and does not impact the maintainability or functionality of the code.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the initialization functions to ensure they no longer require the `db` parameter. # Test: Search for the `initAuthorityKeeper` and `initLightclientKeeper` function definitions to confirm the parameter change. ast-grep --lang go --pattern 'func initAuthorityKeeper($_, $_) $_' ast-grep --lang go --pattern 'func initLightclientKeeper($_, $_, $_) $_'Length of output: 1897
rpc/backend/tracing.go (1)
26-26
: Verify the new import path forevmtypes
.The import path for
evmtypes
has been updated togithub.com/zeta-chain/ethermint/x/evm/types
. Ensure that this change is intentional and that the new path is correct and compatible with the existing code.Verification successful
Confirm the import path for
evmtypes
.The import path
github.com/zeta-chain/ethermint/x/evm/types
is used consistently across the codebase, suggesting it is the correct path. Ensure that the repository is accessible and contains the expected package structure.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new import path for `evmtypes`. # Test: Check if the new import path exists in the repository. rg --type go 'github.com/zeta-chain/ethermint/x/evm/types'Length of output: 6077
x/crosschain/keeper/utils_test.go (1)
12-12
: Import Path Update Approved.The import path for
evmkeeper
has been updated togithub.com/zeta-chain/ethermint/x/evm/keeper
. This change aligns with the project's migration to the Zeta Chain repository.rpc/apis.go (1)
25-25
: Import Path Update Approved.The import path for
ethermint
has been updated togithub.com/zeta-chain/ethermint/types
. This change is consistent with the migration to the Zeta Chain repository.testutil/keeper/observer.go (1)
7-10
: Initialization Logic Simplification Approved.The removal of the
db
parameter and the use ofnil
inMountStoreWithDB
enhance the modularity and simplify the initialization process. The integration of logging capabilities improves observability, making the codebase more maintainable.Also applies to: 54-55, 79-89
cmd/zetacored/genaccounts.go (1)
19-20
: Verify the correctness of the import changes.The import paths for
ethermint
andevmtypes
have been updated. Ensure that these packages are compatible and that their usage in the code remains correct.Verification successful
Confirm Usage and Compatibility of Updated Imports
The updated import paths for
ethermint
andevmtypes
are indeed used in the codebase. Here are the relevant usages:
ethermint
:
- Found in
rpc/namespaces/ethereum/personal/api.go
, indicating its use in the context of personal account management.
evmtypes
:
- Found in
rpc/backend/call_tx.go
, used for performing simulated call operations.These findings suggest that the imports are correctly integrated into the codebase. Ensure that these usages are compatible with any changes in the imported packages' APIs.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new import paths are correct and used appropriately. # Test: Search for the usage of `ethermint` and `evmtypes` in the codebase. rg --type go --word-regexp --fixed-strings 'ethermint.' 'evmtypes.'Length of output: 115
Script:
#!/bin/bash # Description: Correctly verify the usage of `ethermint` and `evmtypes` in the codebase. # Test: Search for the usage of `ethermint` and `evmtypes` in the codebase. rg --type go --word-regexp 'ethermint\.' -A 3 rg --type go --word-regexp 'evmtypes\.' -A 3Length of output: 849
rpc/backend/backend_suite_test.go (1)
20-26
: Verify the correctness of the import changes.The import paths for various packages have been updated. Ensure that these packages are compatible and that their usage in the code remains correct.
Verification successful
Import Paths and Usage Verified
The new import paths for the packages have been correctly updated and are used appropriately throughout the codebase. The following observations confirm their usage:
app
: Extensively used in various modules for configuration, encoding, and application setup.ethsecp256k1
: Utilized for cryptographic operations, such as key generation and encryption.hd
: Applied in keyring options and key generation.encoding
: Employed for encoding configurations and codec operations.indexer
: Used for creating indexers and indexing operations.tests
: Used for generating test addresses and keys.No discrepancies were found in the import paths or their usage. The codebase reflects the correct integration of these packages.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new import paths are correct and used appropriately. # Test: Search for the usage of `app`, `ethsecp256k1`, `hd`, `encoding`, `indexer`, and `tests` in the codebase. rg --type go --word-regexp --fixed-strings 'app.' 'ethsecp256k1.' 'hd.' 'encoding.' 'indexer.' 'tests.'Length of output: 337
Script:
#!/bin/bash # Correcting the syntax error and refining the search for import statements and usage. # Search for the import statements of the specified packages. ast-grep --lang go --pattern 'import $_ "github.com/zeta-chain/ethermint/app"' ast-grep --lang go --pattern 'import $_ "github.com/zeta-chain/ethermint/crypto/ethsecp256k1"' ast-grep --lang go --pattern 'import $_ "github.com/zeta-chain/ethermint/crypto/hd"' ast-grep --lang go --pattern 'import $_ "github.com/zeta-chain/ethermint/encoding"' ast-grep --lang go --pattern 'import $_ "github.com/zeta-chain/ethermint/indexer"' ast-grep --lang go --pattern 'import $_ "github.com/zeta-chain/ethermint/tests"' # Search for the usage of these packages in the codebase. rg --type go 'app\.' -A 3 rg --type go 'ethsecp256k1\.' -A 3 rg --type go 'hd\.' -A 3 rg --type go 'encoding\.' -A 3 rg --type go 'indexer\.' -A 3 rg --type go 'tests\.' -A 3Length of output: 109891
testutil/keeper/fungible.go (3)
88-88
: Use oflog.NewNopLogger()
is appropriate for testing.The use of
log.NewNopLogger()
is a good choice for testing as it avoids cluttering the output with log messages.
131-139
: Dynamic store mounting enhances scalability.The use of loops to dynamically mount stores based on keys improves scalability and maintainability.
64-65
: Verify the impact of usingnil
for DB inMountStoreWithDB
.The change to use
nil
instead ofdb
inMountStoreWithDB
calls should be verified to ensure it doesn't affect the functionality or performance.cmd/zetacored/root.go (4)
32-34
: Updated import paths align with new repository structure.The changes to import paths reflect a transition to the
zeta-chain
repository, which is consistent with the PR objectives.
48-48
: Update toNewRootCmd
signature improves consistency.The change from
appparams.EncodingConfig
totypes.EncodingConfig
is consistent with the refactoring of encoding configuration.
122-122
: Refactoring ofinitRootCmd
enhances compatibility.The function now uses
types.EncodingConfig
, which aligns with the overall refactoring efforts.
239-239
: Update toappCreator
struct improves consistency.The change to use
types.EncodingConfig
ensures consistency across the codebase.rpc/types/events_test.go (1)
10-10
: Import path update aligns with repository transition.The change to the import path for
evmtypes
reflects the shift to thezeta-chain
repository and is consistent with the PR objectives.rpc/backend/mocks/evm_query_client.go (1)
12-12
: Import path update approved.The import path change from
github.com/evmos/ethermint/x/evm/types
togithub.com/zeta-chain/ethermint/x/evm/types
is consistent with the PR objectives and does not affect the mock functionality.x/crosschain/keeper/evm_hooks.go (1)
17-17
: Import path update approved.The import path change from
github.com/evmos/ethermint/x/evm/types
togithub.com/zeta-chain/ethermint/x/evm/types
is consistent with the PR objectives.rpc/backend/evm_query_client_test.go (1)
17-18
: Import path updates approved.The import path changes from
github.com/evmos/ethermint/tests
togithub.com/zeta-chain/ethermint/tests
and fromgithub.com/evmos/ethermint/x/evm/types
togithub.com/zeta-chain/ethermint/x/evm/types
are consistent with the PR objectives and ensure alignment with the updated dependencies.Makefile (6)
3-3
: LGTM: Correct package name declaration.The
PACKAGE_NAME
is correctly set togithub.com/zeta-chain/node
.
12-12
: LGTM: GOFLAGS initialization.The
GOFLAGS
variable is correctly initialized as an empty string.
13-13
: LGTM: Golang cross version specification.The
GOLANG_CROSS_VERSION
is appropriately set tov1.22.4
.
14-14
: LGTM: GOPATH configuration.The
GOPATH
is correctly set to the user's Go workspace.
29-29
: LGTM: Test directory configuration.The
TEST_DIR
is correctly set to include all subdirectories.
59-60
: LGTM: Test command restructuring.The restructuring of the
test
command enhances clarity.testutil/keeper/crosschain.go (6)
8-8
: LGTM: Logging import.The import of
log
enhances the ability to monitor and debug operations.
11-11
: LGTM: Rootmulti import.The import of
rootmulti
supports a more flexible store management approach.
25-25
: LGTM: Authority keeper import.The import of
authoritykeeper
aligns with the refactored keeper initialization.
31-31
: LGTM: Lightclient keeper import.The import of
lightclientkeeper
supports modular initialization.
33-33
: LGTM: Observer keeper import.The import of
observerkeeper
aligns with the modular initialization.
Line range hint
98-224
: LGTM: Enhanced keeper initialization and store management.The modifications improve the flexibility, clarity, and maintainability of the
CrosschainKeeperWithMocks
function. However, consider addressing the TODO comment regarding the IBC router sealing to ensure completeness.go.mod (45)
8-8
: LGTM: Addition of cosmossdk.io/errors.The addition of
cosmossdk.io/errors
enhances error handling capabilities.
9-9
: LGTM: Addition of cosmossdk.io/math.The addition of
cosmossdk.io/math
provides useful mathematical utilities.
10-10
: LGTM: Addition of cosmossdk.io/tools/rosetta.The addition of
cosmossdk.io/tools/rosetta
supports Rosetta API integration.
11-11
: LGTM: Addition of github.com/99designs/keyring.The addition of
github.com/99designs/keyring
enhances secure key storage capabilities.
12-12
: LGTM: Addition of github.com/btcsuite/btcd.The addition of
github.com/btcsuite/btcd
supports Bitcoin-related functionalities.
13-13
: LGTM: Addition of github.com/btcsuite/btcd/btcec/v2.The addition of
github.com/btcsuite/btcd/btcec/v2
provides elliptic curve cryptography utilities.
14-14
: LGTM: Addition of github.com/btcsuite/btcd/btcutil.The addition of
github.com/btcsuite/btcd/btcutil
provides Bitcoin utility functions.
15-15
: LGTM: Addition of github.com/btcsuite/btcd/chaincfg/chainhash.The addition of
github.com/btcsuite/btcd/chaincfg/chainhash
provides utilities for Bitcoin chain configurations and hashes.
17-17
: LGTM: Addition of github.com/cenkalti/backoff/v4.The addition of
github.com/cenkalti/backoff/v4
provides backoff algorithms for retry logic.
18-18
: LGTM: Addition of github.com/cockroachdb/errors.The addition of
github.com/cockroachdb/errors
enhances error handling and reporting capabilities.
19-19
: LGTM: Addition of github.com/coinbase/rosetta-sdk-go.The addition of
github.com/coinbase/rosetta-sdk-go
supports Rosetta API integration for blockchain interoperability.
20-20
: LGTM: Addition of github.com/cometbft/cometbft.The addition of
github.com/cometbft/cometbft
provides consensus and networking functionalities.
21-21
: LGTM: Addition of github.com/cometbft/cometbft-db.The addition of
github.com/cometbft/cometbft-db
supports database functionalities for the CometBFT framework.
22-22
: LGTM: Addition of github.com/cosmos/btcutil.The addition of
github.com/cosmos/btcutil
provides Bitcoin utility functions within the Cosmos ecosystem.
26-26
: LGTM: Addition of github.com/davecgh/go-spew.The addition of
github.com/davecgh/go-spew
provides utilities for printing Go data structures.
27-27
: LGTM: Addition of github.com/emicklei/proto.The addition of
github.com/emicklei/proto
supports protocol buffer parsing and manipulation.
29-29
: LGTM: Addition of github.com/fatih/color.The addition of
github.com/fatih/color
provides utilities for colorizing terminal output.
30-30
: LGTM: Addition of github.com/frumioj/crypto11.The addition of
github.com/frumioj/crypto11
provides PKCS#11 cryptographic functionalities.
32-32
: LGTM: Addition of github.com/golang/mock.The addition of
github.com/golang/mock
provides mocking capabilities for testing.
35-35
: LGTM: Addition of github.com/gorilla/websocket.The addition of
github.com/gorilla/websocket
provides WebSocket protocol support.
37-37
: LGTM: Addition of github.com/hashicorp/go-getter.The addition of
github.com/hashicorp/go-getter
provides utilities for downloading files from various sources.
38-38
: LGTM: Addition of github.com/huandu/skiplist.The addition of
github.com/huandu/skiplist
provides a skip list data structure implementation.
39-39
: LGTM: Addition of github.com/improbable-eng/grpc-web.The addition of
github.com/improbable-eng/grpc-web
provides support for gRPC-Web protocol.
40-40
: LGTM: Addition of github.com/libp2p/go-libp2p.The addition of
github.com/libp2p/go-libp2p
provides peer-to-peer networking functionalities.
41-41
: LGTM: Addition of github.com/libp2p/go-libp2p-kad-dht.The addition of
github.com/libp2p/go-libp2p-kad-dht
provides Kademlia DHT functionalities for peer-to-peer networking.
43-43
: LGTM: Addition of github.com/nanmu42/etherscan-api.The addition of
github.com/nanmu42/etherscan-api
provides an interface to the Etherscan API.
44-44
: LGTM: Addition of github.com/near/borsh-go.The addition of
github.com/near/borsh-go
provides Borsh serialization and deserialization functionalities.
45-45
: LGTM: Addition of github.com/onrik/ethrpc.The addition of
github.com/onrik/ethrpc
provides Ethereum RPC client functionalities.
46-46
: LGTM: Addition of github.com/pkg/errors.The addition of
github.com/pkg/errors
enhances error handling capabilities.
48-48
: LGTM: Addition of github.com/rakyll/statik.The addition of
github.com/rakyll/statik
provides utilities for embedding static files into Go binaries.
49-49
: LGTM: Addition of github.com/rs/cors.The addition of
github.com/rs/cors
provides middleware for handling CORS in Go applications.
50-50
: LGTM: Addition of github.com/rs/zerolog.The addition of
github.com/rs/zerolog
provides structured logging capabilities.
51-51
: LGTM: Addition of github.com/samber/lo.The addition of
github.com/samber/lo
provides a collection of utility functions for Go.
52-52
: LGTM: Addition of github.com/spf13/afero.The addition of
github.com/spf13/afero
provides an abstract filesystem interface.
53-53
: LGTM: Addition of github.com/spf13/cast.The addition of
github.com/spf13/cast
provides utilities for casting between different data types.
54-54
: LGTM: Addition of github.com/spf13/cobra.The addition of
github.com/spf13/cobra
provides a library for creating powerful command-line interfaces.
55-55
: LGTM: Addition of github.com/spf13/pflag.The addition of
github.com/spf13/pflag
provides enhanced flag parsing capabilities for Go applications.
56-56
: LGTM: Addition of github.com/spf13/viper.The addition of
github.com/spf13/viper
provides configuration management capabilities for Go applications.
57-57
: LGTM: Addition of github.com/stretchr/testify.The addition of
github.com/stretchr/testify
provides utilities for writing unit tests in Go.
58-58
: LGTM: Addition of github.com/zeta-chain/ethermint.The addition of
github.com/zeta-chain/ethermint
supports Ethereum-related functionalities within the ZetaChain ecosystem.
59-59
: LGTM: Addition of github.com/zeta-chain/keystone/keys.The addition of
github.com/zeta-chain/keystone/keys
provides key management functionalities within the ZetaChain ecosystem.
60-60
: LGTM: Addition of github.com/zeta-chain/protocol-contracts.The addition of
github.com/zeta-chain/protocol-contracts
supports protocol contract functionalities within the ZetaChain ecosystem.
352-352
: LGTM: Replace directive for github.com/ethereum/go-ethereum.The replacement with a ZetaChain maintained fork aligns with specific project requirements for Ethereum functionalities.
353-353
: LGTM: Replace directive for github.com/libp2p/go-libp2p.The replacement with a ZetaChain maintained fork aligns with specific project requirements for peer-to-peer networking.
354-354
: LGTM: Replace directive for gitlab.com/thorchain/tss/go-tss.The replacement with a ZetaChain maintained fork aligns with specific project requirements for threshold signature schemes.
testutil/keeper/keeper.go (2)
396-484
: Review the new functionNewSDKKeepersWithKeys
.The
NewSDKKeepersWithKeys
function introduces a new way to instantiate SDK keepers with local storage for testing. Ensure that the function is correctly implemented and aligns with the project's testing framework.
43-48
: Verify the correctness of import paths.The import paths have been updated to point to the
zeta-chain
repository. Ensure that these paths are correct and align with the project's objectives.app/app.go (2)
83-90
: Verify the correctness of import paths.The import paths have been updated to point to the
zeta-chain
repository. Ensure that these paths are correct and align with the project's objectives.
316-316
: Ensure compatibility with function signature changes.The
New
function now usesethermint.EncodingConfig
instead ofappparams.EncodingConfig
. Verify that this change is compatible with the rest of the codebase and does not introduce any issues.Verification successful
No Compatibility Issues Detected with
New
Function Signature ChangeThe change in the
New
function signature fromappparams.EncodingConfig
toethermint.EncodingConfig
inapp/app.go
does not appear to introduce any compatibility issues within the codebase. The function is not directly referenced elsewhere in a manner that would be affected by this change.
- The
New
function inapp/app.go
is defined withethermint.EncodingConfig
, and no direct references were found that would be impacted by this change.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the `New` function signature change. # Test: Search for the usage of `New` function in the repository. rg --type go --pcre2 'New\('Length of output: 36877
Script:
#!/bin/bash # Locate the definition of the `New` function in `app/app.go` and analyze its usage. ast-grep --lang go --pattern 'func New($_, $_) {' app/app.goLength of output: 503
Script:
#!/bin/bash # Corrected pattern to locate the definition of the `New` function in `app/app.go`. ast-grep --lang go --pattern 'func New($_) {' app/app.goLength of output: 495
Script:
#!/bin/bash # Use ripgrep to search for the definition of the `New` function in `app/app.go`. rg 'func New\(' app/app.go -A 10Length of output: 311
Script:
#!/bin/bash # Search for references to the `New` function throughout the repository to verify compatibility. rg 'New\(' --type goLength of output: 36869
changelog.md (1)
60-60
: Changelog entry is well-formatted.The addition of the entry for stateful precompiled contracts is consistent with the existing format.
rpc/backend/blocks_test.go (1)
17-18
: Verify the updated import paths.The import paths have been updated to point to the
zeta-chain
repository. Ensure these paths are correct and align with the new repository structure.
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.
It would be nice to add a simple contract and invoke it on the e2e side to demonstrate that this actually works?
Yes, that's going to be a second PR on top of this branch. This is just the base feature. |
@lumtis for make generate to work now we need solc and abigen installed for EDIT: i added solc-select to action and some checks to script for solc/solc-select to make it a bit more robust |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
CI stamp
Description
Introduce the stateful precompiled contracts support into the ZetaChain node.
Closes #2511
Closes #2512
Closes #2498
Summary
evmos/ethermint
, instead importzeta-chain/ethermint
directly.NewEVM
now returns an instance of*vm.EVM
, which is instantiated fromgo-ethereum/core/vm
and supports stateful precompiled contracts.simapp
dependency was removed fromzeta-chain/ethermint
in zeta-chain/ethermint@a8efba4, hence some parts of the code such asapp/encoding.go
still using types fromsimapp
were failing. Replaced simapp types forzeta-chain/ethermint/types
prototype
contract, deployed in0x0000000000000000000000000000000000000065
user_precompile
make precompile
to generate the abi and bindings for each precompile.How Has This Been Tested?
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores
go.mod
file to align with Zeta Chain's libraries.