diff --git a/go.mod b/go.mod index 897ea5638e6c4..08f7309c38f23 100644 --- a/go.mod +++ b/go.mod @@ -275,7 +275,7 @@ require ( rsc.io/tmplfunc v0.0.3 // indirect ) -replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101411.1-0.20250522123759-d899ed692354 +replace github.com/ethereum/go-ethereum => github.com/celo-org/op-geth v1.101411.1-0.20250604093504-9074dd26d0a8 //replace github.com/ethereum/go-ethereum => ../op-geth diff --git a/go.sum b/go.sum index a12f3c239cafa..219d233d4b4bb 100644 --- a/go.sum +++ b/go.sum @@ -86,8 +86,8 @@ github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= -github.com/celo-org/op-geth v1.101411.1-0.20250522123759-d899ed692354 h1:9e2RYqDMoE3d124hyEA2c7DfnlZwXytoP9jZ/YQ6Omg= -github.com/celo-org/op-geth v1.101411.1-0.20250522123759-d899ed692354/go.mod h1:Ti5NReEoY9vwgJs47kdWjgQDApGMRLk7bpBSgxKYVlA= +github.com/celo-org/op-geth v1.101411.1-0.20250604093504-9074dd26d0a8 h1:9PKBVXOwJUHJ2M096nVom4rELVaAZZrVhQvl5mwre7Q= +github.com/celo-org/op-geth v1.101411.1-0.20250604093504-9074dd26d0a8/go.mod h1:Ti5NReEoY9vwgJs47kdWjgQDApGMRLk7bpBSgxKYVlA= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cespare/cp v0.1.0 h1:SE+dxFebS7Iik5LK0tsi1k9ZCxEaFX4AjQmoyA+1dJk= diff --git a/op-node/service.go b/op-node/service.go index ee589dc2ebd92..99803b4525efa 100644 --- a/op-node/service.go +++ b/op-node/service.go @@ -10,6 +10,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/params" "github.com/urfave/cli/v2" altda "github.com/ethereum-optimism/optimism/op-alt-da" @@ -212,6 +213,7 @@ func NewRollupConfigFromCLI(log log.Logger, ctx *cli.Context) (*rollup.Config, e if err != nil { return nil, err } + applyCeloHardforks(rollupConfig) applyOverrides(ctx, rollupConfig) return rollupConfig, nil } @@ -285,6 +287,31 @@ func applyOverrides(ctx *cli.Context, rollupConfig *rollup.Config) { } } +// applyCeloHardforks modifies the rollupConfig to apply Celo-specific hardforks. +// This code is a shortcut and the proper config should be added to the superchain registry. +// See https://github.com/celo-org/op-geth/issues/389 +func applyCeloHardforks(rollupConfig *rollup.Config) { + switch rollupConfig.L2ChainID.Uint64() { + case params.CeloMainnetChainID: + activationTime := params.CeloMainnetIsthmusTimestamp + rollupConfig.HoloceneTime = &activationTime + rollupConfig.IsthmusTime = &activationTime + rollupConfig.PectraBlobScheduleTime = &activationTime + case params.CeloAlfajoresChainID: + activationTime := params.AlfajoresIsthmusTimestamp + rollupConfig.HoloceneTime = &activationTime + rollupConfig.IsthmusTime = &activationTime + rollupConfig.PectraBlobScheduleTime = &activationTime + case params.CeloBaklavaChainID: + activationTime := params.BaklavaIsthmusTimestamp + rollupConfig.HoloceneTime = &activationTime + rollupConfig.IsthmusTime = &activationTime + rollupConfig.PectraBlobScheduleTime = &activationTime + default: + // No Celo hardforks for other chains, do nothing. + } +} + func NewSyncConfig(ctx *cli.Context, log log.Logger) (*sync.Config, error) { if ctx.IsSet(flags.L2EngineSyncEnabled.Name) && ctx.IsSet(flags.SyncModeFlag.Name) { return nil, errors.New("cannot set both --l2.engine-sync and --syncmode at the same time")