Consensys/linea-tracer

CALL's to EOA's

Opened this issue · 1 comments

Question 1: If a CALL-type isntruction is carried out and the target is an externally owned account (i.e. not a precompile & empty code) does Besu create and enter a child frame ? In particular will it trigger TraceContextEnter/TraceContextExit/TraceContextReEntry ?

Our definition of carried out:

  • no exception
  • no abort (i.e. sufficient balance & creator call stack depth < 1024)

Question 2: Does Besu execute a STOP opcode within the frame created

  • for an EOA ?
  • for a precompile call ?

We empirically verified that the answer to Question 1 is Yes. We tested it with a trivial call to the address 0x0add7e55 and passed through all these tracing methods. We also looked at the Besu code and found that unless the call is aborted we do a normal call, regardless of whether the target address is a precompile, an EOA or a smart contract.

See Besu

Question 1 - Yes it does get treated the same as CREATEx instructions in that sense. I don't see any checks for empty code inside AbstractCallOperation.execute() which is what we would call in that case. Only balance and stack depth. I'm guessing that's because the EVM cannot distinguish between an EOA and contract just by the address, until its actually inside the frame. That's just a guess though.

Question 2 - Given the above the EVM will only check if code is empty when trying to execute the child frame with no code, which will originate a STOP instruction due to the AIOBE exception.

  • Yes
  • No, Precompiled contracts are handled differently since they are implemented straight in Java (or native) code in the client. See MessageCallProcessor.java#L75-L80