-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add hook to force committing state to disk #280
base: snap_sync
Are you sure you want to change the base?
Conversation
core/blockchain.go
Outdated
bc.numberOfBlocksToSkipStateSaving = bc.cacheConfig.MaxNumberOfBlocksToSkipStateSaving | ||
bc.amountOfGasInBlocksToSkipStateSaving = bc.cacheConfig.MaxAmountOfGasToSkipStateSaving | ||
return bc.triedb.Commit(root, 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.
I want the storing-from-force to happen together with storing here:
if bc.gcproc > flushInterval && prevEntry != nil && !archiveNode
So the hook should check gcproc, and if it returns yes gcproc should also be updated.
Hook should probably also get archiveNode (or it can get that info directly)
need to make sure we don't skip over the block in partial-archive and in the for !bc.triegc.Empty() {
loop
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.
not sure it's the best solution, but my current thought is that if the hook is null we use a function that replicates the current behavior for hook (tests bc.gcproc > flushInterval)
This reverts commit 1ac9c79.
No description provided.