Skip to content

types: Re-export cid's multihash to construct CID V1#491

Merged
bkontur merged 1 commit intomasterfrom
bko-reexport
Dec 2, 2025
Merged

types: Re-export cid's multihash to construct CID V1#491
bkontur merged 1 commit intomasterfrom
bko-reexport

Conversation

@bkontur
Copy link
Copy Markdown
Contributor

@bkontur bkontur commented Dec 2, 2025

For example in polkadot-sdk

-	use litep2p::types::multihash::Code;
+	use litep2p::types::{cid::{Cid as LiteP2pCid, multihash::Multihash as LiteP2pMultihash}, multihash::Code as LiteP2pMultihashCode};
 

-							block: cid::Cid::new_v1(
+							block: LiteP2pCid::new_v1(
 								0x70,
-								cid::multihash::Multihash::wrap(
-									u64::from(Code::Blake2b256),
+								LiteP2pMultihash::wrap(
+									u64::from(LiteP2pMultihashCode::Blake2b256),
 									&[0u8; 32],
 								)

Copy link
Copy Markdown
Collaborator

@lexnv lexnv left a comment

Choose a reason for hiding this comment

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

nit: since these PRs will eventually end up in the changelog, we could be a bit more specific with naming (ie, something like: types: Re-export multihash to construct CID V1)

@dmitry-markin
Copy link
Copy Markdown
Collaborator

We should eventually bump multihash in litep2p to the common version with cid.

@bkontur
Copy link
Copy Markdown
Contributor Author

bkontur commented Dec 2, 2025

We should eventually bump multihash in litep2p to the common version with cid.

that's what I exactly tried, but didn't push here, because there is more to bump with it :)

Let's do as a separate PR

@bkontur bkontur changed the title One more re-export to corectlly construct Cid::new_v1(codec: u64, hash: Multihash<S>) in downstream impls types: Re-export multihash to construct CID V1 Dec 2, 2025
@bkontur bkontur changed the title types: Re-export multihash to construct CID V1 types: Re-export cid's multihash to construct CID V1 Dec 2, 2025
@bkontur bkontur merged commit f1b4e0b into master Dec 2, 2025
8 checks passed
@bkontur bkontur deleted the bko-reexport branch December 2, 2025 13:24
lexnv added a commit that referenced this pull request Dec 16, 2025
## [0.12.3] - 2025-12-16

This release improves the robustness of the multistream-select
negotiation over WebRTC transport and fixes inbound bandwidth metering
on substreams. It also enhances the dialing success rate by improving
the transport dialing logic. Additionally, it re-exports CID's multihash
to facilitate the construction of CID V1.

### Changed

- transports: Improves the robustness and success rate of connection
dialing ([#495](#495))
- types: Re-export cid's multihash to construct CID V1
([#491](#491))

### Fixed

- fix: multistream-select negotiation on outbound substream over webrtc
([#465](#465))
- substream: Fix inbound bandwidth metering
([#499](#499))

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
github-merge-queue Bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Dec 17, 2025
## [0.12.3] - 2025-12-16

This release improves the robustness of the multistream-select
negotiation over WebRTC transport and fixes inbound bandwidth metering
on substreams. It also enhances the dialing success rate by improving
the transport dialing logic. Additionally, it re-exports CID's multihash
to facilitate the construction of CID V1.

### Changed

- transports: Improves the robustness and success rate of connection
dialing ([#495](paritytech/litep2p#495))
- types: Re-export cid's multihash to construct CID V1
([#491](paritytech/litep2p#491))

### Fixed

- fix: multistream-select negotiation on outbound substream over webrtc
([#465](paritytech/litep2p#465))
- substream: Fix inbound bandwidth metering
([#499](paritytech/litep2p#499))

cc @paritytech/sdk-node

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
paritytech-release-backport-bot Bot pushed a commit to paritytech/polkadot-sdk that referenced this pull request Dec 17, 2025
## [0.12.3] - 2025-12-16

This release improves the robustness of the multistream-select
negotiation over WebRTC transport and fixes inbound bandwidth metering
on substreams. It also enhances the dialing success rate by improving
the transport dialing logic. Additionally, it re-exports CID's multihash
to facilitate the construction of CID V1.

### Changed

- transports: Improves the robustness and success rate of connection
dialing ([#495](paritytech/litep2p#495))
- types: Re-export cid's multihash to construct CID V1
([#491](paritytech/litep2p#491))

### Fixed

- fix: multistream-select negotiation on outbound substream over webrtc
([#465](paritytech/litep2p#465))
- substream: Fix inbound bandwidth metering
([#499](paritytech/litep2p#499))

cc @paritytech/sdk-node

---------

Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit a12ec9c)
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.

4 participants