-
Notifications
You must be signed in to change notification settings - Fork 653
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
feat: parallel partial witness handling in the partial witness actor #12656
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #12656 +/- ##
=======================================
Coverage 70.55% 70.56%
=======================================
Files 847 847
Lines 172685 172777 +92
Branches 172685 172777 +92
=======================================
+ Hits 121845 121922 +77
- Misses 45736 45757 +21
+ Partials 5104 5098 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
)? { | ||
self.forward_state_witness_part(partial_witness)?; | ||
} | ||
self.partial_witness_spawner.spawn("handle_partial_encoded_state_witness", move || { | ||
// Validate the partial encoded state witness and forward the part to all the chunk validators. | ||
match validate_partial_encoded_state_witness( | ||
epoch_manager.as_ref(), | ||
&partial_witness, | ||
&signer, | ||
runtime_adapter.store(), | ||
) { | ||
Ok(true) => { | ||
network_adapter.send(PeerManagerMessageRequest::NetworkRequests( | ||
NetworkRequests::PartialEncodedStateWitnessForward( | ||
target_chunk_validators, | ||
partial_witness, | ||
), | ||
)); | ||
} |
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.
@shreyan-gupta it seems that we do not store the first partial witness received from the chunk producer and rebuild the state witness from the forwarded ones. While storing 1 partial witness faster won't make much of a difference, I was wandering if this was intended or if I missed something?
The PR unblocks the main thread of the
PartialWitnessActor
by detaching the handling of the partial witnesses to separate threads.This results in a considerable reduction in the distribution latency of the state witness:
The image originates from a forknet experiment with 50 nodes, with each state witness artificially padded to reach a size of 30 MB.