feat: Bitswap Py-cid migration Phase 3 #1247
Open
ItshMoh wants to merge 10 commits intolibp2p:mainfrom
Open
Conversation
Contributor
Author
|
Here the ci fail is flaky, I ran the failing test |
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.
Issue #1246
Summary
It applies shared CID normalization helpers across Bitswap modules and example flows so mixed CID input types are accepted at boundaries, while keeping current byte-based wire/storage behavior stable.
work done
libp2p/bitswap/block_store.pyCIDInputand normalize withcid_to_bytes(...).bytes.libp2p/bitswap/messages.pyCIDInput.bytesbefore assignment.libp2p/bitswap/client.pyadd_block,get_block,want_block,have_block,cancel_want) acceptCIDInput.libp2p/bitswap/dag.pyfetch_file(...)andget_file_info(...)acceptCIDInputand normalize at entry.libp2p/bitswap/dag_pb.pyLinkacceptsCIDInputand normalizes non-byte inputs.bytesremain accepted as-is for backward compatibility.create_file_node(...)/create_directory_node(...)support mixed CID input tuples.Logging / text representation
.hex()usage in migrated paths with canonical CID text display where appropriate.Example CLI migration
examples/bitswap/bitswap.py--cidnow accepts canonical CID text,/ipfs/...form, and hex fallback.