From d0d39817315524a14376173b3661360e74bd9ce0 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 1 Jan 2024 06:51:41 -0500 Subject: [PATCH] Use an extended timeout for DKGs specifically --- coordinator/src/tributary/db.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coordinator/src/tributary/db.rs b/coordinator/src/tributary/db.rs index 7f9de7b2..27fef1f0 100644 --- a/coordinator/src/tributary/db.rs +++ b/coordinator/src/tributary/db.rs @@ -141,12 +141,16 @@ impl ReattemptDb { // 5 minutes for attempts 0 ..= 2, 10 minutes for attempts 3 ..= 5, 15 minutes for attempts > 5 // Assumes no event will take longer than 15 minutes, yet grows the time in case there are // network bandwidth issues - let reattempt_delay = BASE_REATTEMPT_DELAY * + let mut reattempt_delay = BASE_REATTEMPT_DELAY * ((AttemptDb::attempt(txn, genesis, topic) .expect("scheduling re-attempt for unknown topic") / 3) + 1) .min(3); + // Allow more time for DKGs since they have an extra round and much more data + if matches!(topic, Topic::Dkg) { + reattempt_delay *= 4; + } let upon_block = current_block_number + reattempt_delay; let mut reattempts = Self::get(txn, genesis, upon_block).unwrap_or(vec![]);