From 32534097ccd5dd7fa1fe80baf2e453d71a200d93 Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Thu, 22 Aug 2024 14:14:19 +0100 Subject: [PATCH 01/10] Add RbsrStore trait --- data-model/src/store.rs | 57 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/data-model/src/store.rs b/data-model/src/store.rs index c0d445a..2936c11 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -4,7 +4,7 @@ use ufotofu::{local_nb::Producer, nb::BulkProducer}; use crate::{ entry::AuthorisedEntry, - grouping::AreaOfInterest, + grouping::{AreaOfInterest, Range3d}, parameters::{AuthorisationToken, NamespaceId, PayloadDigest, SubspaceId}, LengthyAuthorisedEntry, LengthyEntry, Path, }; @@ -301,9 +301,62 @@ where /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. fn resume_subscription( + progress_id: u64, area: AreaOfInterest, ignore_incomplete_payloads: bool, ignore_empty_payloads: bool, - progress_id: Option, ) -> Result; } + +/// A [`Store`] capable of performing [3d range-based set reconciliation](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3_range_based_set_reconciliation). +pub trait RbsrStore +where + Self: Store, + N: NamespaceId, + S: SubspaceId, + PD: PayloadDigest, + AT: AuthorisationToken, +{ + /// Query which entries are [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by a [`Range3d`], returning a producer of [`LengthyAuthorisedEntry`]. + /// + /// If `will_sort` is `true`, entries will be sorted ascendingly by subspace_id first, path second. + /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. + /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. + fn query_range( + range: Range3d, + will_sort: bool, + ignore_incomplete_payloads: bool, + ignore_empty_payloads: bool, + ) -> Self::EntryProducer; + + /// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`Range3d`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function. + /// + /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. + /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. + fn subscribe_range( + range: Range3d, + ignore_incomplete_payloads: bool, + ignore_empty_payloads: bool, + ) -> Self::EventProducer; + + /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. + fn resume_range_subscription( + progress_id: u64, + range: Range3d, + ignore_incomplete_payloads: bool, + ignore_empty_payloads: bool, + ) -> Result; + + /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). + fn summarise(range: Range3d) -> FP; + + /// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would. + fn area_of_interest_to_range( + aoi: AreaOfInterest, + ) -> Range3d; + + /// Partition a [`Range3d`] into `K` parts, or return `None` if the given range cannot be split into `K` many parts (for instance because the range only includes a single entry). + fn partition_range( + range: Range3d, + ) -> Option<[Range3d; K]>; +} From ab45d832728f5fbafdcb29be83f074456a9bd8f9 Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Tue, 27 Aug 2024 12:09:20 +0100 Subject: [PATCH 02/10] Move RbsrStore to wgps crate --- Cargo.lock | 7 +++++ Cargo.toml | 2 +- data-model/src/store.rs | 53 -------------------------------------- wgps/Cargo.toml | 10 ++++++++ wgps/src/lib.rs | 57 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 75 insertions(+), 54 deletions(-) create mode 100644 wgps/Cargo.toml create mode 100644 wgps/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 7ee140e..4e5951c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -526,6 +526,13 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "wgps" +version = "0.1.0" +dependencies = [ + "willow-data-model", +] + [[package]] name = "willow-data-model" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index a6ef614..8bea355 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] -members = ["data-model", "earthstar", "encoding", "fuzz", "meadowcap"] +members = ["data-model", "earthstar", "encoding", "fuzz", "meadowcap", "wgps"] resolver = "2" [workspace.lints.clippy] diff --git a/data-model/src/store.rs b/data-model/src/store.rs index 2936c11..c9d86df 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -307,56 +307,3 @@ where ignore_empty_payloads: bool, ) -> Result; } - -/// A [`Store`] capable of performing [3d range-based set reconciliation](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3_range_based_set_reconciliation). -pub trait RbsrStore -where - Self: Store, - N: NamespaceId, - S: SubspaceId, - PD: PayloadDigest, - AT: AuthorisationToken, -{ - /// Query which entries are [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by a [`Range3d`], returning a producer of [`LengthyAuthorisedEntry`]. - /// - /// If `will_sort` is `true`, entries will be sorted ascendingly by subspace_id first, path second. - /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. - /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. - fn query_range( - range: Range3d, - will_sort: bool, - ignore_incomplete_payloads: bool, - ignore_empty_payloads: bool, - ) -> Self::EntryProducer; - - /// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`Range3d`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function. - /// - /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. - /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. - fn subscribe_range( - range: Range3d, - ignore_incomplete_payloads: bool, - ignore_empty_payloads: bool, - ) -> Self::EventProducer; - - /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. - fn resume_range_subscription( - progress_id: u64, - range: Range3d, - ignore_incomplete_payloads: bool, - ignore_empty_payloads: bool, - ) -> Result; - - /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). - fn summarise(range: Range3d) -> FP; - - /// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would. - fn area_of_interest_to_range( - aoi: AreaOfInterest, - ) -> Range3d; - - /// Partition a [`Range3d`] into `K` parts, or return `None` if the given range cannot be split into `K` many parts (for instance because the range only includes a single entry). - fn partition_range( - range: Range3d, - ) -> Option<[Range3d; K]>; -} diff --git a/wgps/Cargo.toml b/wgps/Cargo.toml new file mode 100644 index 0000000..7cdca46 --- /dev/null +++ b/wgps/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "wgps" +version = "0.1.0" +edition = "2021" + +[dependencies] +willow-data-model = { path = "../data-model", version = "0.1.0" } + +[lints] +workspace = true diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs new file mode 100644 index 0000000..f2a2d47 --- /dev/null +++ b/wgps/src/lib.rs @@ -0,0 +1,57 @@ +use willow_data_model::{ + grouping::{AreaOfInterest, Range3d}, + AuthorisationToken, NamespaceId, PayloadDigest, ResumptionFailedError, Store, SubspaceId, +}; + +/// A [`Store`] capable of performing [3d range-based set reconciliation](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3_range_based_set_reconciliation). +pub trait RbsrStore +where + Self: Store, + N: NamespaceId, + S: SubspaceId, + PD: PayloadDigest, + AT: AuthorisationToken, +{ + /// Query which entries are [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by a [`Range3d`], returning a producer of [`LengthyAuthorisedEntry`]. + /// + /// If `will_sort` is `true`, entries will be sorted ascendingly by subspace_id first, path second. + /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. + /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. + fn query_range( + range: Range3d, + will_sort: bool, + ignore_incomplete_payloads: bool, + ignore_empty_payloads: bool, + ) -> Self::EntryProducer; + + /// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`Range3d`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function. + /// + /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. + /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. + fn subscribe_range( + range: Range3d, + ignore_incomplete_payloads: bool, + ignore_empty_payloads: bool, + ) -> Self::EventProducer; + + /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. + fn resume_range_subscription( + progress_id: u64, + range: Range3d, + ignore_incomplete_payloads: bool, + ignore_empty_payloads: bool, + ) -> Result; + + /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). + fn summarise(range: Range3d) -> FP; + + /// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would. + fn area_of_interest_to_range( + aoi: AreaOfInterest, + ) -> Range3d; + + /// Partition a [`Range3d`] into `K` parts, or return `None` if the given range cannot be split into `K` many parts (for instance because the range only includes a single entry). + fn partition_range( + range: Range3d, + ) -> Option<[Range3d; K]>; +} From 82020eb4cd3c029111f1c80effcc6e0bf99f956b Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Tue, 27 Aug 2024 12:12:53 +0100 Subject: [PATCH 03/10] =?UTF-8?q?Add=20missing=20&self=20params,=20d?= =?UTF-8?q?=E2=80=99oh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wgps/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs index f2a2d47..3ac38eb 100644 --- a/wgps/src/lib.rs +++ b/wgps/src/lib.rs @@ -18,6 +18,7 @@ where /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. fn query_range( + &self, range: Range3d, will_sort: bool, ignore_incomplete_payloads: bool, @@ -29,6 +30,7 @@ where /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. fn subscribe_range( + &self, range: Range3d, ignore_incomplete_payloads: bool, ignore_empty_payloads: bool, @@ -36,6 +38,7 @@ where /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. fn resume_range_subscription( + &self, progress_id: u64, range: Range3d, ignore_incomplete_payloads: bool, @@ -43,15 +46,17 @@ where ) -> Result; /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). - fn summarise(range: Range3d) -> FP; + fn summarise(&self, range: Range3d) -> FP; /// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would. fn area_of_interest_to_range( + &self, aoi: AreaOfInterest, ) -> Range3d; /// Partition a [`Range3d`] into `K` parts, or return `None` if the given range cannot be split into `K` many parts (for instance because the range only includes a single entry). fn partition_range( + &self, range: Range3d, ) -> Option<[Range3d; K]>; } From b0bfd3340c4d1d8d8a6917d955111f40c740642b Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Tue, 27 Aug 2024 12:50:01 +0100 Subject: [PATCH 04/10] =?UTF-8?q?Use=20Frando=E2=80=99s=20splitting=20API?= =?UTF-8?q?=20design?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wgps/src/lib.rs | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs index 3ac38eb..e3a4a1e 100644 --- a/wgps/src/lib.rs +++ b/wgps/src/lib.rs @@ -3,6 +3,26 @@ use willow_data_model::{ AuthorisationToken, NamespaceId, PayloadDigest, ResumptionFailedError, Store, SubspaceId, }; +/// Options to specify how ranges should be partitioned. +#[derive(Debug, Clone, Copy)] +pub struct PartitionOpts { + /// The largest number of entries that can be included by a range before it is better to send that range's fingerprint instead of sending its entries. + pub max_range_size: usize, + /// The maximum number of partitions to split a range into. Must be at least 2. + pub max_splits: usize, +} + +/// A split range and the action which should be taken with that split range during range-based set reconciliation. +pub type RangeSplit = + (Range3d, SplitAction); + +/// Whether to send a split range's fingerprint or its included entries. +#[derive(Debug)] +pub enum SplitAction { + SendFingerprint(FP), + SendEntries(u64), +} + /// A [`Store`] capable of performing [3d range-based set reconciliation](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3_range_based_set_reconciliation). pub trait RbsrStore where @@ -54,9 +74,10 @@ where aoi: AreaOfInterest, ) -> Range3d; - /// Partition a [`Range3d`] into `K` parts, or return `None` if the given range cannot be split into `K` many parts (for instance because the range only includes a single entry). - fn partition_range( + /// Partition a [`Range3d`] into many parts, or return `None` if the given range cannot be split (for instance because the range only includes a single entry). + fn partition_range( &self, range: Range3d, - ) -> Option<[Range3d; K]>; + options: PartitionOpts, + ) -> Option>>; } From 6b896bbd4812d06e5217db1cc5d4feb42f1df0ca Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Tue, 27 Aug 2024 12:50:39 +0100 Subject: [PATCH 05/10] Referenced params --- wgps/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs index e3a4a1e..3e5bf02 100644 --- a/wgps/src/lib.rs +++ b/wgps/src/lib.rs @@ -39,7 +39,7 @@ where /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. fn query_range( &self, - range: Range3d, + range: &Range3d, will_sort: bool, ignore_incomplete_payloads: bool, ignore_empty_payloads: bool, @@ -51,7 +51,7 @@ where /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. fn subscribe_range( &self, - range: Range3d, + range: &Range3d, ignore_incomplete_payloads: bool, ignore_empty_payloads: bool, ) -> Self::EventProducer; @@ -60,7 +60,7 @@ where fn resume_range_subscription( &self, progress_id: u64, - range: Range3d, + range: &Range3d, ignore_incomplete_payloads: bool, ignore_empty_payloads: bool, ) -> Result; @@ -71,13 +71,13 @@ where /// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would. fn area_of_interest_to_range( &self, - aoi: AreaOfInterest, + aoi: &AreaOfInterest, ) -> Range3d; /// Partition a [`Range3d`] into many parts, or return `None` if the given range cannot be split (for instance because the range only includes a single entry). fn partition_range( &self, - range: Range3d, - options: PartitionOpts, + range: &Range3d, + options: &PartitionOpts, ) -> Option>>; } From f628ccd4ce3fc375a0e094545eec163b2b298bb3 Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Wed, 28 Aug 2024 12:44:30 +0100 Subject: [PATCH 06/10] Fix up merge --- Cargo.lock | 1 + data-model/src/store.rs | 9 --------- wgps/Cargo.toml | 1 + wgps/src/lib.rs | 31 ++++++++++++++++++------------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e5951c..da9b7c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,6 +530,7 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" name = "wgps" version = "0.1.0" dependencies = [ + "ufotofu", "willow-data-model", ] diff --git a/data-model/src/store.rs b/data-model/src/store.rs index a690a76..aae9ea1 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -344,9 +344,6 @@ where fn flush() -> impl Future>; /// Return a [`LengthyAuthorisedEntry`] with the given [`Path`] and [subspace](https://willowprotocol.org/specs/data-model/index.html#subspace) ID, if present. - /// - /// If `ignore_incomplete_payloads` is `true`, will return `None` if the entry's corresponding payload is incomplete, even if there is an entry present. - /// If `ignore_empty_payloads` is `true`, will return `None` if the entry's payload length is `0`, even if there is an entry present. fn entry( &self, path: &Path, @@ -355,9 +352,6 @@ where ) -> impl Future>; /// Query which entries are [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`AreaOfInterest`], returning a producer of [`LengthyAuthorisedEntry`]. - /// - /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. - /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. fn query_area( &self, area: &AreaOfInterest, @@ -367,9 +361,6 @@ where ) -> impl Producer>; /// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`AreaOfInterest`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function. - /// - /// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads. - /// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`. fn subscribe_area( &self, area: &AreaOfInterest, diff --git a/wgps/Cargo.toml b/wgps/Cargo.toml index 7cdca46..030740b 100644 --- a/wgps/Cargo.toml +++ b/wgps/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] willow-data-model = { path = "../data-model", version = "0.1.0" } +ufotofu = { version = "0.4.2", features = ["std"] } [lints] workspace = true diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs index 3e5bf02..7cda166 100644 --- a/wgps/src/lib.rs +++ b/wgps/src/lib.rs @@ -1,6 +1,10 @@ +use std::future::Future; + +use ufotofu::local_nb::Producer; use willow_data_model::{ grouping::{AreaOfInterest, Range3d}, - AuthorisationToken, NamespaceId, PayloadDigest, ResumptionFailedError, Store, SubspaceId, + AuthorisationToken, LengthyAuthorisedEntry, NamespaceId, PayloadDigest, QueryIgnoreParams, + ResumptionFailedError, Store, StoreEvent, SubspaceId, }; /// Options to specify how ranges should be partitioned. @@ -41,9 +45,8 @@ where &self, range: &Range3d, will_sort: bool, - ignore_incomplete_payloads: bool, - ignore_empty_payloads: bool, - ) -> Self::EntryProducer; + ignore: Option, + ) -> impl Producer>; /// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`Range3d`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function. /// @@ -52,32 +55,34 @@ where fn subscribe_range( &self, range: &Range3d, - ignore_incomplete_payloads: bool, - ignore_empty_payloads: bool, - ) -> Self::EventProducer; + ignore: Option, + ) -> impl Producer>; /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. fn resume_range_subscription( &self, progress_id: u64, range: &Range3d, - ignore_incomplete_payloads: bool, - ignore_empty_payloads: bool, - ) -> Result; + ignore: Option, + ) -> impl Future< + Output = impl Producer< + Item = Result, ResumptionFailedError>, + >, + >; /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). - fn summarise(&self, range: Range3d) -> FP; + fn summarise(&self, range: Range3d) -> impl Future; /// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would. fn area_of_interest_to_range( &self, aoi: &AreaOfInterest, - ) -> Range3d; + ) -> impl Future>; /// Partition a [`Range3d`] into many parts, or return `None` if the given range cannot be split (for instance because the range only includes a single entry). fn partition_range( &self, range: &Range3d, options: &PartitionOpts, - ) -> Option>>; + ) -> impl Future>>>; } From d650945d3b4f2acdf2164a26d1d19fad5eef665f Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Fri, 30 Aug 2024 11:41:15 +0100 Subject: [PATCH 07/10] Fix merge artefacts --- data-model/src/store.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/data-model/src/store.rs b/data-model/src/store.rs index ae70f00..8d8f9f0 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -533,6 +533,7 @@ where /// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription. fn resume_subscription( + &self, progress_id: u64, area: &Area, ignore: Option, From b27a4ce2c5b08c83726cfea7a0f7096d7e0d8359 Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Fri, 30 Aug 2024 11:44:14 +0100 Subject: [PATCH 08/10] Fix unused import --- data-model/src/store.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-model/src/store.rs b/data-model/src/store.rs index 8d8f9f0..ae61fab 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -8,7 +8,7 @@ use ufotofu::{local_nb::Producer, nb::BulkProducer}; use crate::{ entry::AuthorisedEntry, - grouping::{Area, AreaOfInterest, Range3d}, + grouping::{Area, AreaOfInterest}, parameters::{AuthorisationToken, NamespaceId, PayloadDigest, SubspaceId}, LengthyAuthorisedEntry, LengthyEntry, Path, }; From c3e34f6e1df1d1c89ca8712b2685548c5e1d6558 Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Fri, 30 Aug 2024 13:56:51 +0100 Subject: [PATCH 09/10] Fix silly return type --- wgps/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs index 7cda166..aeb03c6 100644 --- a/wgps/src/lib.rs +++ b/wgps/src/lib.rs @@ -64,11 +64,7 @@ where progress_id: u64, range: &Range3d, ignore: Option, - ) -> impl Future< - Output = impl Producer< - Item = Result, ResumptionFailedError>, - >, - >; + ) -> Result>, ResumptionFailedError>; /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). fn summarise(&self, range: Range3d) -> impl Future; From ed562f69654378009cf97472b164271d2a5c8800 Mon Sep 17 00:00:00 2001 From: Sam Gwilym Date: Fri, 30 Aug 2024 13:58:35 +0100 Subject: [PATCH 10/10] still silly --- data-model/src/store.rs | 7 ++++++- wgps/src/lib.rs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data-model/src/store.rs b/data-model/src/store.rs index ae61fab..6a671e1 100644 --- a/data-model/src/store.rs +++ b/data-model/src/store.rs @@ -537,5 +537,10 @@ where progress_id: u64, area: &Area, ignore: Option, - ) -> Result>, ResumptionFailedError>; + ) -> impl Future< + Output = Result< + impl Producer>, + ResumptionFailedError, + >, + >; } diff --git a/wgps/src/lib.rs b/wgps/src/lib.rs index aeb03c6..949845f 100644 --- a/wgps/src/lib.rs +++ b/wgps/src/lib.rs @@ -64,7 +64,12 @@ where progress_id: u64, range: &Range3d, ignore: Option, - ) -> Result>, ResumptionFailedError>; + ) -> impl Future< + Output = Result< + impl Producer>, + ResumptionFailedError, + >, + >; /// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp). fn summarise(&self, range: Range3d) -> impl Future;