From 418bc6f728b66ec9eafab3f3b0ceb14078d8a050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Wed, 26 Jun 2024 14:54:36 +0200 Subject: [PATCH] feat: rename next upgrade to Darwin (#863) --- core/blockchain_test.go | 2 +- core/state_processor_test.go | 2 +- core/vm/interpreter.go | 4 ++-- core/vm/jump_table.go | 8 ++++---- core/vm/runtime/runtime.go | 2 +- eth/gasprice/gasprice_test.go | 2 +- params/config.go | 30 +++++++++++++++--------------- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 1cc989f38db0..87fa6d18a610 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -3722,7 +3722,7 @@ func TestCurieTransition(t *testing.T) { b, _ := json.Marshal(params.AllEthashProtocolChanges) json.Unmarshal(b, &config) config.CurieBlock = big.NewInt(2) - config.DescartesTime = nil + config.DarwinTime = nil var ( db = rawdb.NewMemoryDatabase() diff --git a/core/state_processor_test.go b/core/state_processor_test.go index 723340060f00..dd104d4ac763 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -58,7 +58,7 @@ func TestStateProcessorErrors(t *testing.T) { ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DescartesTime: new(uint64), + DarwinTime: new(uint64), Ethash: new(params.EthashConfig), } signer = types.LatestSigner(config) diff --git a/core/vm/interpreter.go b/core/vm/interpreter.go index 5dd26061aa9e..8e3e6e30f859 100644 --- a/core/vm/interpreter.go +++ b/core/vm/interpreter.go @@ -74,8 +74,8 @@ func NewEVMInterpreter(evm *EVM, cfg Config) *EVMInterpreter { if cfg.JumpTable[STOP] == nil { var jt JumpTable switch { - case evm.chainRules.IsDescartes: - jt = descartesInstructionSet + case evm.chainRules.IsDarwin: + jt = darwinInstructionSet case evm.chainRules.IsCurie: jt = curieInstructionSet case evm.chainRules.IsShanghai: diff --git a/core/vm/jump_table.go b/core/vm/jump_table.go index d8826e9d34ce..2ed9c6487530 100644 --- a/core/vm/jump_table.go +++ b/core/vm/jump_table.go @@ -60,15 +60,15 @@ var ( londonInstructionSet = newLondonInstructionSet() shanghaiInstructionSet = newShanghaiInstructionSet() curieInstructionSet = newCurieInstructionSet() - descartesInstructionSet = newDescartesInstructionSet() + darwinInstructionSet = newDarwinInstructionSet() ) // JumpTable contains the EVM opcodes supported at a given fork. type JumpTable [256]*operation -// newDescartesInstructionSet returns the frontier, homestead, byzantium, -// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, and descartes instructions. -func newDescartesInstructionSet() JumpTable { +// newDarwinInstructionSet returns the frontier, homestead, byzantium, +// contantinople, istanbul, petersburg, berlin, london, shanghai, curie, and darwin instructions. +func newDarwinInstructionSet() JumpTable { instructionSet := newCurieInstructionSet() return instructionSet } diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 8526eebd28b3..ebd09e797ff2 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -72,7 +72,7 @@ func setDefaults(cfg *Config) { ShanghaiBlock: new(big.Int), BernoulliBlock: new(big.Int), CurieBlock: new(big.Int), - DescartesTime: new(uint64), + DarwinTime: new(uint64), } } diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index 5acd93b53157..7483704b244c 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -118,7 +118,7 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool, pendingTxC config.ShanghaiBlock = londonBlock config.BernoulliBlock = londonBlock config.CurieBlock = londonBlock - config.DescartesTime = nil + config.DarwinTime = nil engine := ethash.NewFaker() db := rawdb.NewMemoryDatabase() genesis, err := gspec.Commit(db) diff --git a/params/config.go b/params/config.go index 5fd5fccea8e7..a9ce6a2e33b7 100644 --- a/params/config.go +++ b/params/config.go @@ -281,7 +281,7 @@ var ( ShanghaiBlock: nil, BernoulliBlock: nil, CurieBlock: nil, - DescartesTime: nil, + DarwinTime: nil, Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -320,7 +320,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(3747132), CurieBlock: big.NewInt(4740239), - DescartesTime: nil, + DarwinTime: nil, Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -359,7 +359,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(5220340), CurieBlock: big.NewInt(7096836), - DescartesTime: nil, + DarwinTime: nil, Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -404,7 +404,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DescartesTime: new(uint64), + DarwinTime: new(uint64), TerminalTotalDifficulty: nil, Ethash: new(EthashConfig), Clique: nil, @@ -447,7 +447,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DescartesTime: new(uint64), + DarwinTime: new(uint64), TerminalTotalDifficulty: nil, Ethash: nil, Clique: &CliqueConfig{Period: 0, Epoch: 30000}, @@ -485,7 +485,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DescartesTime: new(uint64), + DarwinTime: new(uint64), TerminalTotalDifficulty: nil, Ethash: new(EthashConfig), Clique: nil, @@ -524,7 +524,7 @@ var ( ShanghaiBlock: big.NewInt(0), BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), - DescartesTime: new(uint64), + DarwinTime: new(uint64), TerminalTotalDifficulty: nil, Ethash: new(EthashConfig), Clique: nil, @@ -622,7 +622,7 @@ type ChainConfig struct { ShanghaiBlock *big.Int `json:"shanghaiBlock,omitempty"` // Shanghai switch block (nil = no fork, 0 = already on shanghai) BernoulliBlock *big.Int `json:"bernoulliBlock,omitempty"` // Bernoulli switch block (nil = no fork, 0 = already on bernoulli) CurieBlock *big.Int `json:"curieBlock,omitempty"` // Curie switch block (nil = no fork, 0 = already on curie) - DescartesTime *uint64 `json:"descartesTime,omitempty"` // Descartes switch time (nil = no fork, 0 = already on descartes) + DarwinTime *uint64 `json:"darwinTime,omitempty"` // Darwin switch time (nil = no fork, 0 = already on darwin) // TerminalTotalDifficulty is the amount of total difficulty reached by // the network that triggers the consensus upgrade. @@ -739,7 +739,7 @@ func (c *ChainConfig) String() string { default: engine = "unknown" } - return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Descartes: %v, Engine: %v, Scroll config: %v}", + return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Berlin: %v, London: %v, Arrow Glacier: %v, Archimedes: %v, Shanghai: %v, Bernoulli: %v, Curie: %v, Darwin: %v, Engine: %v, Scroll config: %v}", c.ChainID, c.HomesteadBlock, c.DAOForkBlock, @@ -759,7 +759,7 @@ func (c *ChainConfig) String() string { c.ShanghaiBlock, c.BernoulliBlock, c.CurieBlock, - c.DescartesTime, + c.DarwinTime, engine, c.Scroll, ) @@ -852,9 +852,9 @@ func (c *ChainConfig) IsCurie(num *big.Int) bool { return isForked(c.CurieBlock, num) } -// IsDescartes returns whether num is either equal to the Descartes fork block or greater. -func (c *ChainConfig) IsDescartes(now uint64) bool { - return isForkedTime(now, c.DescartesTime) +// IsDarwin returns whether num is either equal to the Darwin fork block or greater. +func (c *ChainConfig) IsDarwin(now uint64) bool { + return isForkedTime(now, c.DarwinTime) } // IsTerminalPoWBlock returns whether the given block is the last block of PoW stage. @@ -1069,7 +1069,7 @@ type Rules struct { IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool IsBerlin, IsLondon, IsArchimedes, IsShanghai bool - IsBernoulli, IsCurie, IsDescartes bool + IsBernoulli, IsCurie, IsDarwin bool } // Rules ensures c's ChainID is not nil. @@ -1094,6 +1094,6 @@ func (c *ChainConfig) Rules(num *big.Int, time uint64) Rules { IsShanghai: c.IsShanghai(num), IsBernoulli: c.IsBernoulli(num), IsCurie: c.IsCurie(num), - IsDescartes: c.IsDescartes(time), + IsDarwin: c.IsDarwin(time), } }