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

chore: don't send "haves" to unapproved peers #692

Closed
wants to merge 3 commits into from

Conversation

EvanHahn
Copy link
Contributor

This avoids leaking "have" data to unapproved peers. Most likely, this is peers with the project key that aren't in the project.

Partly addresses #268.

This avoids leaking "have" data to unapproved peers. Most likely, this
is peers with the project key that aren't in the project.

Partly addresses [#268].

[#268]: #268
@EvanHahn EvanHahn requested a review from gmaclennan May 29, 2024 16:13
Comment on lines +30 to +33
/**
* TODO: Use a more precise type.
* @typedef {any} Peer
*/
Copy link
Contributor Author

@EvanHahn EvanHahn May 29, 2024

Choose a reason for hiding this comment

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

I was adding a couple of new types that referenced peers. These are currently typed with any. Though I think we should use a more exact type in a followup PR, I think this makes it a little more clear and is not a regression.

@gmaclennan
Copy link
Member

Unfortunately I think this won't work, things are more complicated...

There are many scenarios where a peer's sync capabilities are not known when two peers first connect, e.g. peer A invites peer B; peer A disconnects; peer C comes along and connects to peer B. The changes in this PR will result in peer C refusing to sync, and will require a disconnect and reconnect to fix. I

For this reason event-based updates to capabilities are needed first, so that sync can be enabled once the capability data syncs, e.g. as outlined in #268.

@EvanHahn EvanHahn removed the request for review from gmaclennan July 4, 2024 14:37
@EvanHahn EvanHahn closed this Jul 30, 2024
@EvanHahn EvanHahn deleted the dont-send-haves-to-blocked-peers branch July 30, 2024 18:04
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