diff --git a/op-chain-ops/genesis/config.go b/op-chain-ops/genesis/config.go index 9ff847b421..6beb612f7b 100644 --- a/op-chain-ops/genesis/config.go +++ b/op-chain-ops/genesis/config.go @@ -225,6 +225,9 @@ type DeployConfig struct { FundDevAccounts bool `json:"fundDevAccounts"` // opBNB fermat hard fork Fermat *big.Int `json:"fermat,omitempty"` + // SnowTimeOffset is the number of seconds after genesis block that snow hard fork activates. + // Set it to 0 to activate at genesis. Nil to disable snow fork. + SnowTimeOffset *hexutil.Uint64 `json:"snowTimeOffset,omitempty"` // RequiredProtocolVersion indicates the protocol version that // nodes are required to adopt, to stay in sync with the network. RequiredProtocolVersion params.ProtocolVersion `json:"requiredProtocolVersion"` @@ -553,6 +556,17 @@ func (d *DeployConfig) InteropTime(genesisTime uint64) *uint64 { return &v } +func (d *DeployConfig) SnowTime(genesisTime uint64) *uint64 { + if d.SnowTimeOffset == nil { + return nil + } + v := uint64(0) + if offset := *d.SnowTimeOffset; offset > 0 { + v = genesisTime + uint64(offset) + } + return &v +} + // RollupConfig converts a DeployConfig to a rollup.Config func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHash common.Hash, l2GenesisBlockNumber uint64) (*rollup.Config, error) { if d.OptimismPortalProxy == (common.Address{}) { @@ -600,6 +614,7 @@ func (d *DeployConfig) RollupConfig(l1StartBlock *types.Block, l2GenesisBlockHas DAChallengeWindow: d.DAChallengeWindow, DAResolveWindow: d.DAResolveWindow, Fermat: d.Fermat, + SnowTime: d.SnowTime(l1StartBlock.Time()), }, nil } diff --git a/packages/contracts-bedrock/scripts/getting-started/config.sh b/packages/contracts-bedrock/scripts/getting-started/config.sh index 95ab527d60..bff35378fc 100755 --- a/packages/contracts-bedrock/scripts/getting-started/config.sh +++ b/packages/contracts-bedrock/scripts/getting-started/config.sh @@ -23,23 +23,24 @@ reqenv "L1_RPC_URL" block=$(cast block finalized --rpc-url "$L1_RPC_URL") timestamp=$(echo "$block" | awk '/timestamp/ { print $2 }') blockhash=$(echo "$block" | awk '/hash/ { print $2 }') +l1chainId=$(cast chain-id --rpc-url "$L1_RPC_URL") # Generate the config file config=$(cat << EOL { "l1StartingBlockTag": "$blockhash", - "l1ChainID": 11155111, - "l2ChainID": 42069, - "l2BlockTime": 2, - "l1BlockTime": 12, + "l1ChainID": $l1chainId, + "l2ChainID": 901, + "l2BlockTime": 1, + "l1BlockTime": 3, "maxSequencerDrift": 600, "sequencerWindowSize": 3600, "channelTimeout": 300, "p2pSequencerAddress": "$GS_SEQUENCER_ADDRESS", - "batchInboxAddress": "0xff00000000000000000000000000000000042069", + "batchInboxAddress": "0xff00000000000000000000000000000000000901", "batchSenderAddress": "$GS_BATCHER_ADDRESS", "l2OutputOracleSubmissionInterval": 120, @@ -98,6 +99,19 @@ config=$(cat << EOL "preimageOracleMinProposalSize": 1800000, "preimageOracleChallengePeriod": 86400, + "fermat": 0, + "snowTimeOffset": "0x0", + "fundDevAccounts": true, + "proofMaturityDelaySeconds": 12, + "disputeGameFinalityDelaySeconds": 6, + "respectedGameType": 0, + "useFaultProofs": false, + "usePlasma": false, + "daChallengeWindow": 160, + "daResolveWindow": 160, + "daBondSize": 1000000, + "daResolverRefundPercentage": 0, + "faultGameWithdrawalDelay": 604800 } EOL )