diff --git a/op-node/rollup/types.go b/op-node/rollup/types.go index 2726fd6b4db7c..b35da90649c77 100644 --- a/op-node/rollup/types.go +++ b/op-node/rollup/types.go @@ -9,13 +9,12 @@ import ( "math/big" "time" + altda "github.com/ethereum-optimism/optimism/op-alt-da" + "github.com/ethereum-optimism/optimism/op-service/eth" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/params" - - altda "github.com/ethereum-optimism/optimism/op-alt-da" - "github.com/ethereum-optimism/optimism/op-service/eth" ) var ( @@ -661,15 +660,9 @@ func (c *Config) Description(l2Chains map[string]string) string { banner += fmt.Sprintf(" L1 block: %s %d\n", c.Genesis.L1.Hash, c.Genesis.L1.Number) // Report the upgrade configuration banner += "Post-Bedrock Network Upgrades (timestamp based):\n" - banner += fmt.Sprintf(" - Regolith: %s\n", fmtForkTimeOrUnset(c.RegolithTime)) - banner += fmt.Sprintf(" - Canyon: %s\n", fmtForkTimeOrUnset(c.CanyonTime)) - banner += fmt.Sprintf(" - Delta: %s\n", fmtForkTimeOrUnset(c.DeltaTime)) - banner += fmt.Sprintf(" - Ecotone: %s\n", fmtForkTimeOrUnset(c.EcotoneTime)) - banner += fmt.Sprintf(" - Fjord: %s\n", fmtForkTimeOrUnset(c.FjordTime)) - banner += fmt.Sprintf(" - Granite: %s\n", fmtForkTimeOrUnset(c.GraniteTime)) - banner += fmt.Sprintf(" - Holocene: %s\n", fmtForkTimeOrUnset(c.HoloceneTime)) - banner += fmt.Sprintf(" - Isthmus: %s\n", fmtForkTimeOrUnset(c.IsthmusTime)) - banner += fmt.Sprintf(" - Interop: %s\n", fmtForkTimeOrUnset(c.InteropTime)) + c.forEachFork(func(name string, _ string, time *uint64) { + banner += fmt.Sprintf(" - %v: %s\n", name, fmtForkTimeOrUnset(time)) + }) // Report the protocol version banner += fmt.Sprintf("Node supports up to OP-Stack Protocol Version: %s\n", OPStackSupport) if c.AltDAConfig != nil { @@ -696,19 +689,19 @@ func (c *Config) LogDescription(log log.Logger, l2Chains map[string]string) { } ctx := []any{ - "l2_chain_id", c.L2ChainID, "l2_network", networkL2, "l1_chain_id", c.L1ChainID, - "l1_network", networkL1, "l2_start_time", c.Genesis.L2Time, "l2_block_hash", c.Genesis.L2.Hash.String(), - "l2_block_number", c.Genesis.L2.Number, "l1_block_hash", c.Genesis.L1.Hash.String(), - "l1_block_number", c.Genesis.L1.Number, "regolith_time", fmtForkTimeOrUnset(c.RegolithTime), - "canyon_time", fmtForkTimeOrUnset(c.CanyonTime), - "delta_time", fmtForkTimeOrUnset(c.DeltaTime), - "ecotone_time", fmtForkTimeOrUnset(c.EcotoneTime), - "fjord_time", fmtForkTimeOrUnset(c.FjordTime), - "granite_time", fmtForkTimeOrUnset(c.GraniteTime), - "holocene_time", fmtForkTimeOrUnset(c.HoloceneTime), - "isthmus_time", fmtForkTimeOrUnset(c.IsthmusTime), - "interop_time", fmtForkTimeOrUnset(c.InteropTime), - } + "l2_chain_id", c.L2ChainID, + "l2_network", networkL2, + "l1_chain_id", c.L1ChainID, + "l1_network", networkL1, + "l2_start_time", c.Genesis.L2Time, + "l2_block_hash", c.Genesis.L2.Hash.String(), + "l2_block_number", c.Genesis.L2.Number, + "l1_block_hash", c.Genesis.L1.Hash.String(), + "l1_block_number", c.Genesis.L1.Number, + } + c.forEachFork(func(_ string, logName string, time *uint64) { + ctx = append(ctx, logName, fmtForkTimeOrUnset(time)) + }) if c.AltDAConfig != nil { ctx = append(ctx, "alt_da", *c.AltDAConfig) } @@ -719,6 +712,22 @@ func (c *Config) LogDescription(log log.Logger, l2Chains map[string]string) { log.Info("Rollup Config", ctx...) } +func (c *Config) forEachFork(callback func(name string, logName string, time *uint64)) { + callback("Regolith", "regolith_time", c.RegolithTime) + callback("Canyon", "canyon_time", c.CanyonTime) + callback("Delta", "delta_time", c.DeltaTime) + callback("Ecotone", "ecotone_time", c.EcotoneTime) + callback("Fjord", "fjord_time", c.FjordTime) + callback("Granite", "granite_time", c.GraniteTime) + callback("Holocene", "holocene_time", c.HoloceneTime) + if c.PectraBlobScheduleTime != nil { + // only report if config is set + callback("Pectra Blob Schedule", "pectra_blob_schedule_time", c.PectraBlobScheduleTime) + } + callback("Isthmus", "isthmus_time", c.IsthmusTime) + callback("Interop", "interop_time", c.InteropTime) +} + func (c *Config) ParseRollupConfig(in io.Reader) error { dec := json.NewDecoder(in) dec.DisallowUnknownFields()