diff --git a/cmd/geth/config.go b/cmd/geth/config.go index 75ece99546..714a28776e 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -189,9 +189,9 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) { cfg.Eth.OverrideOptimismFjord = &v } - if ctx.IsSet(utils.OverrideOptimismLibplanetVn1.Name) { - v := ctx.Uint64(utils.OverrideOptimismLibplanetVn1.Name) - cfg.Eth.OverrideOptimismLibplanetVn1 = &v + if ctx.IsSet(utils.OverrideOptimismLibplanet.Name) { + v := ctx.Uint64(utils.OverrideOptimismLibplanet.Name) + cfg.Eth.OverrideOptimismLibplanet = &v } if ctx.IsSet(utils.OverrideOptimismInterop.Name) { diff --git a/cmd/geth/main.go b/cmd/geth/main.go index eb8de6dda6..50d601b86f 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -70,7 +70,7 @@ var ( utils.OverrideOptimismCanyon, utils.OverrideOptimismEcotone, utils.OverrideOptimismFjord, - utils.OverrideOptimismLibplanetVn1, + utils.OverrideOptimismLibplanet, utils.OverrideOptimismInterop, utils.EnablePersonal, utils.TxPoolLocalsFlag, diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 3ca727c7b5..4505fe99ac 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -276,9 +276,9 @@ var ( Usage: "Manually specify the Optimism Fjord fork timestamp, overriding the bundled setting", Category: flags.EthCategory, } - OverrideOptimismLibplanetVn1 = &cli.Uint64Flag{ - Name: "override.libplanetVn1", - Usage: "Manually specify the Optimism LibplanetVn1 fork timestamp, overriding the bundled setting", + OverrideOptimismLibplanet = &cli.Uint64Flag{ + Name: "override.libplanet", + Usage: "Manually specify the Optimism Libplanet fork timestamp, overriding the bundled setting", Category: flags.EthCategory, } OverrideOptimismInterop = &cli.Uint64Flag{ diff --git a/core/genesis.go b/core/genesis.go index f4294b9dae..77b28296e1 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -222,12 +222,12 @@ type ChainOverrides struct { OverrideCancun *uint64 OverrideVerkle *uint64 // optimism - OverrideOptimismCanyon *uint64 - OverrideOptimismEcotone *uint64 - OverrideOptimismFjord *uint64 - OverrideOptimismLibplanetVn1 *uint64 - ApplySuperchainUpgrades bool - OverrideOptimismInterop *uint64 + OverrideOptimismCanyon *uint64 + OverrideOptimismEcotone *uint64 + OverrideOptimismFjord *uint64 + OverrideOptimismLibplanet *uint64 + ApplySuperchainUpgrades bool + OverrideOptimismInterop *uint64 } // SetupGenesisBlock writes or updates the genesis block in db. @@ -294,8 +294,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g if overrides != nil && overrides.OverrideOptimismFjord != nil { config.FjordTime = overrides.OverrideOptimismFjord } - if overrides != nil && overrides.OverrideOptimismLibplanetVn1 != nil { - config.LibplanetVn1Time = overrides.OverrideOptimismLibplanetVn1 + if overrides != nil && overrides.OverrideOptimismLibplanet != nil { + config.LibplanetTime = overrides.OverrideOptimismLibplanet } if overrides != nil && overrides.OverrideOptimismInterop != nil { config.InteropTime = overrides.OverrideOptimismInterop diff --git a/core/vm/contracts.go b/core/vm/contracts.go index ecb063a808..5bdcb95217 100644 --- a/core/vm/contracts.go +++ b/core/vm/contracts.go @@ -128,9 +128,9 @@ var PrecompiledContractsFjord = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{0x01, 0x00}): &p256Verify{}, } -// PrecompiledContractsLibplanetVn1 contains the default set of pre-compiled Ethereum -// contracts used in the LibplanetVn1 release. -var PrecompiledContractsLibplanetVn1 = map[common.Address]PrecompiledContract{ +// PrecompiledContractsLibplanet contains the default set of pre-compiled Ethereum +// contracts used in the Libplanet release. +var PrecompiledContractsLibplanet = map[common.Address]PrecompiledContract{ common.BytesToAddress([]byte{1}): &ecrecover{}, common.BytesToAddress([]byte{2}): &sha256hash{}, common.BytesToAddress([]byte{3}): &ripemd160hash{}, @@ -161,13 +161,13 @@ var PrecompiledContractsBLS = map[common.Address]PrecompiledContract{ } var ( - PrecompiledAddressesLibplanetVn1 []common.Address - PrecompiledAddressesFjord []common.Address - PrecompiledAddressesCancun []common.Address - PrecompiledAddressesBerlin []common.Address - PrecompiledAddressesIstanbul []common.Address - PrecompiledAddressesByzantium []common.Address - PrecompiledAddressesHomestead []common.Address + PrecompiledAddressesLibplanet []common.Address + PrecompiledAddressesFjord []common.Address + PrecompiledAddressesCancun []common.Address + PrecompiledAddressesBerlin []common.Address + PrecompiledAddressesIstanbul []common.Address + PrecompiledAddressesByzantium []common.Address + PrecompiledAddressesHomestead []common.Address ) func init() { @@ -189,16 +189,16 @@ func init() { for k := range PrecompiledContractsFjord { PrecompiledAddressesFjord = append(PrecompiledAddressesFjord, k) } - for k := range PrecompiledContractsLibplanetVn1 { - PrecompiledAddressesLibplanetVn1 = append(PrecompiledAddressesLibplanetVn1, k) + for k := range PrecompiledContractsLibplanet { + PrecompiledAddressesLibplanet = append(PrecompiledAddressesLibplanet, k) } } // ActivePrecompiles returns the precompiles enabled with the current configuration. func ActivePrecompiles(rules params.Rules) []common.Address { switch { - case rules.IsOptimismLibplanetVn1: - return PrecompiledAddressesLibplanetVn1 + case rules.IsOptimismLibplanet: + return PrecompiledAddressesLibplanet case rules.IsOptimismFjord: return PrecompiledAddressesFjord case rules.IsCancun: diff --git a/core/vm/evm.go b/core/vm/evm.go index 2c398aabba..187045d57b 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -41,8 +41,8 @@ type ( func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) { var precompiles map[common.Address]PrecompiledContract switch { - case evm.chainRules.IsOptimismLibplanetVn1: - precompiles = PrecompiledContractsLibplanetVn1 + case evm.chainRules.IsOptimismLibplanet: + precompiles = PrecompiledContractsLibplanet case evm.chainRules.IsOptimismFjord: precompiles = PrecompiledContractsFjord case evm.chainRules.IsCancun: diff --git a/eth/backend.go b/eth/backend.go index 0d71e66c02..02c43ce91b 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -229,8 +229,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) { if config.OverrideOptimismFjord != nil { overrides.OverrideOptimismFjord = config.OverrideOptimismFjord } - if config.OverrideOptimismLibplanetVn1 != nil { - overrides.OverrideOptimismLibplanetVn1 = config.OverrideOptimismLibplanetVn1 + if config.OverrideOptimismLibplanet != nil { + overrides.OverrideOptimismLibplanet = config.OverrideOptimismLibplanet } if config.OverrideOptimismInterop != nil { overrides.OverrideOptimismInterop = config.OverrideOptimismInterop diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index bebdd2b8e4..123ff3fa85 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -167,7 +167,7 @@ type Config struct { OverrideOptimismFjord *uint64 `toml:",omitempty"` - OverrideOptimismLibplanetVn1 *uint64 `toml:",omitempty"` + OverrideOptimismLibplanet *uint64 `toml:",omitempty"` OverrideOptimismInterop *uint64 `toml:",omitempty"` diff --git a/eth/ethconfig/gen_config.go b/eth/ethconfig/gen_config.go index 0b450d498c..44bffe0abb 100644 --- a/eth/ethconfig/gen_config.go +++ b/eth/ethconfig/gen_config.go @@ -59,7 +59,7 @@ func (c Config) MarshalTOML() (interface{}, error) { OverrideOptimismCanyon *uint64 `toml:",omitempty"` OverrideOptimismEcotone *uint64 `toml:",omitempty"` OverrideOptimismFjord *uint64 `toml:",omitempty"` - OverrideOptimismLibplanetVn1 *uint64 `toml:",omitempty"` + OverrideOptimismLibplanet *uint64 `toml:",omitempty"` OverrideOptimismInterop *uint64 `toml:",omitempty"` ApplySuperchainUpgrades bool `toml:",omitempty"` RollupSequencerHTTP string @@ -112,7 +112,7 @@ func (c Config) MarshalTOML() (interface{}, error) { enc.OverrideOptimismCanyon = c.OverrideOptimismCanyon enc.OverrideOptimismEcotone = c.OverrideOptimismEcotone enc.OverrideOptimismFjord = c.OverrideOptimismFjord - enc.OverrideOptimismLibplanetVn1 = c.OverrideOptimismLibplanetVn1 + enc.OverrideOptimismLibplanet = c.OverrideOptimismLibplanet enc.OverrideOptimismInterop = c.OverrideOptimismInterop enc.ApplySuperchainUpgrades = c.ApplySuperchainUpgrades enc.RollupSequencerHTTP = c.RollupSequencerHTTP @@ -169,7 +169,7 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { OverrideOptimismCanyon *uint64 `toml:",omitempty"` OverrideOptimismEcotone *uint64 `toml:",omitempty"` OverrideOptimismFjord *uint64 `toml:",omitempty"` - OverrideOptimismLibplanetVn1 *uint64 `toml:",omitempty"` + OverrideOptimismLibplanet *uint64 `toml:",omitempty"` OverrideOptimismInterop *uint64 `toml:",omitempty"` ApplySuperchainUpgrades *bool `toml:",omitempty"` RollupSequencerHTTP *string @@ -309,8 +309,8 @@ func (c *Config) UnmarshalTOML(unmarshal func(interface{}) error) error { if dec.OverrideOptimismFjord != nil { c.OverrideOptimismFjord = dec.OverrideOptimismFjord } - if dec.OverrideOptimismLibplanetVn1 != nil { - c.OverrideOptimismLibplanetVn1 = dec.OverrideOptimismLibplanetVn1 + if dec.OverrideOptimismLibplanet != nil { + c.OverrideOptimismLibplanet = dec.OverrideOptimismLibplanet } if dec.OverrideOptimismInterop != nil { c.OverrideOptimismInterop = dec.OverrideOptimismInterop diff --git a/params/config.go b/params/config.go index 4b317abb2d..e2e2b154c9 100644 --- a/params/config.go +++ b/params/config.go @@ -396,7 +396,7 @@ type ChainConfig struct { EcotoneTime *uint64 `json:"ecotoneTime,omitempty"` // Ecotone switch time (nil = no fork, 0 = already on optimism ecotone) FjordTime *uint64 `json:"fjordTime,omitempty"` // Fjord switch time (nil = no fork, 0 = already on Optimism Fjord) - LibplanetVn1Time *uint64 `json:"libplanetVn1Time,omitempty"` // Libplanet switch time (nil = no fork, 0 = already on libplanetVn1) + LibplanetTime *uint64 `json:"libplanetTime,omitempty"` // Libplanet switch time (nil = no fork, 0 = already on libplanet) InteropTime *uint64 `json:"interopTime,omitempty"` // Interop switch time (nil = no fork, 0 = already on optimism interop) @@ -551,8 +551,8 @@ func (c *ChainConfig) Description() string { if c.FjordTime != nil { banner += fmt.Sprintf(" - Fjord: @%-10v\n", *c.FjordTime) } - if c.LibplanetVn1Time != nil { - banner += fmt.Sprintf(" - LibplanetVn1: @%-10v\n", *c.LibplanetVn1Time) + if c.LibplanetTime != nil { + banner += fmt.Sprintf(" - Libplanet: @%-10v\n", *c.LibplanetTime) } if c.InteropTime != nil { banner += fmt.Sprintf(" - Interop: @%-10v\n", *c.InteropTime) @@ -681,8 +681,8 @@ func (c *ChainConfig) IsFjord(time uint64) bool { return isTimestampForked(c.FjordTime, time) } -func (c *ChainConfig) IsLibplanetVn1(time uint64) bool { - return isTimestampForked(c.LibplanetVn1Time, time) +func (c *ChainConfig) IsLibplanet(time uint64) bool { + return isTimestampForked(c.LibplanetTime, time) } func (c *ChainConfig) IsInterop(time uint64) bool { @@ -715,8 +715,8 @@ func (c *ChainConfig) IsOptimismFjord(time uint64) bool { return c.IsOptimism() && c.IsFjord(time) } -func (c *ChainConfig) IsOptimismLibplanetVn1(time uint64) bool { - return c.IsOptimism() && c.IsLibplanetVn1(time) +func (c *ChainConfig) IsOptimismLibplanet(time uint64) bool { + return c.IsOptimism() && c.IsLibplanet(time) } // IsOptimismPreBedrock returns true iff this is an optimism node & bedrock is not yet active @@ -1060,7 +1060,7 @@ type Rules struct { IsVerkle bool IsOptimismBedrock, IsOptimismRegolith bool IsOptimismCanyon, IsOptimismFjord bool - IsOptimismLibplanetVn1 bool + IsOptimismLibplanet bool } // Rules ensures c's ChainID is not nil. @@ -1089,10 +1089,10 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules IsPrague: isMerge && c.IsPrague(num, timestamp), IsVerkle: isMerge && c.IsVerkle(num, timestamp), // Optimism - IsOptimismBedrock: isMerge && c.IsOptimismBedrock(num), - IsOptimismRegolith: isMerge && c.IsOptimismRegolith(timestamp), - IsOptimismCanyon: isMerge && c.IsOptimismCanyon(timestamp), - IsOptimismFjord: isMerge && c.IsOptimismFjord(timestamp), - IsOptimismLibplanetVn1: isMerge && c.IsOptimismLibplanetVn1(timestamp), + IsOptimismBedrock: isMerge && c.IsOptimismBedrock(num), + IsOptimismRegolith: isMerge && c.IsOptimismRegolith(timestamp), + IsOptimismCanyon: isMerge && c.IsOptimismCanyon(timestamp), + IsOptimismFjord: isMerge && c.IsOptimismFjord(timestamp), + IsOptimismLibplanet: isMerge && c.IsOptimismLibplanet(timestamp), } }