Commit e8a79312 authored by Mark Tyneway's avatar Mark Tyneway Committed by GitHub

op-chain-ops: allow ecotone at genesis (#9627)

Adds the cancun specific changes to the genesis block.
Cancun is coupled to ecotone so using `IsEcotone` to
see if the fields should be added to the genesis.
Is it a bad assumption to assume that cancun execution
is coupled to ecotone optimism network upgrade?
parent 7fde7201
......@@ -97,7 +97,7 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
return nil, fmt.Errorf("transition block extradata too long: %d", size)
}
return &core.Genesis{
genesis := &core.Genesis{
Config: &optimismChainConfig,
Nonce: uint64(config.L2GenesisBlockNonce),
Timestamp: block.Time(),
......@@ -111,7 +111,14 @@ func NewL2Genesis(config *DeployConfig, block *types.Block) (*core.Genesis, erro
ParentHash: config.L2GenesisBlockParentHash,
BaseFee: baseFee.ToInt(),
Alloc: map[common.Address]core.GenesisAccount{},
}, nil
}
if optimismChainConfig.IsEcotone(genesis.Timestamp) {
genesis.BlobGasUsed = u64ptr(0)
genesis.ExcessBlobGas = u64ptr(0)
}
return genesis, nil
}
// NewL1Genesis will create a new L1 genesis config
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment