diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index 4ee7cfabf6..a5655bc9c3 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -189,7 +189,7 @@ func instructionSetForConfig(config ctypes.ChainConfigurator, bn *big.Int) JumpT if config.IsForked(config.GetECIP1080Transition, bn) { enableSelfBalance(&instructionSet) } - if config.IsForked(config.GetEIP2200Transition, bn) { + if config.IsForked(config.GetEIP2200Transition, bn) && !config.IsForked(config.GetEIP2200DisableTransition, bn) { enable2200(&instructionSet) // Net metered SSTORE - https://eips.ethereum.org/EIPS/eip-2200 } return instructionSet diff --git a/params/config_classic.go b/params/config_classic.go index b12a6a71ba..57df984295 100644 --- a/params/config_classic.go +++ b/params/config_classic.go @@ -54,21 +54,25 @@ var ( EIP214FBlock: big.NewInt(8772000), EIP658FBlock: big.NewInt(8772000), - // Constantinople eq + // Constantinople eq, aka Agharta EIP145FBlock: big.NewInt(9573000), EIP1014FBlock: big.NewInt(9573000), EIP1052FBlock: big.NewInt(9573000), - // Istanbul eq - EIP152FBlock: big.NewInt(10500839), - EIP1108FBlock: big.NewInt(10500839), - EIP1344FBlock: big.NewInt(10500839), + // Istanbul eq, aka Aztlan + // ECIP-1061 + EIP152FBlock: big.NewInt(10_500_839), + EIP1108FBlock: big.NewInt(10_500_839), + EIP1344FBlock: big.NewInt(10_500_839), EIP1884FBlock: nil, - EIP2028FBlock: big.NewInt(10500839), - EIP2200FBlock: big.NewInt(10500839), // RePetersburg (=~ re-1283) + EIP2028FBlock: big.NewInt(10_500_839), + EIP2200FBlock: big.NewInt(10_500_839), // RePetersburg (=~ re-1283) - EIP1283FBlock: nil, - PetersburgBlock: nil, // Un1283 + // ECIP-1078, aka Phoenix Fix + EIP2200DisableFBlock: big.NewInt(10_500_839), + EIP1283FBlock: big.NewInt(10_500_839), + EIP1706FBlock: big.NewInt(10_500_839), + ECIP1080FBlock: big.NewInt(10_500_839), DisposalBlock: big.NewInt(5900000), ECIP1017FBlock: big.NewInt(5000000), diff --git a/params/config_kotti.go b/params/config_kotti.go index 0cb182b90c..35a9abc121 100644 --- a/params/config_kotti.go +++ b/params/config_kotti.go @@ -57,12 +57,13 @@ var ( EIP214FBlock: big.NewInt(716617), EIP658FBlock: big.NewInt(716617), - // Constantinople eq + // Constantinople eq, aka Agharta EIP145FBlock: big.NewInt(1705549), EIP1014FBlock: big.NewInt(1705549), EIP1052FBlock: big.NewInt(1705549), - // Istanbul eq + // Istanbul eq, aka Aztlan + // ECIP-1061 EIP152FBlock: big.NewInt(2058191), EIP1108FBlock: big.NewInt(2058191), EIP1344FBlock: big.NewInt(2058191), @@ -70,6 +71,12 @@ var ( EIP2028FBlock: big.NewInt(2058191), EIP2200FBlock: big.NewInt(2058191), // RePetersburg (== re-1283) + // ECIP-1078, aka Phoenix Fix + EIP2200DisableFBlock: big.NewInt(2_208_203), + EIP1283FBlock: big.NewInt(2_208_203), + EIP1706FBlock: big.NewInt(2_208_203), + ECIP1080FBlock: big.NewInt(2_208_203), + ECIP1017FBlock: big.NewInt(5000000), ECIP1017EraRounds: big.NewInt(5000000), diff --git a/params/config_mordor.go b/params/config_mordor.go index d54e7eb7d5..a1104d6ae5 100644 --- a/params/config_mordor.go +++ b/params/config_mordor.go @@ -51,12 +51,13 @@ var ( EIP214FBlock: big.NewInt(0), EIP658FBlock: big.NewInt(0), - // Constantinople eq + // Constantinople eq, aka Agharta EIP145FBlock: big.NewInt(301243), EIP1014FBlock: big.NewInt(301243), EIP1052FBlock: big.NewInt(301243), - // Istanbul eq + // Istanbul eq, aka Aztlan + // ECIP-1061 EIP152FBlock: big.NewInt(778507), EIP1108FBlock: big.NewInt(778507), EIP1344FBlock: big.NewInt(778507), @@ -64,6 +65,12 @@ var ( EIP2028FBlock: big.NewInt(778507), EIP2200FBlock: big.NewInt(778507), // RePetersburg (== re-1283) + // ECIP-1078, aka Phoenix Fix + EIP2200DisableFBlock: big.NewInt(976_231), + EIP1283FBlock: big.NewInt(976_231), + EIP1706FBlock: big.NewInt(976_231), + ECIP1080FBlock: big.NewInt(976_231), + DisposalBlock: big.NewInt(0), ECIP1017FBlock: big.NewInt(0), ECIP1017EraRounds: big.NewInt(2000000), diff --git a/params/types/ctypes/configurator_iface.go b/params/types/ctypes/configurator_iface.go index e5a5389b7e..3e9293dc0f 100644 --- a/params/types/ctypes/configurator_iface.go +++ b/params/types/ctypes/configurator_iface.go @@ -108,6 +108,8 @@ type CatHerder interface { SetEIP1108Transition(n *uint64) error GetEIP2200Transition() *uint64 SetEIP2200Transition(n *uint64) error + GetEIP2200DisableTransition() *uint64 + SetEIP2200DisableTransition(n *uint64) error GetEIP1344Transition() *uint64 SetEIP1344Transition(n *uint64) error GetEIP1884Transition() *uint64 diff --git a/params/types/genesisT/genesis.go b/params/types/genesisT/genesis.go index 396f8a4cbf..c789028934 100644 --- a/params/types/genesisT/genesis.go +++ b/params/types/genesisT/genesis.go @@ -488,6 +488,14 @@ func (g *Genesis) SetEIP2200Transition(n *uint64) error { return g.Config.SetEIP2200Transition(n) } +func (g *Genesis) GetEIP2200DisableTransition() *uint64 { + return g.Config.GetEIP2200DisableTransition() +} + +func (g *Genesis) SetEIP2200DisableTransition(n *uint64) error { + return g.Config.SetEIP2200DisableTransition(n) +} + func (g *Genesis) GetEIP1344Transition() *uint64 { return g.Config.GetEIP1344Transition() } diff --git a/params/types/goethereum/goethereum_configurator.go b/params/types/goethereum/goethereum_configurator.go index e943cebf3d..bfd773dfab 100644 --- a/params/types/goethereum/goethereum_configurator.go +++ b/params/types/goethereum/goethereum_configurator.go @@ -326,6 +326,17 @@ func (c *ChainConfig) SetEIP2200Transition(n *uint64) error { return nil } +func (c *ChainConfig) GetEIP2200DisableTransition() *uint64 { + return nil +} + +func (c *ChainConfig) SetEIP2200DisableTransition(n *uint64) error { + if n == nil { + return nil + } + return ctypes.ErrUnsupportedConfigFatal +} + func (c *ChainConfig) GetEIP1344Transition() *uint64 { return bigNewU64(c.IstanbulBlock) } diff --git a/params/types/multigeth/chain_config.go b/params/types/multigeth/chain_config.go index f81b518c27..f18821af4b 100644 --- a/params/types/multigeth/chain_config.go +++ b/params/types/multigeth/chain_config.go @@ -151,7 +151,8 @@ type MultiGethChainConfig struct { // EIP-2200: Rebalance net-metered SSTORE gas cost with consideration of SLOAD gas cost change // It's a combined version of EIP-1283 + EIP-1706, with a structured definition so as to make it // interoperable with other gas changes such as EIP-1884. - EIP2200FBlock *big.Int `json:"eip2200FBlock,omitempty"` + EIP2200FBlock *big.Int `json:"eip2200FBlock,omitempty"` + EIP2200DisableFBlock *big.Int `json:"eip2200DisableFBlock,omitempty"` // EIP-2384: Difficulty Bomb Delay (Muir Glacier) eip2384Inferred bool diff --git a/params/types/multigeth/chain_config_configurator.go b/params/types/multigeth/chain_config_configurator.go index 039ce8274a..c2d3d5d5b7 100644 --- a/params/types/multigeth/chain_config_configurator.go +++ b/params/types/multigeth/chain_config_configurator.go @@ -318,6 +318,15 @@ func (c *MultiGethChainConfig) SetEIP2200Transition(n *uint64) error { return nil } +func (c *MultiGethChainConfig) GetEIP2200DisableTransition() *uint64 { + return bigNewU64(c.EIP2200DisableFBlock) +} + +func (c *MultiGethChainConfig) SetEIP2200DisableTransition(n *uint64) error { + c.EIP2200DisableFBlock = setBig(c.EIP2200DisableFBlock, n) + return nil +} + func (c *MultiGethChainConfig) GetEIP1344Transition() *uint64 { return bigNewU64(c.EIP1344FBlock) } diff --git a/params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go b/params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go index d5e7916691..bbab2b7570 100644 --- a/params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go +++ b/params/types/oldmultigeth/oldmultigeth_chain_config_configurator.go @@ -314,6 +314,17 @@ func (c *ChainConfig) SetEIP2200Transition(n *uint64) error { return nil } +func (c *ChainConfig) GetEIP2200DisableTransition() *uint64 { + return nil +} + +func (c *ChainConfig) SetEIP2200DisableTransition(n *uint64) error { + if n == nil { + return nil + } + return ctypes.ErrUnsupportedConfigFatal +} + func (c *ChainConfig) GetEIP1344Transition() *uint64 { return bigNewU64(c.IstanbulBlock) } diff --git a/params/types/parity/parity_configurator.go b/params/types/parity/parity_configurator.go index f999bdb240..6a3bdb123f 100644 --- a/params/types/parity/parity_configurator.go +++ b/params/types/parity/parity_configurator.go @@ -250,6 +250,17 @@ func (spec *ParityChainSpec) SetEIP2200Transition(i *uint64) error { return nil } +func (spec *ParityChainSpec) GetEIP2200DisableTransition() *uint64 { + return nil +} + +func (spec *ParityChainSpec) SetEIP2200DisableTransition(n *uint64) error { + if n == nil { + return nil + } + return ctypes.ErrUnsupportedConfigFatal +} + func (spec *ParityChainSpec) GetEIP1344Transition() *uint64 { return spec.Params.EIP1344Transition.Uint64P() }