Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

feat: Replace wnfs-namefilter with deterministic-bloom. Fixes #626 #644

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 40 additions & 103 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async-stream = { version = "0.3" }
axum = { version = "^0.6.18" }
bytes = { version = "^1" }
cid = { version = "0.10" }
deterministic-bloom = { version = "0.1.0" }
directories = { version = "5" }
fastcdc = { version = "3.1" }
futures = { version = "0.3" }
Expand Down Expand Up @@ -64,8 +65,6 @@ wasm-bindgen-test = { version = "^0.3" }
wasm-bindgen-futures = { version = "^0.4" }
wasm-streams = { version = "0.3.0" }
web-sys = { version = "0.3" }
# TODO(#626): Migrate off of this crate
wnfs-namefilter = { version = "0.1.23" }

[profile.release]
opt-level = 'z'
Expand Down
2 changes: 1 addition & 1 deletion rust/noosphere-gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tower = { workspace = true }
tower-http = { workspace = true, features = ["cors", "trace"] }
async-trait = "~0.1"
async-stream = { workspace = true }
wnfs-namefilter = { workspace = true }
deterministic-bloom = { workspace = true }

url = { workspace = true, features = ["serde"] }
mime_guess = "^2"
Expand Down
4 changes: 2 additions & 2 deletions rust/noosphere-gateway/src/worker/syndication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use tokio::{
use tokio_stream::StreamExt;
use url::Url;

use deterministic_bloom::const_size::BloomFilter;
use iroh_car::{CarHeader, CarWriter};
use wnfs_namefilter::BloomFilter;

/// A [SyndicationJob] is a request to syndicate the blocks of a _counterpart_
/// sphere to the broader IPFS network.
Expand Down Expand Up @@ -198,7 +198,7 @@ where
// TODO(#176): We need to build-up a list of blocks that aren't
// able to be loaded so that we can be resilient to incomplete
// data when syndicating to IPFS
syndicated_blocks.add(&cid.to_bytes());
syndicated_blocks.insert(&cid.to_bytes());

let block = db.require_block(&cid).await?;

Expand Down