review feedback

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
This commit is contained in:
Guillaume Ballet 2025-02-03 10:42:51 +01:00
parent e64596c783
commit 70a5344094
2 changed files with 10 additions and 1 deletions

View File

@ -339,7 +339,7 @@ func opExtCodeCopyEIP4762(pc *uint64, interpreter *EVMInterpreter, scope *ScopeC
addr := common.Address(a.Bytes20())
code := interpreter.evm.StateDB.GetCode(addr)
paddedCodeCopy, copyOffset, nonPaddedCopyLength := getDataAndAdjustedBounds(code, uint64CodeOffset, length.Uint64())
if !isSystemCall(AccountRef(addr)) {
if !isSystemContract(addr) {
statelessGas := interpreter.evm.AccessEvents.CodeChunksRangeGas(addr, copyOffset, nonPaddedCopyLength, uint64(len(code)), false)
if !scope.Contract.UseGas(statelessGas, interpreter.evm.Config.Tracer, tracing.GasChangeUnspecified) {
scope.Contract.Gas = 0

View File

@ -169,6 +169,15 @@ func isSystemCall(caller ContractRef) bool {
return caller.Address() == params.SystemAddress
}
func isSystemContract(callee common.Address) bool {
switch callee {
case params.BeaconRootsAddress, params.HistoryStorageAddress, params.WithdrawalQueueAddress, params.ConsolidationQueueAddress:
return true
default:
return false
}
}
// Call executes the contract associated with the addr with the given input as
// parameters. It also handles any necessary value transfer required and takse
// the necessary steps to create accounts and reverses the state in case of an