-
Notifications
You must be signed in to change notification settings - Fork 125
fix: warmed storage values for GethTrace using DebugInspector
#389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
mattsse
left a comment
There was a problem hiding this 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!(), |
There was a problem hiding this comment.
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
| 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, | ||
| } |
There was a problem hiding this comment.
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?
| // 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 { |
There was a problem hiding this comment.
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?
The default tracer for
debug_*RPC methods was not reporting warmed storage values. This deviates from Get's implementation and—seemingly—the documented expectation:In particular, the
SLOADfor pc235,279, and308are missing"storage". This PR resolves the issue.For reference:
revm-inspectors.json
geth.json