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

Check authority on flush #924

Merged
merged 5 commits into from Sep 24, 2021
Merged

Check authority on flush #924

merged 5 commits into from Sep 24, 2021

Conversation

freesig
Copy link
Contributor

@freesig freesig commented Aug 12, 2021

No description provided.

@@ -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? {
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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 👍

Copy link
Contributor

@neonphog neonphog left a 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

@freesig freesig merged commit 98b36b8 into develop Sep 24, 2021
@freesig freesig deleted the check-authority-on-flush branch September 24, 2021 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants