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
Check authority on flush #924
Conversation
@@ -510,6 +516,12 @@ impl SourceChain { | |||
let entries = scratch.drain_entries().collect::<Vec<_>>(); | |||
SourceChainResult::Ok((headers, ops, entries)) | |||
})?; | |||
let mut ops_to_self_publish = HashSet::with_capacity(ops.len()); | |||
for op in &ops { | |||
if network.authority_for_hash(op.0.dht_basis().clone()).await? { |
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 think it might be worth the complexity to join_all these so they can run in parallel instead of serially.
As it is, the cpu will have to switch off between the network ghost_actor task and this one, where, if they are all sent at once, ghost_actor internally does a ready_chunks so the cpu can stay on that code until complete.
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.
Maybe it makes more sense to just make authority for has take a vec? So we can batch the call?
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.
Sure, I like that too 👍
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.
Q about async in parallel, otherwise looks good
No description provided.