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_pool bank 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
Problem
assemble_genesis_fork.go::stripValidatorStatezeros validator/delegation/last_total_power state on the staking module (lines 223-284) but does NOT touch the bank balances on thebonded_tokens_pool/not_bonded_tokens_poolmodule accounts that the source chain's exported state carries over.Cosmos staking
InitGenesis(sei-cosmos/x/staking/genesis.go:112-126) panics ifbondedTokens != sum(validator.tokens). After our fork-assembly:bondedTokens= 0 (we stripped validators)bonded_tokens_poolbank balance still holds whatever the source chain had→
seid startpanics on InitChain on the first run of the new fork.Fix
In
stripValidatorState, after zeroing staking state, also rewrite thebankmodule'sbalancesarray to set both pool module-account balances to zero. The module-account addresses are deterministic (auth.NewModuleAddress("bonded_tokens_pool")andauth.NewModuleAddress("not_bonded_tokens_pool")).Related
Discovered via research dive on
seid exportround-trip (PR sei-protocol/sei-k8s-controller#179). Test coverage inassemble_genesis_fork_test.go:164-260only 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