-
Notifications
You must be signed in to change notification settings - Fork 812
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
reset cache after heal #5266
reset cache after heal #5266
Conversation
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
|
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.
LGTM, naming and documenting intent is probably wise considering the effort went into making bonsai more dev friendly
@@ -338,6 +338,9 @@ public TrieLogManager getTrieLogManager() { | |||
@Override | |||
public void setArchiveStateUnSafe(final BlockHeader blockHeader) { |
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.
this method name should change to reflect its use. IMO it isn't setting the archive unsafe for use like the name implies, but rather is resetting the archive cache and adding the new pivot as the only entry. Perhaps resetArchiveStateTo(BlockHeader)
Similarly, BonsaiWorldState.setArchiveUnsafe should be something more along the lines of resetWorldStateTo(BlockHeader)
These methods could use javadoc describing the intent
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.
updated the code
Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
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.
🚢
* reset cache after heal Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
* reset cache after heal Signed-off-by: Karim TAAM <karim.t2am@gmail.com>
PR description
We found that sometimes after the heal we still have old snapshot in the cache because after the clearTrieLog some transaction pool thread are still running
The fix is to clear the cache after the snapsync and also add a snapshot of the new head
Fixed Issue(s)