Conversation
WalkthroughReplaced app.toml/flag fallback for EVM chain ID with derivation from the genesis file: removed app.toml reading logic and updated ParseChainID error wording. Added validation calls to ParseChainID during init and root command startup; invalid chain IDs now cause an early error/panic. Root command now always overrides the EVM chain ID with the Kiichain-derived value and emits a deprecation warning if a differing flag/config value was provided. CHANGELOG.md updated with a v7.0.1 release noting the fix. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/config.go (1)
46-50:⚠️ Potential issue | 🟡 MinorStale doc comment still references app.toml fallback.
The comment mentions reading from
app.tomland checking it as a fallback, but that logic has been removed. Update the comment to reflect the current behavior.Proposed fix
-// init initializes the KiichainID variable by reading the chain ID from the -// genesis file or app.toml file in the node's home directory. -// If the genesis file exists, it reads the Cosmos chain ID from there and parses it -// using the full name style chain ID format; otherwise, it checks the app.toml file for the EVM chain ID. -// If neither file exists or the chain ID is not found, it defaults to the Kiichain Chain ID (1010). +// init initializes the KiichainID variable by reading the chain ID from the +// genesis file in the node's home directory and parsing the EVM chain ID from it. +// If the genesis file does not exist or the chain ID is not found, it defaults to the Kiichain Chain ID (1010).
🤖 Fix all issues with AI agents
In `@CHANGELOG.md`:
- Line 7: Update the CHANGELOG entry that currently reads "Pick evm-chaind-id
from genesis instead of config / flag" to correct the typo to "Pick evm-chain-id
from genesis instead of config / flag"; locate the exact line containing the
string "evm-chaind-id" and replace it with "evm-chain-id" preserving the rest of
the sentence and formatting.
In `@cmd/kiichaind/cmd/root.go`:
- Around line 427-434: The deprecation warning string in the logger.Warn call
contains typos; update the message passed to logger.Warn in the block handling
evmChainIdFlag (where viperAppOpts.Get(srvflags.EVMChainID) is read and
viperAppOpts.Set(...) is later called) to replace "depecrated" with "deprecated"
and remove the extra "the" so "and the from" becomes "and from" while keeping
the same contextual values (srvflags.EVMChainID and kiichain.KiichainID) in the
formatted message.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@cmd/kiichaind/cmd/root.go`:
- Around line 427-434: The warning currently compares evmChainIdFlag to
evmserverconfig.DefaultEVMChainID but the code then enforces
kiichain.KiichainID; change the comparison to compare evmChainIdFlag against
kiichain.KiichainID so the logger.Warn only fires when the provided flag differs
from the value that will actually be applied. Update the conditional that
references evmChainIdFlag and srvflags.EVMChainID to use kiichain.KiichainID
instead of evmserverconfig.DefaultEVMChainID, leaving the subsequent
viperAppOpts.Set(srvflags.EVMChainID, kiichain.KiichainID) unchanged.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Description
Deprecates the usage of evm chain id via flat or config, always picking it up from the genesis
Type of change
How Has This Been Tested?
pipelines and locally
PR Checklist:
Make sure each step was done:
make lint-fix