-
Notifications
You must be signed in to change notification settings - Fork 193
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
refactor(evm): unique chain ids for all networks #1976
Conversation
WalkthroughThis change introduces a significant refactor to the handling of Ethereum chain IDs across various networks within the project. The mainnet ID is updated, and new identifiers are added for multiple testnet and devnet configurations. These adjustments enhance clarity and functionality in network configurations, ensuring better compatibility with Ethereum EVM standards. Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- CHANGELOG.md (1 hunks)
- app/appconst/appconst.go (1 hunks)
- app/appconst/appconst_test.go (1 hunks)
Files skipped from review due to trivial changes (1)
- CHANGELOG.md
Additional comments not posted (7)
app/appconst/appconst_test.go (2)
29-31
: Verify the correctness of the new constantETH_CHAIN_ID_LOCALNET_0
.Ensure that
appconst.ETH_CHAIN_ID_LOCALNET_0
is correctly defined and used throughout the codebase.
34-39
: Verify the correctness of the new constantsETH_CHAIN_ID_TESTNET_1
andETH_CHAIN_ID_DEVNET_2
.Ensure that
appconst.ETH_CHAIN_ID_TESTNET_1
andappconst.ETH_CHAIN_ID_DEVNET_2
are correctly defined and used throughout the codebase.Verification successful
The constants
ETH_CHAIN_ID_TESTNET_1
andETH_CHAIN_ID_DEVNET_2
are correctly defined and used.
- Defined in
app/appconst/appconst.go
:
ETH_CHAIN_ID_TESTNET_1
asint64 = 7210
ETH_CHAIN_ID_DEVNET_2
asint64 = 7221
- Used in
app/appconst/appconst_test.go
for test cases.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition and usage of the new constants `ETH_CHAIN_ID_TESTNET_1` and `ETH_CHAIN_ID_DEVNET_2`. # Test: Search for the definition and usage of `ETH_CHAIN_ID_TESTNET_1` and `ETH_CHAIN_ID_DEVNET_2`. Expect: Correct definition and usage. rg --type go 'ETH_CHAIN_ID_TESTNET_1|ETH_CHAIN_ID_DEVNET_2'Length of output: 350
app/appconst/appconst.go (5)
55-57
: Verify the correctness of the new constants values for devnets.Ensure that the new values
7220
,7221
, and7222
forETH_CHAIN_ID_DEVNET_1
,ETH_CHAIN_ID_DEVNET_2
, andETH_CHAIN_ID_DEVNET_3
are correct and used consistently throughout the codebase.
51-53
: Verify the correctness of the new constants values for testnets.Ensure that the new values
7210
,7211
, and7212
forETH_CHAIN_ID_TESTNET_1
,ETH_CHAIN_ID_TESTNET_2
, andETH_CHAIN_ID_TESTNET_3
are correct and used consistently throughout the codebase.
59-62
: Verify the correctness of the new constants values for localnets.Ensure that the new values
7230
,7231
,7232
, and7233
forETH_CHAIN_ID_LOCALNET_0
,ETH_CHAIN_ID_LOCALNET_1
,ETH_CHAIN_ID_LOCALNET_2
, andETH_CHAIN_ID_LOCALNET_3
are correct and used consistently throughout the codebase.
49-49
: Verify the correctness of the new constant value forETH_CHAIN_ID_MAINNET
.Ensure that the new value
7200
forETH_CHAIN_ID_MAINNET
is correct and used consistently throughout the codebase.
68-81
: Verify the correctness of the updated mappings inknownEthChainIDMap
.Ensure that the mappings for
nibiru-testnet-1
,nibiru-testnet-2
,nibiru-testnet-3
,nibiru-devnet-1
,nibiru-devnet-2
,nibiru-devnet-3
,nibiru-localnet-0
,nibiru-localnet-1
,nibiru-localnet-2
, andnibiru-localnet-3
are correct and used consistently throughout the codebase.
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
Generates unique chain ids for mainnet, testnets, devnets and localnets.
Each of our public JSON-RPC endpoints (all but localnets) will need to be registered at:
Slot 7200 - 7300 if chain ids seem to be empty so far.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation