mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
use caller in isSystemCall for future-proofiness
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
This commit is contained in:
parent
35313fd50a
commit
3ad0d18d9d
1 changed files with 4 additions and 4 deletions
|
|
@ -170,8 +170,8 @@ func (evm *EVM) Interpreter() *EVMInterpreter {
|
|||
return evm.interpreter
|
||||
}
|
||||
|
||||
func (evm *EVM) isSystemCall() bool {
|
||||
return evm.TxContext.Origin == params.SystemAddress
|
||||
func isSystemCall(caller ContractRef) bool {
|
||||
return caller.Address() == params.SystemAddress
|
||||
}
|
||||
|
||||
// Call executes the contract associated with the addr with the given input as
|
||||
|
|
@ -198,7 +198,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
|
|||
p, isPrecompile := evm.precompile(addr)
|
||||
|
||||
if !evm.StateDB.Exist(addr) {
|
||||
if !isPrecompile && evm.chainRules.IsEIP4762 && !evm.isSystemCall() {
|
||||
if !isPrecompile && evm.chainRules.IsEIP4762 && !isSystemCall(caller) {
|
||||
// add proof of absence to witness
|
||||
wgas := evm.AccessEvents.AddAccount(addr, false)
|
||||
if gas < wgas {
|
||||
|
|
@ -229,7 +229,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
|
|||
// If the account has no code, we can abort here
|
||||
// The depth-check is already done, and precompiles handled above
|
||||
contract := NewContract(caller, AccountRef(addrCopy), value, gas)
|
||||
contract.IsSystemCall = evm.isSystemCall()
|
||||
contract.IsSystemCall = isSystemCall(caller)
|
||||
contract.SetCallCode(&addrCopy, evm.resolveCodeHash(addrCopy), code)
|
||||
ret, err = evm.interpreter.Run(contract, input, false)
|
||||
gas = contract.Gas
|
||||
|
|
|
|||
Loading…
Reference in a new issue