Skip to content

fix(chains/atlantic-2): replace embedded genesis to match live chain#21

Open
bdchatham wants to merge 2 commits into
mainfrom
fix/atlantic-2-genesis-match-live-chain
Open

fix(chains/atlantic-2): replace embedded genesis to match live chain#21
bdchatham wants to merge 2 commits into
mainfrom
fix/atlantic-2-genesis-match-live-chain

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

@bdchatham bdchatham commented May 24, 2026

Summary

sei-config's embedded chains/atlantic-2/genesis.json didn't match the genesis that the live atlantic-2 chain actually instantiated with. The mismatch was structural — different validator set entirely. This PR replaces the file with the correct content from sei-protocol/chain-configs, plus the populated app_state.params block (cosmosGasParams + feesParams.globalMinimumGasPrices) that the binary requires at cold-start. ChainInfo's hardcoded GenesisTime is updated to match the new file.

Evidence

Cross-checked sei-config's atlantic-2 against the live atlantic-2 chain via an independent operator (sei-testnet-rpc.polkachu.com, at height ~249722485). Polkachu's /genesis_chunked matches chain-configs byte-for-byte on validators, accounts, and balances; sei-config was the outlier.

top-level .validators .app_state.bank.balances .app_state.auth.accounts .app_state.genutil.gen_txs
sei-config (before) 5 1606 1606 5
chain-configs 17 1043 1043 17
polkachu live atlantic-2 17 1043 1043 17

Validator sets are fundamentally different. validators[0] in array order:

  • sei-config (before): 3B9452E7C69E99BB0232E5C17A5C861541D4B766
  • chain-configs: C6208FF552C519044DFCA169E88F4EA1A2BE7BAB
  • polkachu live: C6208FF552C519044DFCA169E88F4EA1A2BE7BAB

All 17 sorted addresses in chain-configs match all 17 sorted addresses in polkachu (sample of first three: 04AD1DF0..., 1C64B578..., 1E633EC2...). None of sei-config's 5 addresses appear in either set. This isn't drift — it's the wrong genesis entirely.

Why this hasn't been observed in prod

Existing atlantic-2 nodes bootstrap via state-sync, which validates against a recent trusted snapshot and bypasses launch-genesis hash verification. So a node with the wrong embedded genesis can still successfully sync into the right chain. The error mode where this would have surfaced is block-sync-from-genesis (archive bootstrap), where the launch-genesis hash mismatch causes immediate failure. atlantic-2 archives are currently disabled in our prod kustomization for separate reasons, so this drift sat dormant.

Cross-check parity for the other chains (no change needed)

  • pacific-1: sei-config matches live chain (validated against sei-rpc.polkachu.com). 25 validators, identical addresses across all three sources (sei-config, chain-configs, polkachu live).
  • arctic-1: sei-config matches live chain (validated against rpc-arctic-1.sei-apis.com). 30 validators, identical addresses across all three sources.

Neither pacific-1 nor arctic-1 is touched by this PR.

Changes

  1. chains/atlantic-2/genesis.json replaced with chain-configs/atlantic-2/genesis.json (the launch genesis the live chain instantiated with) + the populated app_state.params block. The params block is identical to what pacific-1 and arctic-1 already have in sei-config (added in be978d9 to prevent v6.4.1+ cold-start panics); values pulled from on-chain via seid query params {feesparams,cosmosgasparams} on a running wave-0 RPC. All three chains operationally use 0.020000000000000000 usei and a 1/1 cosmos gas multiplier.

  2. chains.go — atlantic-2's ChainInfo.GenesisTime updated from 2023-02-22T23:45:12.575885043Z (the genesis_time of the old wrong copy) to 2023-02-24T01:00:00.000000000Z (the genesis_time the live chain actually has). TestGenesisForChain_KnownChains now passes again.

File-size change: 763 KiB → 521 KiB (the old copy had ~243 KiB of accounts and balances that don't exist in the actual atlantic-2 chain).

What this PR does NOT address

  • The arctic-1 archive-bootstrap panic on whitelisted_codehashes_bank_send is a separate binary-version mismatch (v6.5.0 doesn't know that field; the chain runs a newer binary). That field is byte-identical between sei-config and chain-configs for arctic-1, matches what the live chain has, and isn't a genesis drift issue.
  • The structural sync mechanism (make sync-genesis + CI drift check) proposed in Sync embedded chain genesis files from sei-protocol/chain-configs #20. The cross-check work for this PR found that 2/3 chains already match upstream; the remaining sync-mechanism need is much smaller than the issue originally framed. Worth a separate refresher comment on Sync embedded chain genesis files from sei-protocol/chain-configs #20.

Follow-ups worth tracking (raised in review, non-blocking)

  • Embedded consensus_params vs live consensus_params drift exists on all three chains (missing min_txs_in_block / max_gas_wanted; vote_extensions_enable_height as number vs string). This is the pattern inherited from upstream chain-configs. Only matters for block-sync-from-genesis (state-sync masks it). Worth a follow-up issue documenting the policy: embedded genesis is for state-sync bootstrap only, not replay-from-genesis. Un-defer if anyone proposes a replay flow.
  • GenesisTime format normalization: live polkachu reports 2023-02-24T01:00:00Z; embedded file and ChainInfo use 2023-02-24T01:00:00.000000000Z. Future regen scripts would need to normalize. One-line helper as a follow-up.

Refs

bdchatham and others added 2 commits May 24, 2026 11:28
sei-config's embedded atlantic-2 genesis didn't match the actual
running atlantic-2 chain. The mismatch was structural — different
validator set entirely:

                              sei-config (before)   live atlantic-2
  top-level .validators                       5                17
  app_state.bank.balances                  1606              1043
  app_state.auth.accounts                  1606              1043
  app_state.genutil.gen_txs                   5                17

The 5 validator addresses in the old sei-config copy (3B9452..,
6606707.., 8071266.., C3AEA3.., DB22F3..) are completely different
from the 17 in the live chain (04AD1DF.., 1C64B5.., 1E633E.., ...).
Cross-checked against an independent operator's /genesis_chunked
(sei-testnet-rpc.polkachu.com at atlantic-2 height ~249722485);
polkachu agrees byte-for-byte with sei-protocol/chain-configs for
the validator set, accounts, and balances. sei-config was the
outlier.

Block-sync-from-genesis on atlantic-2 with the old sei-config would
have failed at the launch-genesis hash check; nodes today work only
because they state-sync (which bypasses the launch-genesis hash and
trusts a snapshot at a recent height). atlantic-2 archive bring-up
would have failed twice — once on this wrong genesis, then again on
the binary-version mismatch from #20 follow-ups.

This commit replaces the file with:
  - chain-configs/atlantic-2/genesis.json (the launch genesis the
    live chain actually instantiated with — 17 validators), plus
  - the populated app_state.params block (cosmosGasParams +
    feesParams.globalMinimumGasPrices) needed to avoid v6.4.1+
    cold-start panic on fresh nodes. Values pulled from on-chain
    via `seid query params {feesparams,cosmosgasparams}` against
    a running wave-0 RPC; matches what pacific-1 and arctic-1 in
    sei-config already have.

File size: 763 KiB → 521 KiB.

Cross-check parity:
  - pacific-1: sei-config already matches live chain (validated
    against polkachu/sei-rpc.polkachu.com).
  - arctic-1: sei-config already matches live chain (validated
    against rpc-arctic-1.sei-apis.com).
  - Neither needs touching.

Out of scope:
  - The arctic-1 archive-bootstrap panic on `whitelisted_codehashes_bank_send`
    is a separate binary-version mismatch, not a sei-config drift.

Refs: #20

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Companion to the previous commit replacing chains/atlantic-2/genesis.json
with the live-chain-matching version. The genesis_time in the new file is
2023-02-24T01:00:00Z; the ChainInfo hardcoded entry was still pointing at
2023-02-22T23:45:12.575885043Z, which was the genesis_time of the old
(structurally wrong) sei-config copy.

TestGenesisForChain_KnownChains now passes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented May 24, 2026

PR Summary

Medium Risk
Swaps launch genesis for a production testnet chain, which affects archive/from-genesis bootstrap correctness but not typical state-sync nodes; metadata must stay in sync with the embedded file.

Overview
Replaces the embedded atlantic-2 launch genesis with the version that matches live testnet and upstream chain-configs (17 validators, corrected accounts/balances, plus the required app_state.params block for v6.4.1+ cold-start). Updates chains.go so atlantic-2’s ChainInfo.GenesisTime is 2023-02-24T01:00:00.000000000Z, aligning KnownChain metadata with the new genesis.json and fixing TestGenesisForChain_KnownChains.

pacific-1 and arctic-1 are unchanged.

Reviewed by Cursor Bugbot for commit d7bdbf6. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant