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

オープン
#145 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
go
領域
cli

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
Go
スター
1
フォーク
3
平均マージ
19分
マージ済み PR(30日)
1

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sei-protocol/seictl のほかの issue

sei-protocol/seictl の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。