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

StatesDumper: fix bug with missing states dumps #568

Merged
merged 3 commits into from
Mar 23, 2021

Conversation

AnnaShaleva
Copy link
Member

Problem

StatesDumper does not save states dumps (because of #517 changes).

Solution

We need to put states to bs_cache even if it's empty.

AnnaShaleva and others added 3 commits March 19, 2021 13:29
It didn't save anything to cache because bs_cache was always empty.
As a result, there were no storage dumps on disc. Fixed.
We already have created path inside the HandlePaths method, no need to
create it one more time.
@superboyiii
Copy link
Member

@shargon Need your review.

@superboyiii superboyiii merged commit b61ec2c into neo-project:master Mar 23, 2021
joeqian10 pushed a commit to joeqian10/neo-modules that referenced this pull request Apr 7, 2021
* StatesDumper: fix OnPersistStorage

It didn't save anything to cache because bs_cache was always empty.
As a result, there were no storage dumps on disc. Fixed.

* StatesDumper: fix OnCommitStorage

We already have created path inside the HandlePaths method, no need to
create it one more time.

* fix-format

Co-authored-by: superboyiii <[email protected]>
@@ -90,7 +89,12 @@ private void OnPersistStorage(uint network, DataCache snapshot)
bs_item["block"] = blockIndex;
bs_item["size"] = array.Count;
bs_item["storage"] = array;
if (!bs_cache.TryGetValue(network, out JArray cache))
Copy link
Member

Choose a reason for hiding this comment

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

I think it's here which cause #736 since cache will be cleared when node exit.

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.

3 participants