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

Add hook to force committing state to disk #280

Draft
wants to merge 15 commits into
base: snap_sync
Choose a base branch
from

Conversation

magicxyyz
Copy link
Contributor

No description provided.

@cla-bot cla-bot bot added the s label Jan 22, 2024
@magicxyyz magicxyyz changed the base branch from master to snap_sync January 22, 2024 16:36
core/blockchain.go Outdated Show resolved Hide resolved
bc.numberOfBlocksToSkipStateSaving = bc.cacheConfig.MaxNumberOfBlocksToSkipStateSaving
bc.amountOfGasInBlocksToSkipStateSaving = bc.cacheConfig.MaxAmountOfGasToSkipStateSaving
return bc.triedb.Commit(root, false)
}
Copy link
Contributor

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

Copy link
Contributor

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants