Skip to content

Commit

Permalink
Revert "core/vm, params: ensure order of forks, prevent overflow (eth…
Browse files Browse the repository at this point in the history
…ereum#29023)"

This reverts commit 1c12cf9.
  • Loading branch information
axelKingsley committed Apr 19, 2024
1 parent 1e693b0 commit 8817416
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
7 changes: 1 addition & 6 deletions core/vm/operations_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/ethapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down
16 changes: 7 additions & 9 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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),
}
}
1 change: 0 additions & 1 deletion params/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
}
Expand Down

0 comments on commit 8817416

Please sign in to comment.