From 74cccbf7db9be57a40a108816b097827c14a4244 Mon Sep 17 00:00:00 2001 From: William Smith Date: Wed, 16 Oct 2024 12:09:09 -0700 Subject: [PATCH] Add experimental timeouts for data collection --- .../src/client/bridge_authority_aggregator.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/crates/sui-bridge/src/client/bridge_authority_aggregator.rs b/crates/sui-bridge/src/client/bridge_authority_aggregator.rs index 1dd42dc5832ea..a3097cca99543 100644 --- a/crates/sui-bridge/src/client/bridge_authority_aggregator.rs +++ b/crates/sui-bridge/src/client/bridge_authority_aggregator.rs @@ -24,10 +24,14 @@ use sui_types::committee::StakeUnit; use sui_types::committee::TOTAL_VOTING_POWER; use tracing::{error, info, warn}; -const TOTAL_TIMEOUT_MS: u64 = 5_000; -const PREFETCH_TIMEOUT_MS: u64 = 1_500; +// const TOTAL_TIMEOUT_MS: u64 = 5_000; +// const PREFETCH_TIMEOUT_MS: u64 = 1_500; const RETRY_INTERVAL_MS: u64 = 500; +// TESTING ONLY!!! THIS SHOULD BE REVERTED +const PREFETCH_TIMEOUT_MS: u64 = 20_000; +const TOTAL_TIMEOUT_MS: u64 = 30_000; + pub struct BridgeAuthorityAggregator { pub committee: Arc, pub clients: Arc>>, @@ -213,11 +217,15 @@ async fn request_sign_bridge_action_into_certification( Ok(result) => { return Ok(result); } - // retyable errors here + // retyable errors Err(BridgeError::TxNotFinalized) => { warn!("Bridge authority {} observing transaction not yet finalized, retrying in {:?}", name.concise(), retry_interval); tokio::time::sleep(retry_interval).await; } + // non-retriable errors + Err(e) => { + return Err(e); + } } } Err(BridgeError::TransientProviderError(format!("Bridge authority {} did not observe finalized transaction after {:?}", name.concise(), timeout)))