From 961db0f41539466426e234a7e2167fcb2f0d5f06 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Fri, 30 Aug 2024 08:10:12 +0800 Subject: [PATCH] feat: schedule DarwinV2 (#1016) * minor * feat: schedule DarwinV2 --- core/blockchain_test.go | 1 + core/state_processor_test.go | 1 + core/vm/runtime/runtime.go | 1 + eth/gasprice/gasprice_test.go | 3 +++ internal/ethapi/transaction_args_test.go | 3 +++ params/config.go | 2 ++ 6 files changed, 11 insertions(+) diff --git a/core/blockchain_test.go b/core/blockchain_test.go index 118014b985..bc4772f46d 100644 --- a/core/blockchain_test.go +++ b/core/blockchain_test.go @@ -4728,6 +4728,7 @@ func TestCurieTransition(t *testing.T) { json.Unmarshal(b, &config) config.CurieBlock = big.NewInt(2) config.DarwinTime = nil + config.DarwinV2Time = nil var ( db = rawdb.NewMemoryDatabase() diff --git a/core/state_processor_test.go b/core/state_processor_test.go index 6e52853e9e..9e898c9011 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -67,6 +67,7 @@ func TestStateProcessorErrors(t *testing.T) { BernoulliBlock: big.NewInt(0), CurieBlock: big.NewInt(0), DarwinTime: new(uint64), + DarwinV2Time: new(uint64), } signer = types.LatestSigner(config) key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291") diff --git a/core/vm/runtime/runtime.go b/core/vm/runtime/runtime.go index 46da4ad6f5..f4453abc62 100644 --- a/core/vm/runtime/runtime.go +++ b/core/vm/runtime/runtime.go @@ -75,6 +75,7 @@ func setDefaults(cfg *Config) { BernoulliBlock: new(big.Int), CurieBlock: new(big.Int), DarwinTime: new(uint64), + DarwinV2Time: new(uint64), } } diff --git a/eth/gasprice/gasprice_test.go b/eth/gasprice/gasprice_test.go index 579d6ad784..719ccc8a25 100644 --- a/eth/gasprice/gasprice_test.go +++ b/eth/gasprice/gasprice_test.go @@ -153,11 +153,14 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool, pendingTxC config.CurieBlock = londonBlock config.ShanghaiTime = nil config.DarwinTime = nil + config.DarwinV2Time = nil if londonBlock != nil { shanghaiTime := londonBlock.Uint64() * 12 config.ShanghaiTime = &shanghaiTime darwinTime := londonBlock.Uint64() * 12 config.DarwinTime = &darwinTime + darwinV2Time := londonBlock.Uint64() * 12 + config.DarwinV2Time = &darwinV2Time } config.TerminalTotalDifficulty = common.Big0 diff --git a/internal/ethapi/transaction_args_test.go b/internal/ethapi/transaction_args_test.go index 23247e10b0..41b3160ff1 100644 --- a/internal/ethapi/transaction_args_test.go +++ b/internal/ethapi/transaction_args_test.go @@ -234,11 +234,14 @@ func newBackendMock() *backendMock { config.CurieBlock = config.LondonBlock config.ShanghaiTime = nil config.DarwinTime = nil + config.DarwinV2Time = nil if config.LondonBlock != nil { shanghaiTime := config.LondonBlock.Uint64() * 12 config.ShanghaiTime = &shanghaiTime darwinTime := config.LondonBlock.Uint64() * 12 config.DarwinTime = &darwinTime + darwinV2Time := config.LondonBlock.Uint64() * 12 + config.DarwinV2Time = &darwinV2Time } return &backendMock{ diff --git a/params/config.go b/params/config.go index 22b61484eb..9e4df420ff 100644 --- a/params/config.go +++ b/params/config.go @@ -205,6 +205,7 @@ var ( BernoulliBlock: big.NewInt(3747132), CurieBlock: big.NewInt(4740239), DarwinTime: newUint64(1723622400), + DarwinV2Time: newUint64(1724832000), Clique: &CliqueConfig{ Period: 3, Epoch: 30000, @@ -245,6 +246,7 @@ var ( BernoulliBlock: big.NewInt(5220340), CurieBlock: big.NewInt(7096836), DarwinTime: newUint64(1724227200), + DarwinV2Time: newUint64(1725264000), Clique: &CliqueConfig{ Period: 3, Epoch: 30000,