core/state, eth/tracers: add access list to struct logger#34656
core/state, eth/tracers: add access list to struct logger#34656AgwaB wants to merge 1 commit intoethereum:masterfrom
Conversation
Add AccessListMode option to the struct logger configuration. When set to "full", each StructLog entry includes a snapshot of the current access list at that execution step. Ref ethereum#25278
|
First some general comment: There is an effort to standardise the struct logger across clients: ethereum/execution-apis#762. As such it's necessary to get buy-in from other clients and update the spec. But also a question: What is your use-case for this change? |
Thanks for the context — I wasn’t aware of ethereum/execution-apis#762. This PR follows the approach suggested in the original issue comment: As I understand it, the struct logger spec in execution-apis#762 should be finalized before adding new fields. Is that correct? |
Indeed. I'm leaning towards closing the PR and the original issue because we haven't had any request about this feature since 3 years ago. And now with BALs coming I'm wondering if it's still relevant. Thanks for your contribution. |
Summary
Add
accessListModeoption todebug_traceTransactionstruct logger. When set to"full", eachstructLogentry includes the current EIP-2930 access list snapshot.Ref: #25278
{"method": "debug_traceTransaction", "params": ["0x...", {"accessListMode": "full"}]}Implementation
Followed the direction suggested in this comment —
AccessListModewithdisabled/fulloptions instead of a simple boolean."diff"mode is not included in this PR (see below).Question: access list revert behavior
The comment states:
However, looking at
core/state/journal.go, access list entries are rolled back onRevertToSnapshot:This means a subcall can warm an address/slot, revert, and the entry gets removed — making it cold again for subsequent accesses in the outer frame.
I deferred the
"diff"mode implementation because its correctness depends on this behavior. If access list entries are reverted, a naive diff tracker (monotonic "seen" set) would miss re-additions after reverts. Would appreciate clarification on the intended semantics before implementing diff.