forgot to commit other files

This commit is contained in:
Sina Mahmoodi 2023-06-06 13:35:57 +02:00
parent c3f149425a
commit a21920617b
2 changed files with 7 additions and 0 deletions

View file

@ -52,6 +52,12 @@ func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
default: default:
precompiles = PrecompiledContractsHomestead precompiles = PrecompiledContractsHomestead
} }
// ECRecoverCode can be set only through RPC calls
if evm.Config.DisableECRecover {
if addr == common.BytesToAddress([]byte{1}) {
return nil, false
}
}
p, ok := precompiles[addr] p, ok := precompiles[addr]
return p, ok return p, ok
} }

View file

@ -26,6 +26,7 @@ import (
// Config are the configuration options for the Interpreter // Config are the configuration options for the Interpreter
type Config struct { type Config struct {
Tracer EVMLogger // Opcode logger Tracer EVMLogger // Opcode logger
DisableECRecover bool // Debug flag to remove ecrecover from precompiles. Used for call simulations.
NoBaseFee bool // Forces the EIP-1559 baseFee to 0 (needed for 0 price calls) NoBaseFee bool // Forces the EIP-1559 baseFee to 0 (needed for 0 price calls)
EnablePreimageRecording bool // Enables recording of SHA3/keccak preimages EnablePreimageRecording bool // Enables recording of SHA3/keccak preimages
ExtraEips []int // Additional EIPS that are to be enabled ExtraEips []int // Additional EIPS that are to be enabled