-
Notifications
You must be signed in to change notification settings - Fork 2k
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 blocks in batches #19003
base: main
Are you sure you want to change the base?
Add blocks in batches #19003
Conversation
this is the same as |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…ch (avoiding the pipeline stall every 64 blocks)
63abf4e
to
20d7681
Compare
yes, there was overlap with that PR. I've rebased ths now |
Conflicts have been resolved. A maintainer will review the pull request shortly. |
) | ||
await full_node.peak_post_processing_2(peak_fb, None, state_change_summary, ppp_result) | ||
# vs is updated by the call to add_block_batch() | ||
success, state_change_summary = await full_node.add_block_batch(blocks, PeerInfo("0.0.0.0", 0), fork_info, vs) |
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.
we call add_blocks_in_batches sometimes with huge lists of of blocks since we expect it to batch them into validation, this seems to diverge more then what we do in the full node
also this doesn't add blocks in batches anymore, it just adds all the blocks so the name is misleading
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 number of blocks to be validated concurrently is limited by the size of the ThreadPoolExecutor
and blocks are streamed into its job queue. So I don't think the size of the list is a problem, we'll do our best to maximize the available threads at all times, without stalling the pipeline every 64 blocks.
yes, I agree that this makes the name misleading. Do you have a suggestion for a better name? I think the name add_blocks()
may be a bit too generic
These commits can be reviewed one at a time.
Purpose:
Simplify
add_blocks_in_batches()
to add all blocks in a single batch (this is a tiny performance boost). This is a test function.Simplify
FullNode.add_block_batch()
by removing an unused (left over) parameter.Current Behavior:
No change in behavior
New Behavior:
No change in behavior
Test
running
Before and after this change gives a small improvement from 42.86s -> 40.62s