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

do not send cancel message to peer that sent block #784

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

gammazero
Copy link
Contributor

The serving peer cleans the client's wantlint after serving the block, making sending CANCEL to the serving peer redundant. So, exclude the serving peer when sending cancels after receiving a block.

Closes #694

The serving peer cleans the client's wantlint after serving the block, making sending CANCEL to the serving peer redundant. So, exclude the serving peer when sending cancels after receiving a block.

Closes #694
@gammazero gammazero requested a review from a team as a code owner January 8, 2025 19:10
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.52%. Comparing base (b7d0d20) to head (87c8c91).
Report is 1 commits behind head on main.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #784      +/-   ##
==========================================
+ Coverage   60.50%   60.52%   +0.02%     
==========================================
  Files         245      245              
  Lines       31138    31139       +1     
==========================================
+ Hits        18840    18847       +7     
+ Misses      10620    10618       -2     
+ Partials     1678     1674       -4     
Files with missing lines Coverage Δ
bitswap/client/internal/peermanager/peermanager.go 91.85% <100.00%> (ø)
...wap/client/internal/peermanager/peerwantmanager.go 88.54% <100.00%> (+0.03%) ⬆️
bitswap/client/internal/session/session.go 90.56% <ø> (+0.37%) ⬆️
...p/client/internal/sessionmanager/sessionmanager.go 100.00% <100.00%> (ø)

... and 7 files with indirect coverage changes

@gammazero gammazero changed the title do not send CANCEL to peer we got block from do not send cancel message to peer that sent block Jan 8, 2025
Copy link
Contributor

@hsanjuan hsanjuan left a comment

Choose a reason for hiding this comment

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

So we are sure that we have not requested the same CIDs to the same peer via some other session etc. right?

My main worry would be we start leaking something.

@Wondertan
Copy link
Member

PeerManager also takes care of deduplication if multiple session want the same data

@gammazero gammazero merged commit 720d617 into main Jan 16, 2025
13 checks passed
@gammazero gammazero deleted the exclude-peer-from-cancels branch January 16, 2025 16:17
@lidel lidel mentioned this pull request Jan 16, 2025
60 tasks
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.

bitswap: Don't send CANCEL to peer we got block from
3 participants