Skip to content

Conversation

@Wodann
Copy link

@Wodann Wodann commented Dec 20, 2025

The default tracer for debug_* RPC methods was not reporting warmed storage values. This deviates from Get's implementation and—seemingly—the documented expectation:

/// Represents a storage change during execution.
///
/// This maps to evm internals:
/// [JournalEntry::StorageChanged](revm::JournalEntry::StorageChanged)
///
/// It is used to track both storage change and warm load of a storage slot. For warm load in regard
/// to EIP-2929 AccessList had_value will be None.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct StorageChange {
    /// key of the storage slot
    pub key: U256,
    /// Current value of the storage slot
    pub value: U256,
    /// The previous value of the storage slot, if any
    pub had_value: Option<U256>,
    /// How this storage was accessed
    pub reason: StorageChangeReason,
}

In particular, the SLOAD for pc 235, 279, and 308 are missing "storage". This PR resolves the issue.

For reference:

revm-inspectors.json
geth.json

Copy link
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question re the removed journal change check

let reason = match op {
opcode::SLOAD => StorageChangeReason::SLOAD,
opcode::SSTORE => StorageChangeReason::SSTORE,
_ => unreachable!(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is still unreachable now

Comment on lines +556 to 564
Some(JournalEntry::StorageWarmed { key, address }) => {
// SAFETY: (Address,key) exists if part if StorageChange
let value =
context.journal_ref().evm_state()[address].storage[key].present_value();
let change = StorageChange { key: *key, value, had_value: None, reason };
Some(Box::new(change))
}
_ => None,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this effectively the only change that we need here, the missing

JournalEntry::StorageWarmed { key, address }

variant?

Comment on lines -538 to -539
// If journal has not changed, there is no state change to be recorded.
if self.config.record_state_diff && journal.len() != self.last_journal_len {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this check removed?

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