Consensys / linea-tracer

Part of the Linea stack responsible for extracting data from the execution of an EVM client in order to construct large matrices called execution traces.
https://linea.build
Other
35 stars 22 forks source link

CALL's to precompiles #869

Open OlivierBBB opened 3 months ago

OlivierBBB commented 3 months ago

Question 1: If a CALL-type isntruction is carried out and the target is a precompile (i.e. its address is in the range $\lbrace1, 2, \dots, 9\rbrace$) does Besu create and enter a child frame ? In particular will it trigger TraceContextEnter/TraceContextExit/TraceContextReEntry ?

Our definition of carried out:

lu-pinto commented 3 months ago

Yes it will create a child frame and execute it just as another type of CALL (EOA, contract) - I don't see any distinction while executing a CALL operation at the parent level here. It will call TraceContextEnter and TraceContextExit on the child frame, though on the precompile, the child would take a slightly different code path, instead of going through the EVM code executor. Precompiles seem to be implemented in Java or native code directly and so it will call a TracePrecompileCall event. After it has finished the proper ending state is set back CODE_SUCCESS, HALT and it follows the same code path as without precompile.