espresso-sequencer
espresso-sequencer copied to clipboard
Genesis block
We should have a genesis block which identifies the chain and related information, including:
- Chain ID
- Fork ID (so the genesis block changes if we reset a testnet)
- Timestamp?
- Contract address
I don't think we need any special support from HotShot for this, once we have instance state. Here is how I propose to implement it:
- Make chain ID, fork ID, contract address, and genesis timestamp command line arguments (can't sample timestamp because we need all the nodes to agree)
- Make all of these fields of instance level state
- Add a
Genesisstruct with these fields, addOption<Genesis>toHeader - In
Header::genesis(), pull these fields out of instance and set thegenesisfield toSome - In header validation, ensure
genesisfield is alwaysNoneon the new proposal
Once we have a genesis block with a unique hash (because the chain ID is unique, and probably the timestamp to), we should start putting the genesis block hash in the headers and validated state. This accomplishes two things:
- Prevents cross-chain replay attacks against builders signing blocks (consider that we will eventually have a testnet and mainnet running at the same time, with some of the same builders participating in each)
- Makes it easy to fetch the full genesis block and authenticate it against any committed header