Skip to content
This repository was archived by the owner on Apr 17, 2026. It is now read-only.

feat: add block_height/chain_id to backup + genesis-assemble cmd#70

Draft
moul wants to merge 2 commits into
mainfrom
moul/chain-upgrade-export
Draft

feat: add block_height/chain_id to backup + genesis-assemble cmd#70
moul wants to merge 2 commits into
mainfrom
moul/chain-upgrade-export

Conversation

@moul
Copy link
Copy Markdown
Member

@moul moul commented Mar 30, 2026

Summary

  • Backup: populates BlockHeight and ChainID in GnoTxMetadata during tx backup. Chain ID is fetched once from node status RPC at backup start.
  • New command: genesis-assemble reads a JSONL tx export and assembles a genesis.json with txs in app_state.txs
    • --input: JSONL file path
    • --output: genesis.json output path
    • --chain-id: new chain ID
    • --initial-height: starting block height (default: inferred from max block_height + 1)
    • --genesis-template: optional base genesis.json to merge into

Context

Part of the chain upgrade (gnoland1 → gnoland-1) tx export/import pipeline.

Depends on: gnolang/gno PR extending GnoTxMetadata with BlockHeight and ChainID fields (go.mod update needed once that merges).

Note: GenesisDoc.InitialHeight doesn't exist yet in tm2 — Jae is working on that. The genesis-assemble command computes and logs the value, ready to set once the field is available.

Related: gnolang/gno#5334, gnolang/gno#5368, gnolang/gno#5376, gnolang/gno#5377

Test plan

  • Update gno dependency after companion PR merges (#5390)
  • Run backup against test node, verify JSONL contains block_height and chain_id
  • Run genesis-assemble on exported JSONL, verify genesis.json structure
  • Start node from assembled genesis, verify txs replay correctly

AI-assisted: code generated with Claude Code

moul added 2 commits March 30, 2026 09:49
Populate BlockHeight and ChainID in GnoTxMetadata during backup.
ChainID is fetched once from the node status RPC at backup start.
BlockHeight comes from the block being processed.

Supports the chain upgrade tx export workflow.
New subcommand that reads a JSONL tx export and assembles a genesis.json
with the transactions in app_state.txs. Supports:
- --input: JSONL file path
- --output: genesis.json output path
- --chain-id: new chain ID
- --initial-height: starting block height (default: inferred from max block_height + 1)
- --genesis-template: optional base genesis.json to merge into

Part of the chain upgrade (gnoland1 → gnoland-1) export pipeline.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant