Skip to content

Commit e41dc72

Browse files
committed
fix: bugs after merge
1 parent 38b8f62 commit e41dc72

3 files changed

Lines changed: 12 additions & 6 deletions

File tree

crates/dkg/examples/sync.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,13 @@ async fn main() -> Result<()> {
639639
log_relay_event(relay_event, &cluster_info);
640640
}
641641
SwarmEvent::Behaviour(PlutoBehaviourEvent::Inner(
642+
ExampleBehaviourEvent::Sync(sync_event),
643+
)) => {
642644
log_sync_event(sync_event, &cluster_info);
643645
}
644646
SwarmEvent::Behaviour(PlutoBehaviourEvent::Ping(ping::Event {
645647
peer,
648+
result,
646649
..
647650
})) => {
648651
log_ping_event(peer, result, &relay_peer_ids, &cluster_info);
@@ -749,7 +752,6 @@ async fn main() -> Result<()> {
749752
}
750753
}
751754
}
752-
753755
cancellation.cancel();
754756
Ok(())
755757
}

crates/dkg/src/dkg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{path, time::Duration};
22

33
use bon::Builder;
4+
use libp2p::PeerId;
45
use pluto_cluster::version::{
56
support_node_signatures, support_partial_deposits, support_pregen_registrations,
67
};
@@ -10,7 +11,6 @@ use pluto_eth2util::{
1011
};
1112
use tokio_util::sync::CancellationToken;
1213
use tracing::{debug, info, warn};
13-
use libp2p::PeerId;
1414

1515
pub use crate::{
1616
aggregate::{AggregateError, agg_deposit_data, agg_lock_hash_sig, agg_validator_registrations},
@@ -26,7 +26,7 @@ const DEFAULT_DATA_DIR: &str = ".charon";
2626
const DEFAULT_DEFINITION_FILE: &str = ".charon/cluster-definition.json";
2727
const DEFAULT_PUBLISH_ADDRESS: &str = "https://api.obol.tech/v1";
2828
const DEFAULT_PUBLISH_TIMEOUT: Duration = Duration::from_secs(30);
29-
const DEFAULT_SHUTDOWN_DELAY: Duration = Duration::from_secs(1);
29+
const DEFAULT_SHUTDOWN_DELAY: Duration = Duration::from_secs(10);
3030
const DEFAULT_TIMEOUT: Duration = Duration::from_secs(60);
3131

3232
/// Entry-point DKG error.

crates/dkg/src/signing.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,12 @@ pub async fn sign_and_agg_validator_registrations(
275275
)?;
276276

277277
let peer_sigs = exchanger.exchange(SIG_VALIDATOR_REG, set).await?;
278-
Ok(agg_validator_registrations(&peer_sigs, shares, &msgs, fork_version)?)
278+
Ok(agg_validator_registrations(
279+
&peer_sigs,
280+
shares,
281+
&msgs,
282+
fork_version,
283+
)?)
279284
}
280285

281286
/// Signs, exchanges, and aggregates lock-hash partial signatures; builds the
@@ -315,8 +320,7 @@ pub async fn sign_and_aggregate_lock_hash(
315320
})
316321
.collect::<Result<_>>()?;
317322

318-
let (agg_sig, all_pubshares) =
319-
agg_lock_hash_sig(&peer_sigs, &shares_map, &lock.lock_hash)?;
323+
let (agg_sig, all_pubshares) = agg_lock_hash_sig(&peer_sigs, &shares_map, &lock.lock_hash)?;
320324

321325
BlstImpl.verify_aggregate(&all_pubshares, agg_sig, &lock.lock_hash)?;
322326
lock.signature_aggregate = agg_sig.to_vec();

0 commit comments

Comments
 (0)