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

Periodic Bootstraps #229

Closed
wants to merge 12 commits into from
Closed

Periodic Bootstraps #229

wants to merge 12 commits into from

Conversation

momosh-ethernal
Copy link
Contributor

This PR adds periodic bootstraps, as per libp2p KAD specification Intervals are part of the LC configuration.

Other changes:

  • keep track of the bootstrap process through implemented state struct
  • refactored relay reservation process
  • refactored KAD Put Batch command to support multiple async commands

@codecov-commenter
Copy link

codecov-commenter commented Jun 27, 2023

Codecov Report

Patch coverage: 4.47% and project coverage change: -0.45% ⚠️

Comparison is base (f5cbfef) 27.69% compared to head (4ae038f) 27.24%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #229      +/-   ##
==========================================
- Coverage   27.69%   27.24%   -0.45%     
==========================================
  Files          22       22              
  Lines        5839     5938      +99     
==========================================
+ Hits         1617     1618       +1     
- Misses       4222     4320      +98     
Files Changed Coverage Δ
src/main.rs 0.42% <0.00%> (+<0.01%) ⬆️
src/network/client.rs 0.00% <0.00%> (ø)
src/network/event_loop.rs 0.00% <0.00%> (ø)
src/network/mod.rs 0.00% <0.00%> (ø)
src/types.rs 19.73% <30.00%> (+0.40%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from develop to main June 28, 2023 07:49
.gitignore Show resolved Hide resolved
README.md Show resolved Hide resolved
Comment on lines +157 to +161
for cmd in commands {
if self.sender.send(cmd).await.is_err() {
return NumSuccPut(0);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this block if there are more than 100 batches, since its not in separate thread, receive will not happen until everything is sent?

};
// drop tx manually,
// ensure that only senders in spawned threads are still in use
drop(tx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if we move first reference into separate thread this won't be needed.

Comment on lines +307 to +309
.filter(|(_, qd)| {
!matches!(qd.status, QueryStatus::Pending)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe simpler qd.status != QueryStatus::Pending?

Comment on lines +316 to +318
.filter(|(_, &qd)| {
matches!(qd.status, QueryStatus::Succeeded)
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here since there is no need for complex pattern match?

@momosh-ethernal momosh-ethernal deleted the periodic-bootstrap branch August 15, 2023 10:08
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.

3 participants