aboutsummaryrefslogtreecommitdiffstats
path: root/src/state
diff options
context:
space:
mode:
Diffstat (limited to 'src/state')
-rw-r--r--src/state/timing.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/state/timing.rs b/src/state/timing.rs
index fed48e9..adb8cfe 100644
--- a/src/state/timing.rs
+++ b/src/state/timing.rs
@@ -44,6 +44,25 @@ pub(crate) struct Timing {
/// (`Transport::delivery_limit`): a peer silent for longer has nothing on the way to
/// us any more.
pub(crate) delivery_limit: Duration,
+ /// HyParView (`swarm::hyparview`): how long a member asked to be a neighbour has to
+ /// agree, the handshake before included. Twice the first sync reply timeout: over
+ /// Tor, a few round trips of up to 3 s.
+ pub(crate) ask_for: Duration,
+ /// HyParView: a member that refused, didn't answer, or left isn't asked again for this
+ /// long. A keepalive interval.
+ pub(crate) refused_for: Duration,
+ /// HyParView: a member one neighbour short asks this seldom (five keepalive
+ /// intervals): in a swarm whose members mostly have `k`, asking each in turn kept
+ /// NEIGHBOURs going in a quiet swarm (up to 300 in 20 s at 50 members). Two or more
+ /// short, it asks at once. A member with `k` takes it (it says it is one short), so one
+ /// ask is enough but where those asked have `k + 1`.
+ pub(crate) one_short_every: Duration,
+ /// HyParView: each neighbour is asked again this often whether it still is (NEIGHBOUR,
+ /// as a new ask would be), a keepalive interval: a NEIGHBOUR_REPLY or DISCONNECT lost
+ /// on a lossy link leaves a link in one end's view only, and nothing else would tell
+ /// that end: the other still answers it. A neighbour that has us agrees at once; one
+ /// that doesn't takes us if it has room, else refuses, and we drop it.
+ pub(crate) reaffirm_every: Duration,
}
impl Timing {
@@ -100,6 +119,10 @@ impl Timing {
sync_reply_timeout,
unreached_after: sync_reply_timeout * 2,
delivery_limit,
+ ask_for: sync_reply_timeout * 2,
+ refused_for: keepalive,
+ one_short_every: keepalive * 5,
+ reaffirm_every: keepalive,
}
}