[pallet-revive] only record diff if value changed#8881
Merged
Conversation
Contributor
Author
|
/cmd prdoc --audience runtime_dev --bump patch |
activecoder10
approved these changes
Jun 17, 2025
…time_dev --bump patch'
| .storage | ||
| .insert(key, new_value.map(|v| v.to_vec().into())); | ||
| } else { | ||
| self.trace.1.entry(self.current_addr).or_default().storage.remove(&key); |
Contributor
There was a problem hiding this comment.
Is old_value the storage slot value before this write or before the transaction?
In the former case we should not remove it if there was a write before in this transaction that changed the value.
Contributor
Author
There was a problem hiding this comment.
old_value is the value that will go in the pre of the diff trace, that 's the value before the transaction.
We only set it the first time by using .or_insert_with(|| old_value.map(Into::into)); map API
Contributor
There was a problem hiding this comment.
Ah okay. Then all good!
TorstenStueber
approved these changes
Jun 17, 2025
xermicus
approved these changes
Jun 18, 2025
alvicsam
pushed a commit
that referenced
this pull request
Oct 17, 2025
Only record storage change in diff mode if the value differ from the initial one. Previous implementation would report a diff for example when the old value was written again. Updated tests in paritytech/evm-test-suite#96 --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@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.
Only record storage change in diff mode if the value differ from the initial one.
Previous implementation would report a diff for example when the old value was written again.
Updated tests in paritytech/evm-test-suite#96