-
Notifications
You must be signed in to change notification settings - Fork 205
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
Fix snapshots manager #5764
Fix snapshots manager #5764
Conversation
if !trieStorageManager.IsSnapshotSupported() { | ||
log.Debug("skipping snapshot as the snapshot is not supported by the current trieStorageManager", |
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 thinking if ShouldTakeSnapshot
can be used instead of adding IsSnapshotSuppoted
method. for trie storage manager without snapshot ShouldTakeSnapshot
already returns false.
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.
The reason I have added the new function is that the original trieStorageManager that supports snapshotting has logic inside the ShouldTakeSnapshot
. And that logic we want to execute after the node steps into the new epoch. So it's kind of a chicken-and-egg problem without the new function.
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.
It won't work as it is right now. There are a few things that need to be set before ShouldTakeSnapshot
is called if the snapshots are enabled. Will refactor in a future PR to merge these 2 funcs.
if !trieStorageManager.IsSnapshotSupported() { | ||
log.Debug("skipping snapshot as the snapshot is not supported by the current trieStorageManager", |
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.
It won't work as it is right now. There are a few things that need to be set before ShouldTakeSnapshot
is called if the snapshots are enabled. Will refactor in a future PR to merge these 2 funcs.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## rc/v1.6.0 #5764 +/- ##
==========================================
Coverage 80.14% 80.14%
==========================================
Files 708 708
Lines 94017 94027 +10
==========================================
+ Hits 75347 75359 +12
+ Misses 13326 13325 -1
+ Partials 5344 5343 -1 ☔ View full report in Codecov by Sentry. |
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.
Tested on Public Testnet Stack
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.
Normal allin test: master-e134e5314d -> fix-snapshots-manager-81f69cfdee
--- Specific errors ---
block hash does not match 12439
wrong nonce in block 4188
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0
/------/
--- Statistics ---
Nr. of all ERRORS: 22
Nr. of all WARNS: 9673
Nr. of new ERRORS: 21
Nr. of new WARNS: 132
Nr. of PANICS: 0
/------/
Reasoning behind the pull request
SnapshotsEnabled = false
andPeerStatePruningEnabled = true
The snapshotting process waited for epoch change & snapshot markup even if the trie storage manager did not perform snapshots. The result was that the memoryEvictionWaitingList started dropping stored keys so the correct state pruning was not performed.
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?