Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
feat(devnet): removes genesis hash computation
Browse files Browse the repository at this point in the history
Using a singleton that retreives it from the RSK node
  • Loading branch information
jurajpiar committed Feb 16, 2024
1 parent e6a23af commit 0961f6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions op-chain-ops/genesis/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rsk_utils"

"github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
Expand Down Expand Up @@ -534,7 +535,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas
return &rollup.Config{
Genesis: rollup.Genesis{
L1: eth.BlockID{
Hash: l1StartBlock.Hash(),
Hash: rsk_utils.GetRskBlockHeader().Hash(),
Number: l1StartBlock.NumberU64(),
},
L2: eth.BlockID{
Expand Down Expand Up @@ -842,7 +843,7 @@ func NewL2StorageConfig(config *DeployConfig, block *types.Block) (state.Storage
"number": block.Number(),
"timestamp": block.Time(),
"basefee": big.NewInt(1), //block.BaseFee(),
"hash": block.Hash(),
"hash": rsk_utils.GetRskBlockHeader(),
"sequenceNumber": 0,
"batcherHash": eth.AddressAsLeftPaddedHash(config.BatchSenderAddress),
"l1FeeOverhead": config.GasPriceOracleOverhead,
Expand Down
4 changes: 3 additions & 1 deletion op-node/cmd/genesis/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rsk_utils"

"github.com/ethereum-optimism/optimism/op-bindings/hardhat"
"github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
Expand Down Expand Up @@ -232,7 +233,8 @@ var Subcommands = cli.Commands{
return err
}

log.Info("Using L1 Start Block", "number", l1StartBlock.Number(), "hash", l1StartBlock.Hash().Hex())
rskHeader := rsk_utils.GetRskBlockHeader()
log.Info("Using L1 Start Block", "number", l1StartBlock.Number(), "hash", rskHeader.Hash().Hex())

// Build the L2 genesis block
l2Genesis, err := genesis.BuildL2Genesis(config, l1StartBlock)
Expand Down
1 change: 1 addition & 0 deletions ops-bedrock/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ services:
--metrics.port=7300
--pprof.enabled
--rpc.enable-admin
--l1.trustrpc
ports:
- "7545:8545"
- "9003:9003"
Expand Down

0 comments on commit 0961f6f

Please sign in to comment.