mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
core/vm: mark the correct address as touched
This commit is contained in:
parent
dc4d53b83c
commit
e0c3db0de4
2 changed files with 9 additions and 9 deletions
|
|
@ -725,14 +725,14 @@ func enableEOF(jt *JumpTable) {
|
|||
jt[EXTCALL] = &operation{
|
||||
execute: opExtCall,
|
||||
constantGas: params.WarmStorageReadCostEIP2929,
|
||||
dynamicGas: makeCallVariantGasCallEIP2929(gasExtCall),
|
||||
dynamicGas: makeCallVariantGasCallEIP2929(gasExtCall, 0),
|
||||
minStack: minStack(4, 1),
|
||||
maxStack: maxStack(4, 1),
|
||||
memorySize: memoryExtCall,
|
||||
}
|
||||
jt[EXTDELEGATECALL] = &operation{
|
||||
execute: opExtDelegateCall,
|
||||
dynamicGas: makeCallVariantGasCallEIP2929(gasExtDelegateCall),
|
||||
dynamicGas: makeCallVariantGasCallEIP2929(gasExtDelegateCall, 0),
|
||||
constantGas: params.WarmStorageReadCostEIP2929,
|
||||
minStack: minStack(3, 1),
|
||||
maxStack: maxStack(3, 1),
|
||||
|
|
@ -741,7 +741,7 @@ func enableEOF(jt *JumpTable) {
|
|||
jt[EXTSTATICCALL] = &operation{
|
||||
execute: opExtStaticCall,
|
||||
constantGas: params.WarmStorageReadCostEIP2929,
|
||||
dynamicGas: makeCallVariantGasCallEIP2929(gasExtStaticCall),
|
||||
dynamicGas: makeCallVariantGasCallEIP2929(gasExtStaticCall, 0),
|
||||
minStack: minStack(3, 1),
|
||||
maxStack: maxStack(3, 1),
|
||||
memorySize: memoryExtStaticCall,
|
||||
|
|
|
|||
|
|
@ -159,9 +159,9 @@ func gasEip2929AccountCheck(evm *EVM, contract *Contract, stack *Stack, mem *Mem
|
|||
return 0, nil
|
||||
}
|
||||
|
||||
func makeCallVariantGasCallEIP2929(oldCalculator gasFunc) gasFunc {
|
||||
func makeCallVariantGasCallEIP2929(oldCalculator gasFunc, addrPosition int) gasFunc {
|
||||
return func(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) {
|
||||
addr := common.Address(stack.Back(1).Bytes20())
|
||||
addr := common.Address(stack.Back(addrPosition).Bytes20())
|
||||
// Check slot presence in the access list
|
||||
warmAccess := evm.StateDB.AddressInAccessList(addr)
|
||||
// The WarmStorageReadCostEIP2929 (100) is already deducted in the form of a constant cost, so
|
||||
|
|
@ -199,10 +199,10 @@ func makeCallVariantGasCallEIP2929(oldCalculator gasFunc) gasFunc {
|
|||
}
|
||||
|
||||
var (
|
||||
gasCallEIP2929 = makeCallVariantGasCallEIP2929(gasCall)
|
||||
gasDelegateCallEIP2929 = makeCallVariantGasCallEIP2929(gasDelegateCall)
|
||||
gasStaticCallEIP2929 = makeCallVariantGasCallEIP2929(gasStaticCall)
|
||||
gasCallCodeEIP2929 = makeCallVariantGasCallEIP2929(gasCallCode)
|
||||
gasCallEIP2929 = makeCallVariantGasCallEIP2929(gasCall, 1)
|
||||
gasDelegateCallEIP2929 = makeCallVariantGasCallEIP2929(gasDelegateCall, 1)
|
||||
gasStaticCallEIP2929 = makeCallVariantGasCallEIP2929(gasStaticCall, 1)
|
||||
gasCallCodeEIP2929 = makeCallVariantGasCallEIP2929(gasCallCode, 1)
|
||||
gasSelfdestructEIP2929 = makeSelfdestructGasFn(true)
|
||||
// gasSelfdestructEIP3529 implements the changes in EIP-3529 (no refunds)
|
||||
gasSelfdestructEIP3529 = makeSelfdestructGasFn(false)
|
||||
|
|
|
|||
Loading…
Reference in a new issue