fix(erc7562): enable state diffs to capture SLOAD in accessedSlots.reads#451
Merged
mattsse merged 1 commit intoJun 1, 2026
Merged
Conversation
9615c8b to
256508a
Compare
The erc7562Tracer config starts from `Self::none()` which sets `record_state_diff: false`. This causes SLOAD operations to not populate `accessedSlots.reads` because the SLOAD handler in `geth_erc7562_traces()` depends on `step.storage_change`, which is only set when `record_state_diff` is enabled. Without this fix, `accessedSlots.reads` is always empty, making the erc7562Tracer unusable for ERC-4337 bundlers that need storage read tracking to enforce ERC-7562 storage access rules. Note: geth's implementation of the same tracer correctly tracks storage reads.
256508a to
affd2d5
Compare
mattsse
approved these changes
Jun 1, 2026
stephancill
added a commit
to stephancill/base
that referenced
this pull request
Jun 1, 2026
Bumps revm-inspectors from 0.34.3 to 0.34.4 which includes the fix for accessedSlots.reads being empty in the erc7562Tracer. Release: https://github.com/paradigmxyz/revm-inspectors/commits/v0.34.4/ Fix: paradigmxyz/revm-inspectors#451
stephancill
added a commit
to stephancill/base
that referenced
this pull request
Jun 1, 2026
Bumps revm-inspectors from 0.34.3 to 0.34.4 which includes the fix for accessedSlots.reads being empty in the erc7562Tracer. Release: https://github.com/paradigmxyz/revm-inspectors/commits/v0.34.4/ Fix: paradigmxyz/revm-inspectors#451
stephancill
added a commit
to base/base
that referenced
this pull request
Jun 1, 2026
…3131) Bumps revm-inspectors from 0.34.3 to 0.34.4 which includes the fix for accessedSlots.reads being empty in the erc7562Tracer. Release: https://github.com/paradigmxyz/revm-inspectors/commits/v0.34.4/ Fix: paradigmxyz/revm-inspectors#451 Co-authored-by: Stephan Cilliers <stephancill@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
erc7562Tracerconfig starts fromSelf::none()which setsrecord_state_diff: false. This causes SLOAD operations to not populateaccessedSlots.readsbecause the SLOAD handler ingeth_erc7562_traces()depends onstep.storage_change, which is only set whenrecord_state_diffis enabled.Problem
step.storage_changeis only populated instep_end()whenself.config.record_state_diffis true:But
from_geth_erc7562_config()never enables it:Steps to reproduce
get()andincrement()):Call
increment()a few times so slot 0 has a non-zero value.Trace an
increment()call with theerc7562Tracer:accessedSlots.readsis empty even thoughincrement()doesSLOADon slot 0 beforeSSTORE:{ "accessedSlots": { "reads": {}, "writes": {"0x00..00": 1} } }Expected:
readsshould contain{"0x00..00": ["<current_value>"]}because the EVM performs an SLOAD before the SSTORE incount += 1.Actual:
readsis always empty.Note: geth's implementation of the same tracer correctly populates
accessedSlots.reads.Impact
ERC-4337 bundlers (e.g. Rundler) need
(slot, initial_value)pairs from SLOAD to enforce ERC-7562 storage access rules ([STO-010], [STO-031], etc.). Without this fix, the nativeerc7562Tracercannot replace custom JS tracers, which are 4-100x slower due to per-opcode JS interpretation.Fix
One line:
.set_state_diffs(true)infrom_geth_erc7562_config().