Skip to content

Commit 5778f2e

Browse files
committed
fix: short circuit on participant network partition
Implements an early return when a participant waiting for a connection exceeds the introduced timeout and deems the other participant unreachable, informing the leader of this so it can short circuit as well instead of waiting for eventual failure.
1 parent b1e8b76 commit 5778f2e

3 files changed

Lines changed: 352 additions & 31 deletions

File tree

crates/node-config/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use std::{
1717
fs,
1818
net::{Ipv4Addr, SocketAddr, ToSocketAddrs},
1919
path::Path,
20+
time::Duration,
2021
};
2122

2223
const DEFAULT_PPROF_PORT: u16 = 34001;
@@ -26,6 +27,10 @@ const DEFAULT_PPROF_PORT: u16 = 34001;
2627
/// participants that are too far behind in the indexer height.
2728
pub const MAX_INDEXER_HEIGHT_DIFF: u64 = 50;
2829

30+
/// How long a follower will wait, at the start of computation, for a
31+
/// connection to each other participant in the round to be established before giving up.
32+
pub const PARTICIPANT_CONNECTION_WAIT_TIMEOUT: Duration = Duration::from_secs(2);
33+
2934
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
3035
pub struct TripleConfig {
3136
pub concurrency: usize,

0 commit comments

Comments
 (0)