Skip to content
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

Clear stateManager cache after setStateRoot #420

Merged
merged 2 commits into from
Jan 16, 2019

Conversation

mattdean-digicatapult
Copy link
Contributor

Fixes #417

Clears the stateManager cache after setting the state root such that stale values are not returned.

There's an additional problem whereby the empty trie root is apparently not included in the merkle-patricia-tree even when this is constructed empty. An additional check has been added to prevent this causing an error in setStateRoot, though I wonder if this should instead be changed in the merkle-patricia-tree.

@coveralls
Copy link

coveralls commented Jan 15, 2019

Coverage Status

Coverage increased (+0.08%) to 90.487% when pulling 784cfeb on state-manager-clear-cache-after-set-state-root into fcf6eb7 on master.

@holgerd77 holgerd77 force-pushed the state-manager-clear-cache-after-set-state-root branch from 7509cb2 to 784cfeb Compare January 16, 2019 09:31
Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks @davidmurdoch for working this out and @mattdean-digicatapult for the quick reaction on this!

@holgerd77 holgerd77 merged commit 09b8bfb into master Jan 16, 2019
@holgerd77 holgerd77 deleted the state-manager-clear-cache-after-set-state-root branch January 16, 2019 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible bug in setStateroot and caching
4 participants