diff --git a/core/types/transaction_marshalling.go b/core/types/transaction_marshalling.go index 1722ff7c08e..c4309caba69 100644 --- a/core/types/transaction_marshalling.go +++ b/core/types/transaction_marshalling.go @@ -68,7 +68,7 @@ type txJSON struct { } type JsonAuthorization struct { - ChainID hexutil.Big `json:"chainId"` + ChainID hexutil.Big `json:"chainId"` Address libcommon.Address `json:"address"` Nonce hexutil.Uint64 `json:"nonce"` V hexutil.Uint64 `json:"v"` diff --git a/core/vm/eips.go b/core/vm/eips.go index 0625ba8a8d5..d4e201799a4 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -326,9 +326,6 @@ func enable7516(jt *JumpTable) { } func enable7702(jt *JumpTable) { - jt[EXTCODECOPY].dynamicGas = gasExtCodeCopyEIP7702 - jt[EXTCODESIZE].dynamicGas = gasEip7702CodeCheck - jt[EXTCODEHASH].dynamicGas = gasEip7702CodeCheck jt[CALL].dynamicGas = gasCallEIP7702 jt[CALLCODE].dynamicGas = gasCallCodeEIP7702 jt[STATICCALL].dynamicGas = gasStaticCallEIP7702 diff --git a/core/vm/instructions.go b/core/vm/instructions.go index 0524f96eaac..83d53094d1e 100644 --- a/core/vm/instructions.go +++ b/core/vm/instructions.go @@ -380,7 +380,7 @@ func opExtCodeSize(pc *uint64, interpreter *EVMInterpreter, scope *ScopeContext) if err != nil { return nil, fmt.Errorf("%w: %w", ErrIntraBlockStateFailed, err) } - if codeSize == types.DelegateDesignationCodeSize { + if codeSize == types.DelegateDesignationCodeSize { _, ok, err := interpreter.evm.IntraBlockState().GetDelegatedDesignation(addr) if err != nil { return nil, fmt.Errorf("%w: %w", ErrIntraBlockStateFailed, err) diff --git a/core/vm/operations_acl.go b/core/vm/operations_acl.go index fe1817e8013..e7e558450f7 100644 --- a/core/vm/operations_acl.go +++ b/core/vm/operations_acl.go @@ -317,63 +317,3 @@ func makeCallVariantGasCallEIP7702(oldCalculator gasFunc) gasFunc { return gas, nil } } - -func gasEip7702CodeCheck(evm *EVM, contract *Contract, stack *stack.Stack, mem *Memory, memorySize uint64) (uint64, error) { - addr := libcommon.Address(stack.Peek().Bytes20()) - // The warm storage read cost is already charged as constantGas - // Check slot presence in the access list - var cost uint64 - if evm.intraBlockState.AddAddressToAccessList(addr) { - // Check if code is a delegation and if so, charge for resolution - cost = params.ColdAccountAccessCostEIP2929 - params.WarmStorageReadCostEIP2929 - } - dd, ok, err := evm.intraBlockState.GetDelegatedDesignation(addr) - if err != nil { - return 0, err - } - if ok { - if evm.intraBlockState.AddAddressToAccessList(dd) { - cost += params.ColdAccountAccessCostEIP2929 - } else { - cost += params.WarmStorageReadCostEIP2929 - } - } - - return cost, nil -} - -func gasExtCodeCopyEIP7702(evm *EVM, contract *Contract, stack *stack.Stack, mem *Memory, memorySize uint64) (uint64, error) { - // memory expansion first (dynamic part of pre-2929 implementation) - gas, err := gasExtCodeCopy(evm, contract, stack, mem, memorySize) - if err != nil { - return 0, err - } - addr := libcommon.Address(stack.Peek().Bytes20()) - // Check slot presence in the access list - if evm.intraBlockState.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 { - return 0, ErrGasUintOverflow - } - } - - // Check if addr has a delegation and if so, charge for resolution - dd, ok, err := evm.intraBlockState.GetDelegatedDesignation(addr) - if err != nil { - return 0, err - } - if ok { - var overflow bool - if evm.intraBlockState.AddAddressToAccessList(dd) { - if gas, overflow = math.SafeAdd(gas, params.ColdAccountAccessCostEIP2929); overflow { - return 0, ErrGasUintOverflow - } - } else { - if gas, overflow = math.SafeAdd(gas, params.WarmStorageReadCostEIP2929); overflow { - return 0, ErrGasUintOverflow - } - } - } - return gas, nil -} diff --git a/tests/exec_spec_test.go b/tests/exec_spec_test.go index 8aeadc9a06d..4c41c863a7b 100644 --- a/tests/exec_spec_test.go +++ b/tests/exec_spec_test.go @@ -31,7 +31,7 @@ func TestExecutionSpec(t *testing.T) { bt := new(testMatcher) - dir := filepath.Join(".", "execution-spec-tests",) + dir := filepath.Join(".", "execution-spec-tests") bt.skipLoad(`^prague/eip2935_historical_block_hashes_from_state/block_hashes/block_hashes_history.json`) // bt.skipLoad(`^cancun`) checkStateRoot := true