Skip to content

core/state, eth/tracers: add access list to struct logger#34656

Closed
AgwaB wants to merge 1 commit intoethereum:masterfrom
AgwaB:feat/access-list-tracing
Closed

core/state, eth/tracers: add access list to struct logger#34656
AgwaB wants to merge 1 commit intoethereum:masterfrom
AgwaB:feat/access-list-tracing

Conversation

@AgwaB
Copy link
Copy Markdown

@AgwaB AgwaB commented Apr 4, 2026

Summary

Add accessListMode option to debug_traceTransaction struct logger. When set to "full", each structLog entry includes the current EIP-2930 access list snapshot.

Ref: #25278

{"method": "debug_traceTransaction", "params": ["0x...", {"accessListMode": "full"}]}

Implementation

Followed the direction suggested in this commentAccessListMode with disabled/full options instead of a simple boolean. "diff" mode is not included in this PR (see below).

Question: access list revert behavior

The comment states:

The good thing about access list is it's strictly append-only. Even if a call reverts, those won't get untouched.

However, looking at core/state/journal.go, access list entries are rolled back on RevertToSnapshot:

func (ch accessListAddAccountChange) revert(s *StateDB) {
    s.accessList.DeleteAddress(ch.address)
}

func (ch accessListAddSlotChange) revert(s *StateDB) {
    s.accessList.DeleteSlot(ch.address, ch.slot)
}

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.

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
@AgwaB AgwaB requested review from rjl493456442 and s1na as code owners April 4, 2026 11:49
@s1na
Copy link
Copy Markdown
Contributor

s1na commented Apr 7, 2026

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?

@AgwaB
Copy link
Copy Markdown
Author

AgwaB commented Apr 7, 2026

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:
#25278 (comment)

As I understand it, the struct logger spec in execution-apis#762 should be finalized before adding new fields. Is that correct?

@s1na
Copy link
Copy Markdown
Contributor

s1na commented Apr 7, 2026

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.

@s1na s1na closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants