Skip to content

Commit

Permalink
Merge pull request ethereum#233 from ethereum-optimism/seb/ecotone-ov…
Browse files Browse the repository at this point in the history
…erride

all: Add Ecotone override flag
  • Loading branch information
sebastianst authored Jan 31, 2024
2 parents 05786fd + 5eab46c commit ea3c304
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 3 deletions.
5 changes: 5 additions & 0 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
cfg.Eth.OverrideOptimismCanyon = &v
}

if ctx.IsSet(utils.OverrideOptimismEcotone.Name) {
v := ctx.Uint64(utils.OverrideOptimismEcotone.Name)
cfg.Eth.OverrideOptimismEcotone = &v
}

if ctx.IsSet(utils.OverrideOptimismInterop.Name) {
v := ctx.Uint64(utils.OverrideOptimismInterop.Name)
cfg.Eth.OverrideOptimismInterop = &v
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ var (
utils.OverrideCancun,
utils.OverrideVerkle,
utils.OverrideOptimismCanyon,
utils.OverrideOptimismEcotone,
utils.OverrideOptimismInterop,
utils.EnablePersonal,
utils.TxPoolLocalsFlag,
Expand Down
4 changes: 2 additions & 2 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ var (
Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOptimismCanyon = &flags.BigFlag{
OverrideOptimismCanyon = &cli.Uint64Flag{
Name: "override.canyon",
Usage: "Manually specify the Optimism Canyon fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideOptimismEcotone = &flags.BigFlag{
OverrideOptimismEcotone = &cli.Uint64Flag{
Name: "override.ecotone",
Usage: "Manually specify the Optimism Ecotone fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
Expand Down
5 changes: 5 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ type ChainOverrides struct {
OverrideVerkle *uint64
// optimism
OverrideOptimismCanyon *uint64
OverrideOptimismEcotone *uint64
ApplySuperchainUpgrades bool
OverrideOptimismInterop *uint64
}
Expand Down Expand Up @@ -319,6 +320,10 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
config.Optimism.EIP1559DenominatorCanyon = 250
}
}
if overrides != nil && overrides.OverrideOptimismEcotone != nil {
config.EcotoneTime = overrides.OverrideOptimismEcotone
config.CancunTime = overrides.OverrideOptimismEcotone
}
if overrides != nil && overrides.OverrideOptimismInterop != nil {
config.InteropTime = overrides.OverrideOptimismInterop
}
Expand Down
5 changes: 4 additions & 1 deletion eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
nodeCloser: stack.Close,
}
bcVersion := rawdb.ReadDatabaseVersion(chainDb)
var dbVer = "<nil>"
dbVer := "<nil>"
if bcVersion != nil {
dbVer = fmt.Sprintf("%d", *bcVersion)
}
Expand Down Expand Up @@ -223,6 +223,9 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
if config.OverrideOptimismCanyon != nil {
overrides.OverrideOptimismCanyon = config.OverrideOptimismCanyon
}
if config.OverrideOptimismEcotone != nil {
overrides.OverrideOptimismEcotone = config.OverrideOptimismEcotone
}
if config.OverrideOptimismInterop != nil {
overrides.OverrideOptimismInterop = config.OverrideOptimismInterop
}
Expand Down
2 changes: 2 additions & 0 deletions eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ type Config struct {

OverrideOptimismCanyon *uint64 `toml:",omitempty"`

OverrideOptimismEcotone *uint64 `toml:",omitempty"`

OverrideOptimismInterop *uint64 `toml:",omitempty"`

// ApplySuperchainUpgrades requests the node to load chain-configuration from the superchain-registry.
Expand Down
12 changes: 12 additions & 0 deletions eth/ethconfig/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea3c304

Please sign in to comment.