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

seed: consider if tracking relationship was already established #762

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

kim
Copy link
Contributor

@kim kim commented Aug 19, 2021

When calling Node::track_project, it might very well be that the
project/peer is already tracked, which would result in unnecessary
broadcast traffic. Thus, don't emit any events in this case.

Also, change the order of track and replicate to ensure we
do actually fetch the newly-tracked peer's view. Additionally, we can
skip replicate if we already tracked the peer, as subsequent broadcast
messages won't be considered uninteresting.

Ref #734
Signed-off-by: Kim Altintop [email protected]

@kim kim requested a review from a team as a code owner August 19, 2021 08:30
@kim kim force-pushed the kim/seed-check-already-tracked branch from f937165 to 3c76aef Compare August 19, 2021 08:31
seed/src/lib.rs Outdated Show resolved Hide resolved
@kim kim requested review from cloudhead and geigerzaehler August 19, 2021 08:32
FintanH
FintanH previously approved these changes Aug 19, 2021
Copy link
Contributor

@FintanH FintanH left a comment

Choose a reason for hiding this comment

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

Nice, that makes sense!

cloudhead
cloudhead previously approved these changes Aug 19, 2021
Copy link
Contributor

@cloudhead cloudhead left a comment

Choose a reason for hiding this comment

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

Yes!

@kim kim dismissed stale reviews from cloudhead and FintanH via c4e9212 August 19, 2021 08:45
@kim
Copy link
Contributor Author

kim commented Aug 19, 2021

Please pull out your truth tables and verify I got the booleans right

When calling `Node::track_project`, it might very well be that the
project/peer is already tracked, which would result in unnecessary
broadcast traffic. Thus, don't emit any events in this case.

Also, change the order of `track` and `replicate` to ensure we
do actually fetch the newly-tracked peer's view. Additionally, we can
skip `replicate` if we already tracked the peer, as subsequent broadcast
messages won't be considered uninteresting.

Ref #734
Signed-off-by: Kim Altintop <[email protected]>
@kim kim force-pushed the kim/seed-check-already-tracked branch from d5f4db8 to 4996751 Compare August 19, 2021 09:06
@kim kim merged commit 4996751 into master Aug 19, 2021
@kim kim deleted the kim/seed-check-already-tracked branch August 19, 2021 09:07
@github-pages github-pages bot temporarily deployed to github-pages August 19, 2021 09:07 Inactive
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