diff --git a/core/vm/evm.go b/core/vm/evm.go index a38eae94ff77..fed7302b5919 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -58,6 +58,10 @@ func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) { return p, ok } +func (evm *EVM) isSystemContract(addr common.Address) bool { + return addr == params.HistoryStorageAddress +} + // BlockContext provides the EVM with auxiliary information. Once provided // it shouldn't be modified. type BlockContext struct { diff --git a/core/vm/operations_verkle.go b/core/vm/operations_verkle.go index ba90afdefcf0..d417533b6ea9 100644 --- a/core/vm/operations_verkle.go +++ b/core/vm/operations_verkle.go @@ -61,7 +61,7 @@ func gasExtCodeSize4762(evm *EVM, contract *Contract, stack *Stack, mem *Memory, func gasExtCodeHash4762(evm *EVM, contract *Contract, stack *Stack, mem *Memory, memorySize uint64) (uint64, error) { address := stack.peek().Bytes20() - if _, isPrecompile := evm.precompile(address); isPrecompile { + if _, isPrecompile := evm.precompile(address); isPrecompile || evm.isSystemContract(address) { return 0, nil } codehashgas := evm.Accesses.TouchCodeHash(address[:], false) @@ -132,6 +132,10 @@ func gasExtCodeCopyEIP4762(evm *EVM, contract *Contract, stack *Stack, mem *Memo return 0, err } addr := common.Address(stack.peek().Bytes20()) + + if _, isPrecompile := evm.precompile(addr); isPrecompile { + return gas, nil + } wgas := evm.Accesses.TouchBasicData(addr[:], false) if wgas == 0 { wgas = params.WarmStorageReadCostEIP2929