fork-genesis assemble: zero bonded/notBonded pool bank balances when stripping validator state

Aperta
#145 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
cli

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Go
Stelle
1
Fork
3
Merge medio
19m
PR unite (30g)
1

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sei-protocol/seictl

Tutte le issue di sei-protocol/seictl

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.