Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,8 @@ func (d *DeployConfig) WrightTime(genesisTime uint64) *uint64 {

// RollupConfig converts a DeployConfig to a rollup.Config. If Ecotone is active at genesis, the
// Overhead value is considered a noop.
func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHash common.Hash, l2GenesisBlockNumber uint64) (*rollup.Config, error) {
func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHash common.Hash, l2GenesisBlockNumber uint64,
l2GenesisStateRoot common.Hash) (*rollup.Config, error) {
if d.OptimismPortalProxy == (common.Address{}) {
return nil, errors.New("OptimismPortalProxy cannot be address(0)")
}
Expand Down Expand Up @@ -728,6 +729,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
Scalar: eth.Bytes32(d.FeeScalar()),
GasLimit: uint64(d.L2GenesisBlockGasLimit),
},
L2GenesisStateRoot: l2GenesisStateRoot,
},
BlockTime: d.L2BlockTime,
MaxSequencerDrift: d.MaxSequencerDrift,
Expand Down
3 changes: 2 additions & 1 deletion op-e2e/op_geth.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ func NewOpGeth(t testing.TB, ctx context.Context, cfg *SystemConfig) (*OpGeth, e
require.NoError(t, err)

// Finally create the engine client
rollupCfg, err := cfg.DeployConfig.RollupConfig(l1Block, l2GenesisBlock.Hash(), l2GenesisBlock.NumberU64())
rollupCfg, err := cfg.DeployConfig.RollupConfig(l1Block, l2GenesisBlock.Hash(), l2GenesisBlock.NumberU64(),
l2GenesisBlock.Header().Root)
require.NoError(t, err)
rollupCfg.Genesis = rollupGenesis
l2Engine, err := sources.NewEngineClient(
Expand Down
3 changes: 2 additions & 1 deletion op-node/cmd/genesis/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ var Subcommands = cli.Commands{
}

l2GenesisBlock := l2Genesis.ToBlock()
rollupConfig, err := config.RollupConfig(l1StartBlock, l2GenesisBlock.Hash(), l2GenesisBlock.Number().Uint64())
rollupConfig, err := config.RollupConfig(l1StartBlock, l2GenesisBlock.Hash(), l2GenesisBlock.Number().Uint64(),
l2GenesisBlock.Header().Root)
if err != nil {
return err
}
Expand Down
2 changes: 2 additions & 0 deletions op-node/rollup/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ type Genesis struct {
// The L2 genesis block may not include transactions, and thus cannot encode the config values,
// unlike later L2 blocks.
SystemConfig eth.SystemConfig `json:"system_config"`
// The genesis state root of L2 genesis block
L2GenesisStateRoot common.Hash `json:"l2_genesis_state_root,omitempty"`
}

type PlasmaConfig struct {
Expand Down
Loading