Skip to content

Commit de45a05

Browse files
feat: add dkg/exchanger (#350)
* feat: add deadline.rs * feat: deadline tests * fix: remove comments * wip: add parasig db and some tests * refactor: remove old app/deadline * feat: add rust docs * feat: add clone box and clone eq * feat: finish tests * feat: add parsigex [wip] * fix: typo * fix: parsigex * refactor: parsigex * fix: linter * feat: add subscribe * feat: add documentation for parsigex * fix: review comments * fix: review comments * fix: review comments * fix: cargo deny * fix: linter * feat: add exchanger * fix: remove unused deps * fix: remove comments * fix: address review comments * fix: review comments --------- Co-authored-by: Bohdan Ohorodnii <273991985+varex83agent@users.noreply.github.com>
1 parent 5411a4a commit de45a05

6 files changed

Lines changed: 549 additions & 13 deletions

File tree

Cargo.lock

Lines changed: 6 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/core/src/parsigdb/memory.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub type ThreshSub = Arc<
7373
/// }
7474
/// }
7575
/// });
76-
/// db.subscribe_internal(sub).await?;
76+
/// db.subscribe_internal(sub).await;
7777
/// ```
7878
pub fn internal_subscriber<F, Fut>(f: F) -> InternalSub
7979
where
@@ -105,7 +105,7 @@ where
105105
/// }
106106
/// }
107107
/// });
108-
/// db.subscribe_threshold(sub).await?;
108+
/// db.subscribe_threshold(sub).await;
109109
/// ```
110110
pub fn threshold_subscriber<F, Fut>(f: F) -> ThreshSub
111111
where
@@ -193,20 +193,18 @@ impl MemDB {
193193
///
194194
/// The subscriber will be called when the node generates partial signed
195195
/// data that needs to be exchanged with peers.
196-
pub async fn subscribe_internal(&self, sub: InternalSub) -> Result<()> {
196+
pub async fn subscribe_internal(&self, sub: InternalSub) {
197197
let mut inner = self.inner.lock().await;
198198
inner.internal_subs.push(sub);
199-
Ok(())
200199
}
201200

202201
/// Registers a subscriber for threshold-reached partial signed data.
203202
///
204203
/// The subscriber will be called when enough matching partial signatures
205204
/// have been collected to meet the threshold requirement.
206-
pub async fn subscribe_threshold(&self, sub: ThreshSub) -> Result<()> {
205+
pub async fn subscribe_threshold(&self, sub: ThreshSub) {
207206
let mut inner = self.inner.lock().await;
208207
inner.thresh_subs.push(sub);
209-
Ok(())
210208
}
211209

212210
/// Stores internally generated partial signed data and notifies

crates/core/src/parsigdb/memory_internal_test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ async fn memdb_threshold() {
125125
}
126126
}
127127
}))
128-
.await
129-
.expect("subscription should succeed");
128+
.await;
130129

131130
let pubkey = random_core_pub_key();
132131
let attestation = testutil::random_deneb_versioned_attestation();

crates/dkg/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ k256.workspace = true
2222
pluto-k1util.workspace = true
2323
pluto-p2p.workspace = true
2424
pluto-cluster.workspace = true
25+
pluto-core.workspace = true
2526
pluto-crypto.workspace = true
2627
pluto-eth1wrap.workspace = true
2728
pluto-eth2util.workspace = true
29+
pluto-parsigex.workspace = true
30+
async-trait.workspace = true
2831
pluto-tracing.workspace = true
2932
hex.workspace = true
3033
rand.workspace = true
@@ -42,7 +45,6 @@ test-case.workspace = true
4245
clap.workspace = true
4346
hex.workspace = true
4447
pluto-cluster = { workspace = true, features = ["test-cluster"] }
45-
pluto-core.workspace = true
4648
pluto-testutil.workspace = true
4749
pluto-tracing.workspace = true
4850
serde_json.workspace = true

0 commit comments

Comments
 (0)