fix(bitswap): ignore identity CIDs instead of killing connection#1117
Merged
fix(bitswap): ignore identity CIDs instead of killing connection#1117
Conversation
third-party implementations may not be aware that identity CIDs should not appear in Bitswap wantlists, and their users should not be punished with dropped connections for naive CID handling. unify behavior with oversized CIDs to reduce connection churn: silently ignore and continue processing the rest of the message. - engine.go: replace error return with debug log + continue - engine_test.go: flip assertions to verify no disconnect, check identity CID is silently dropped from wantlist
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1117 +/- ##
==========================================
- Coverage 62.50% 62.45% -0.06%
==========================================
Files 260 260
Lines 26173 26174 +1
==========================================
- Hits 16359 16346 -13
- Misses 8130 8139 +9
- Partials 1684 1689 +5
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
- restructure into subtests covering want-block, want-have, cancel, and all-identity-CIDs edge case - verify the specific CID that remains, not just the count - verify identity cancel does not corrupt existing wantlist entries - use t.Context() instead of context.Background()
- restructure into subtests covering want-block, want-have, cancel, and all-oversized edge case - verify the specific CID that remains, not just the count - verify oversized cancel does not corrupt existing wantlist entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
third-party implementations may not be aware that identity CIDs should not appear in Bitswap wantlists, and their users should not be punished with dropped connections for naive CID handling.
unify behavior with oversized CIDs to reduce connection churn: silently ignore and continue processing the rest of the message.