From 8817416209377474d5a0c1e1957583ef559c7ccc Mon Sep 17 00:00:00 2001 From: axelKingsley Date: Fri, 19 Apr 2024 09:49:19 -0500 Subject: [PATCH] Revert "core/vm, params: ensure order of forks, prevent overflow (#29023)" This reverts commit 1c12cf9b069f2b7c66a5575a331821ae682e23ab. --- core/vm/operations_acl.go | 7 +------ internal/ethapi/api_test.go | 2 +- params/config.go | 16 +++++++--------- params/config_test.go | 1 - 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/core/vm/operations_acl.go b/core/vm/operations_acl.go index f420a241058b..bca6d1e83b88 100644 --- a/core/vm/operations_acl.go +++ b/core/vm/operations_acl.go @@ -187,12 +187,7 @@ func makeCallVariantGasCallEIP2929(oldCalculator gasFunc) gasFunc { // outside of this function, as part of the dynamic gas, and that will make it // also become correctly reported to tracers. contract.Gas += coldCost - - var overflow bool - if gas, overflow = math.SafeAdd(gas, coldCost); overflow { - return 0, ErrGasUintOverflow - } - return gas, nil + return gas + coldCost, nil } } diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index fdaa727149bd..f5b3119c7db9 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -1987,7 +1987,6 @@ func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Ha tx *types.Transaction err error ) - b.SetPoS() switch i { case 0: // transfer 1000wei @@ -2036,6 +2035,7 @@ func setupReceiptBackend(t *testing.T, genBlocks int) (*testBackend, []common.Ha b.AddTx(tx) txHashes[i] = tx.Hash() } + b.SetPoS() }) return backend, txHashes } diff --git a/params/config.go b/params/config.go index 311e801ee6c0..9d0256daaf2f 100644 --- a/params/config.go +++ b/params/config.go @@ -1043,8 +1043,6 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules if chainID == nil { chainID = new(big.Int) } - // disallow setting Merge out of order - isMerge = isMerge && c.IsLondon(num) return Rules{ ChainID: new(big.Int).Set(chainID), IsHomestead: c.IsHomestead(num), @@ -1058,13 +1056,13 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules IsBerlin: c.IsBerlin(num), IsLondon: c.IsLondon(num), IsMerge: isMerge, - IsShanghai: isMerge && c.IsShanghai(num, timestamp), - IsCancun: isMerge && c.IsCancun(num, timestamp), - IsPrague: isMerge && c.IsPrague(num, timestamp), - IsVerkle: isMerge && c.IsVerkle(num, timestamp), + IsShanghai: c.IsShanghai(num, timestamp), + IsCancun: c.IsCancun(num, timestamp), + IsPrague: c.IsPrague(num, timestamp), + IsVerkle: c.IsVerkle(num, timestamp), // Optimism - IsOptimismBedrock: isMerge && c.IsOptimismBedrock(num), - IsOptimismRegolith: isMerge && c.IsOptimismRegolith(timestamp), - IsOptimismCanyon: isMerge && c.IsOptimismCanyon(timestamp), + IsOptimismBedrock: c.IsOptimismBedrock(num), + IsOptimismRegolith: c.IsOptimismRegolith(timestamp), + IsOptimismCanyon: c.IsOptimismCanyon(timestamp), } } diff --git a/params/config_test.go b/params/config_test.go index b91befdf71fb..14d7f833bb97 100644 --- a/params/config_test.go +++ b/params/config_test.go @@ -140,7 +140,6 @@ func TestConfigRules(t *testing.T) { func TestConfigRulesRegolith(t *testing.T) { c := &ChainConfig{ - LondonBlock: new(big.Int), RegolithTime: newUint64(500), Optimism: &OptimismConfig{}, }