fork-genesis assemble: zero bonded/notBonded pool bank balances when stripping validator state
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
Research direction
Start in assemble_genesis_fork.go at stripValidatorState, then read the bank and staking genesis handling referenced in the issue. Extend the existing coverage in assemble_genesis_fork_test.go:164-260 to inspect the bonded_tokens_pool and not_bonded_tokens_pool balances. Done means fork assembly leaves both pool balances at zero and seid start no longer panics during InitChain.
Written by the indexing model from the issue text.
Description
Problem
assemble_genesis_fork.go::stripValidatorState zeros validator/delegation/last_total_power state on the staking module (lines 223-284) but does NOT touch the bank balances on the bonded_tokens_pool / not_bonded_tokens_pool module accounts that the source chain's exported state carries over.
Cosmos staking InitGenesis (sei-cosmos/x/staking/genesis.go:112-126) panics if bondedTokens != sum(validator.tokens). After our fork-assembly:
bondedTokens= 0 (we stripped validators)bonded_tokens_poolbank balance still holds whatever the source chain had
→ seid start panics on InitChain on the first run of the new fork.
Fix
In stripValidatorState, after zeroing staking state, also rewrite the bank module's balances array to set both pool module-account balances to zero. The module-account addresses are deterministic (auth.NewModuleAddress("bonded_tokens_pool") and auth.NewModuleAddress("not_bonded_tokens_pool")).
Related
Discovered via research dive on seid export round-trip (PR sei-protocol/sei-k8s-controller#179). Test coverage in assemble_genesis_fork_test.go:164-260 only inspects staking/slashing/distribution fields, not bank — explains why this didn't surface in unit tests.
Severity
Blocking for any fork ceremony. Fix before first prod run on pacific-1.
🤖 Generated with Claude Code
- Dominant language
- Go
- Stars
- 1
- Forks
- 3
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 14
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sei-protocol/seictl
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
sei-protocol/seictl#236 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
sei-protocol/seictl#212 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
sei-protocol/seictl#178 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sei-protocol/seictl#176 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
sei-protocol/seictl#174 ·
All issues in sei-protocol/seictl
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100