Defines the framework for chain migration and regenesis operations on Lux Network. Regenesis creates a new genesis block from the state of an existing chain at a specified block height, producing a clean chain with full state continuity but no historical block data. This is used for chain upgrades that require breaking changes, state tree compaction, and disaster recovery.
1. Announce regenesis at block height H (governance proposal, 30-day notice)
2. At height H, all validators halt block production
3. Export state trie at height H: accounts, balances, code, storage
4. Generate new genesis.json from exported state
5. Validators initialize new chain from new genesis
6. New chain starts at block 0 with state identical to old chain at height H
7. Old chain is archived (read-only) for historical queries
The state export tool extracts:
type RegenesisConfig struct {
SourceChainRPC string // RPC endpoint of source chain
ExportHeight uint64 // Block height to export
NetworkID uint32 // Target network ID
ChainID uint64 // Target chain ID
Timestamp uint64 // New genesis timestamp
GasLimit uint64 // Initial gas limit
}
The tool reads state at ExportHeight and produces a genesis.json compatible with Lux node initialization.
During compaction regenesis, accounts below the dust threshold are excluded:
The old chain state is preserved on archive nodes for historical queries. Archive nodes serve read-only RPC for block heights 0 through H.
1. Regenesis requires 100% validator coordination. A single validator running the old chain creates a fork.
2. The 30-day notice period allows users and services to prepare for the migration.
3. State export must be verified independently by multiple validators. Hash of exported state must match.
4. Contract addresses are preserved. No user action required -- wallets, contracts, and integrations continue working at the same addresses.
5. Historical transaction proofs (Merkle proofs against old blocks) become invalid after regenesis. Archive nodes maintain the old proof chain.
github.com/luxfi/node/tools/regenesis/ |github.com/luxfi/node/tools/stateexport/ |github.com/luxfi/genesis/ |Copyright (C) 2025-2026, Lux Partners Limited. All rights reserved.
Licensed under the MIT License.