Skip to content

bitswap_unstable_stream added#3264

Open
michalkucharczyk wants to merge 18 commits into
mainfrom
mku-bitswap-stream
Open

bitswap_unstable_stream added#3264
michalkucharczyk wants to merge 18 commits into
mainfrom
mku-bitswap-stream

Conversation

@michalkucharczyk
Copy link
Copy Markdown
Contributor

@michalkucharczyk michalkucharczyk commented May 19, 2026

This PR adds bitswap_unstable_stream method defined in paritytech/json-rpc-interface-spec#186

It also improves the e2e test for bitswap_unstable_get which was added in #3240

@michalkucharczyk michalkucharczyk marked this pull request as draft May 19, 2026 13:18
@michalkucharczyk michalkucharczyk changed the title Mku bitswap stream bitswap_unstable_stream added May 19, 2026
format!("Bitswap stream subscription: {} cids", cids.len())
);

match me.bitswap_service.bitswap_stream(cids).await {
Copy link
Copy Markdown
Contributor

@lrubasze lrubasze May 27, 2026

Choose a reason for hiding this comment

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

Not sure if I'm right but is client connection blocked while awaiting here?

Copy link
Copy Markdown
Contributor Author

@michalkucharczyk michalkucharczyk May 29, 2026

Choose a reason for hiding this comment

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

The await covers only the synchronous handoff (parse_and_dedup + a channel send + a oneshot for the BatchId), not the actual Have broadcast or per-CID events - those flow later via the events-pump task pushed to background_tasks at line 1220 (light-base/src/json_rpc_service/background.rs).

The only backpressure could be the bitswap service's bounded inbound channel being saturated - I think this shall not happen.

Any ideas how to solve it in different way?

@michalkucharczyk michalkucharczyk marked this pull request as ready for review May 29, 2026 15:45
@michalkucharczyk michalkucharczyk requested a review from skunert May 29, 2026 18:28
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.

2 participants