mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-19 14:29:27 +00:00
small fixups
This commit is contained in:
parent
0de169fd31
commit
068757faea
4 changed files with 3 additions and 17 deletions
|
|
@ -101,8 +101,6 @@ type StateDB interface {
|
||||||
|
|
||||||
AccessEvents() *state.AccessEvents
|
AccessEvents() *state.AccessEvents
|
||||||
|
|
||||||
TxIndex() int
|
|
||||||
|
|
||||||
// Finalise must be invoked at the end of a transaction
|
// Finalise must be invoked at the end of a transaction
|
||||||
Finalise(bool)
|
Finalise(bool)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
|
||||||
case rules.IsVerkle:
|
case rules.IsVerkle:
|
||||||
return newCancunInstructionSet(), errors.New("verkle-fork not defined yet")
|
return newCancunInstructionSet(), errors.New("verkle-fork not defined yet")
|
||||||
case rules.IsAmsterdam:
|
case rules.IsAmsterdam:
|
||||||
return newPragueInstructionSet(), errors.New("glamsterdam-fork not defined yet")
|
return newPragueInstructionSet(), nil
|
||||||
case rules.IsOsaka:
|
case rules.IsOsaka:
|
||||||
return newOsakaInstructionSet(), nil
|
return newOsakaInstructionSet(), nil
|
||||||
case rules.IsPrague:
|
case rules.IsPrague:
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package vm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/common/math"
|
"github.com/ethereum/go-ethereum/common/math"
|
||||||
"github.com/ethereum/go-ethereum/core/tracing"
|
"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
|
// Check slot presence in the access list
|
||||||
if !evm.StateDB.AddressInAccessList(addr) {
|
if !evm.StateDB.AddressInAccessList(addr) {
|
||||||
evm.StateDB.AddAddressToAccessList(addr)
|
evm.StateDB.AddAddressToAccessList(addr)
|
||||||
|
|
||||||
var overflow bool
|
var overflow bool
|
||||||
// We charge (cold-warm), since 'warm' is already charged as constantGas
|
// We charge (cold-warm), since 'warm' is already charged as constantGas
|
||||||
if gas, overflow = math.SafeAdd(gas, params.ColdAccountAccessCostEIP2929-params.WarmStorageReadCostEIP2929); overflow {
|
if gas, overflow = math.SafeAdd(gas, params.ColdAccountAccessCostEIP2929-params.WarmStorageReadCostEIP2929); overflow {
|
||||||
|
|
|
||||||
|
|
@ -312,18 +312,6 @@ func (d *dummyChain) Config() *params.ChainConfig {
|
||||||
return nil
|
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
|
// TestBlockhash tests the blockhash operation. It's a bit special, since it internally
|
||||||
// requires access to a chain reader.
|
// requires access to a chain reader.
|
||||||
func TestBlockhash(t *testing.T) {
|
func TestBlockhash(t *testing.T) {
|
||||||
|
|
@ -676,7 +664,7 @@ func TestColdAccountAccessCost(t *testing.T) {
|
||||||
Tracer: &tracing.Hooks{
|
Tracer: &tracing.Hooks{
|
||||||
OnOpcode: func(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
|
OnOpcode: func(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
|
||||||
// Uncomment to investigate failures:
|
// 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 {
|
if step == tc.step {
|
||||||
have = cost
|
have = cost
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue