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 changes refine the app state export and zero-height genesis preparation logic by standardizing context initialization, address handling, and error management. Additionally, simulation tests are updated to skip a specific key prefix during state comparison, acknowledging a known issue with cross-chain counter indices. Changes
Sequence Diagram(s)sequenceDiagram
participant Exporter as ExportAppStateAndValidators
participant Context as Context
participant Keeper as Various Keepers
participant Logger as Logger
Exporter->>Context: NewContextLegacy(true, Header{Height: LastBlockHeight()})
Exporter->>Keeper: Retrieve validators, delegations, rewards, etc.
loop For each validator/delegation
Exporter->>Keeper: Convert addresses using ValidatorAddressCodec
Exporter->>Keeper: Withdraw commissions/rewards (ignore errors)
Exporter->>Keeper: Donate outstanding rewards to community pool (log errors)
Exporter->>Keeper: Set validator signing info (panic on error)
end
Exporter->>Logger: Log errors or fatal on critical errors
Exporter->>Context: Return exported app state and validators
sequenceDiagram
participant Test as TestAppImportExport
participant Store as StoreComparer
Test->>Store: Compare original and imported app states
Store->>Store: Skip keys: ...CounterIndexKey for crosschaintypes.StoreKey
Store->>Test: Report differences (excluding skipped keys)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
simulation/simulation_test.go (1)
417-422: Skipping the counter-index key hides real divergence – add a follow-up guard.Adding
crosschaintypes.CounterIndexKeyto the skip list unblocks the test, but it also means any future regression on that key will silently pass.
Consider wrapping the skip behind a helper that fails once #3979 is closed, or add a TODO with an assert that re-enables the comparison when the refactor lands.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/export.go(10 hunks)simulation/simulation_test.go(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
**/*.go: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
simulation/simulation_test.goapp/export.go
🧬 Code Graph Analysis (1)
simulation/simulation_test.go (2)
x/crosschain/types/keys.go (2)
KeyPrefix(37-39)CounterIndexKey(50-50)x/observer/types/keys.go (1)
KeyPrefix(39-41)
⏰ Context from checks skipped due to timeout of 90000ms (6)
- GitHub Check: build-zetanode
- GitHub Check: build-and-test
- GitHub Check: lint
- GitHub Check: gosec
- GitHub Check: build
- GitHub Check: analyze (go)
🔇 Additional comments (1)
app/export.go (1)
184-186: ```shell
#!/bin/bashDisplay unbonding delegation snippet and redelegation snippet for comparison
echo "=== Unbonding Delegation Entries ==="
rg -C3 "ubd.Entries" -n app/export.go || trueecho ""
echo "=== Redelegation Entries ==="
rg -C3 "red.Entries" -n app/export.go || true</details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files🚀 New features to boost your workflow:
|
Description
Closes : #3982
Provides a work around for : #3979
How Has This Been Tested?
Summary by CodeRabbit
Bug Fixes
Chores