Skip to content

Added CID filtering to Bitswap server#10416

Merged
bkontur merged 35 commits intomasterfrom
cid_filtering
Dec 2, 2025
Merged

Added CID filtering to Bitswap server#10416
bkontur merged 35 commits intomasterfrom
cid_filtering

Conversation

@x3c41a
Copy link
Copy Markdown
Contributor

@x3c41a x3c41a commented Nov 25, 2025

Relates to paritytech/litep2p#482

TODO:

  • bump new litep2p version once it's released

Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
@x3c41a x3c41a marked this pull request as draft November 25, 2025 13:19
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs
@x3c41a x3c41a marked this pull request as ready for review November 26, 2025 09:39
@x3c41a x3c41a requested a review from bkontur November 26, 2025 09:52
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment on lines +91 to +95
let version_num: u64 = cid.version().into();
let size = cid.hash().size() as usize;
let code = cid.hash().code();
let cid_str = cid.to_string();
self.is_valid_cid(version_num, size, code, cid_str)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let version_num: u64 = cid.version().into();
let size = cid.hash().size() as usize;
let code = cid.hash().code();
let cid_str = cid.to_string();
self.is_valid_cid(version_num, size, code, cid_str)
self.is_cid_supported(&cid)

Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
Comment thread substrate/client/network/src/litep2p/shim/bitswap.rs Outdated
@bkontur bkontur added the T0-node This PR/Issue is related to the topic “node”. label Dec 2, 2025
Comment thread substrate/client/network/Cargo.toml Outdated
Comment thread substrate/client/network/src/bitswap/mod.rs Outdated
Comment thread substrate/client/network/src/bitswap/mod.rs Outdated
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/19854412073
Failed job name: run-frame-omni-bencher

1 similar comment
@paritytech-workflow-stopper
Copy link
Copy Markdown

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/19854412073
Failed job name: run-frame-omni-bencher

Comment thread substrate/client/network/src/bitswap/mod.rs Outdated
@bkontur bkontur enabled auto-merge December 2, 2025 13:28
Comment thread prdoc/pr_10416.prdoc Outdated
@bkontur bkontur added this pull request to the merge queue Dec 2, 2025
Merged via the queue into master with commit c5560a2 Dec 2, 2025
250 of 254 checks passed
@bkontur bkontur deleted the cid_filtering branch December 2, 2025 16:00
@bkontur bkontur added the A4-backport-stable2512 Pull request must be backported to the stable2512 release branch label Dec 3, 2025
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2512:

paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Dec 3, 2025
Relates to paritytech/litep2p#482

TODO:
- [x] bump new litep2p version once it's released

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
(cherry picked from commit c5560a2)
bkontur added a commit that referenced this pull request Dec 9, 2025
Backport #10416 into `stable2512` from x3c41a.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: Andrii <ndk@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2512 Pull request must be backported to the stable2512 release branch T0-node This PR/Issue is related to the topic “node”.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants