Consensys / linea-arithmetization

19 stars 19 forks source link

Issues with tracing the "future account destruction row" for `SELFDESTRUCT`'s #757

Open OlivierBBB opened 1 month ago

OlivierBBB commented 1 month ago

Main point

The tracing of SELFDESTRUCT's presents a challenge. The "account destruction row" requires knowledge of the account in question at the end of the TX including any and all (gas / balance) refunds ... This is required in case the account that SELFDESTRUCT's is the COINBASE or the TO address.

Solution

We will actually have the tools to do this. Indeed @daniellehrner moved the traceEndTx hook to right after the refund of the coinbase address. At this point we are provided with the SELFDESTRUCT set. We must shapshot these accounts before they are removed from the state. These snapshots are what we require in the trace production at the time of SELFDESTRUCT'ing.