small fixups

This commit is contained in:
Jared Wasinger 2025-10-20 16:52:16 +08:00
parent 0de169fd31
commit 068757faea
4 changed files with 3 additions and 17 deletions

View file

@ -101,8 +101,6 @@ type StateDB interface {
AccessEvents() *state.AccessEvents
TxIndex() int
// Finalise must be invoked at the end of a transaction
Finalise(bool)
}

View file

@ -29,7 +29,7 @@ func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
case rules.IsVerkle:
return newCancunInstructionSet(), errors.New("verkle-fork not defined yet")
case rules.IsAmsterdam:
return newPragueInstructionSet(), errors.New("glamsterdam-fork not defined yet")
return newPragueInstructionSet(), nil
case rules.IsOsaka:
return newOsakaInstructionSet(), nil
case rules.IsPrague:

View file

@ -18,6 +18,7 @@ package vm
import (
"errors"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core/tracing"
@ -122,7 +123,6 @@ func gasExtCodeCopyEIP2929(evm *EVM, contract *Contract, stack *Stack, mem *Memo
// Check slot presence in the access list
if !evm.StateDB.AddressInAccessList(addr) {
evm.StateDB.AddAddressToAccessList(addr)
var overflow bool
// We charge (cold-warm), since 'warm' is already charged as constantGas
if gas, overflow = math.SafeAdd(gas, params.ColdAccountAccessCostEIP2929-params.WarmStorageReadCostEIP2929); overflow {

View file

@ -312,18 +312,6 @@ func (d *dummyChain) Config() *params.ChainConfig {
return nil
}
func (d *dummyChain) CurrentHeader() *types.Header {
return nil
}
func (d *dummyChain) GetHeaderByNumber(n uint64) *types.Header {
return d.GetHeader(common.Hash{}, n)
}
func (d *dummyChain) GetHeaderByHash(h common.Hash) *types.Header {
return nil
}
// TestBlockhash tests the blockhash operation. It's a bit special, since it internally
// requires access to a chain reader.
func TestBlockhash(t *testing.T) {
@ -676,7 +664,7 @@ func TestColdAccountAccessCost(t *testing.T) {
Tracer: &tracing.Hooks{
OnOpcode: func(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
// Uncomment to investigate failures:
//t.Logf("%d: %v %d", step, vm.OpCode(op).PrettyPrint(), cost)
//t.Logf("%d: %v %d", step, vm.OpCode(op).String(), cost)
if step == tc.step {
have = cost
}