Clear storage cell / trie without reading cell's value first fails#9239
Merged
damian-orzechowski merged 4 commits intomasterfrom Sep 9, 2025
Merged
Clear storage cell / trie without reading cell's value first fails#9239damian-orzechowski merged 4 commits intomasterfrom
damian-orzechowski merged 4 commits intomasterfrom
Conversation
benaadams
reviewed
Sep 3, 2025
asdacap
reviewed
Sep 4, 2025
| worldState.Set(new StorageCell(TestItem.AddressA, 1), _values[11]); | ||
| worldState.Set(new StorageCell(TestItem.AddressA, 2), _values[12]); | ||
| worldState.Commit(Prague.Instance); | ||
| worldState.CommitTree(1); |
Contributor
There was a problem hiding this comment.
Looks like it will also fail previously if Reset() is called after the commit. Previously the blockchange and the storage tree is separated, now its the same causing the CommitTree to have an implicit reset.
Contributor
Author
There was a problem hiding this comment.
Yes, that's correct. Recreated the same behaviour with calling Reset() - though with calling Reset(false) works fine.
asdacap
approved these changes
Sep 8, 2025
benaadams
approved these changes
Sep 8, 2025
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.
Fixes Closes Resolves #
Fixes an issue when you set empty value (clear) for a storage cell that was not previously read (using
Get). In such case, new value (empty) would not be set as code assumes non existent values as empty, which in turn fails on value comparison (new vs old) when commiting changes.Changes
PerContractStatewill load value from tree if not found in block cache when saving a new changeTypes of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs. Remove if not applicable.Requires explanation in Release Notes