-
Notifications
You must be signed in to change notification settings - Fork 118
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
[chain] Defer State Root Generation #425
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 tasks
Tested flow for processing:
|
Hitting error case:
|
Need to see at last 1 block past sync target to be able to handle verify:
what is going on?
|
* add TODO * remove parent fetch * remove parent block from innerVerify * add verify context * cleanup VerifyContext call * working on clarifying GetVerifyContext/View * keep cleaning up * add specific conditional for height * update verification context handling * update wording in view to explain why we need accepted handling * add more comments to main path * update interface * use preferred block directly * drop verify * fix lint * update state manager * add note about GetBlockIDByHeight * finish comment about handling blocks * make sure keys in set * add todo for genesis handling * update genesis block handling * add more logs * e2e passing * address chain nits * better comment genesis * extra VM comments * add TODO * clarify note about verification status
patrick-ogrady
changed the title
[chain] Defer Root Generation
[chain] Defer State Root Generation
Sep 1, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves: #399
TODO
block.StatefulBlock
commentx/merkledb
to prevent thrashing: [x/merkledb] Add Configuration forRootGenConcurrency
avalanchego#1936ensure only 1 root is being generated at a time (merkledb may try to generate multiple roots at once, exceeding the CPU limit) -> run queue invm
(need to prevent out-of-band calls toGetMerkleRoot
)ensure 1 block above sync is added (need parent block to verify a block) or allow for fetching missing blocks in certain circumstances over the wireput all data required to verify a block in state (so don't need parent block)Block.Build
LatencyWe use
block.Build
for this comparison because all signatures are pre-verified (when a tx is added to the mempool) and we just want to test the savings when root generation is deferred with no other async jobs running (i.e. tx verification).Before
After (~22.9% reduction)