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

Limit data sent after dht differences #94

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

ThetaSinner
Copy link
Member

@ThetaSinner ThetaSinner commented Feb 3, 2025

Applies the same logic that we have for "new ops" to the op ids returned by the DHT diff process. I believe this is necessary regardless of whether it's a complete solution to the "new agent joining an existing network" problem.

By leaving this unlimited, we'd just return the entire data set in one batch during the first gossip round with new peers. That's too much load on the peer you happen to hit. As I'm writing, I'm wondering if we should enforce a maximum value for this that peers can request...

By limiting how much data we get in one go, we aren't doing anything too complicated like trying to decide which sectors we want data from or which time slices, when both are sparse and we'd get unpredictable results that way. Like this, we do our best to sync. Then we have to hope that between one gossip round and the next, the other peer will fetch enough to reduce the number of sectors/slices that produce a diff on the next round. If it's not that quick, then over time that is the effect.

As soon as we stop having a diff for a time slice or a sector, we'll be able to progress to new areas of the DHT in a natural way. There will be some duplicate requests of op ids but that's a reasonable thing to have happen I think. it's part of learning about the network.

This change really needs tests that exercise the 3 different paths

  • Limit on "new ops"
  • Limit on "disc diff" when part of the limit was consumed by "new ops"
  • Limit on "ring diff" when part of the limit was consumed by "new ops"

But adding those tests requires modifying the testing in the same ways as #85

@ThetaSinner ThetaSinner marked this pull request as ready for review February 3, 2025 20:17
@ThetaSinner ThetaSinner requested a review from a team February 3, 2025 20:36
Copy link
Collaborator

@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.

woot, looks good.

As I'm writing, I'm wondering if we should enforce a maximum value for this that peers can request

Agree, just a local config, and we can std::cmp::min() the requested size and our max config.

@ThetaSinner ThetaSinner merged commit 2a9f534 into main Feb 3, 2025
5 checks passed
@ThetaSinner ThetaSinner deleted the limit-data-sent-after-dht-differences branch February 3, 2025 23:05
@ThetaSinner ThetaSinner mentioned this pull request Feb 4, 2025
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.

2 participants