substream: Fix inbound bandwidth metering#499
Merged
Conversation
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
dmitry-markin
approved these changes
Dec 11, 2025
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)
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.
This PR fixes the bandwidth metering for TCP and websocket substreams.
The
poll_readimplementation was reporting too many bytes for metering:self.bandwidth_sink.increase_inbound(buf.filled().len())not only with the bytes that we have extracted from the socket, but with the whole buffer lengthCloses: #490