Skip to content

Commit

Permalink
Add experimental timeouts for data collection
Browse files Browse the repository at this point in the history
  • Loading branch information
williampsmith committed Oct 16, 2024
1 parent 160938c commit 74cccbf
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions crates/sui-bridge/src/client/bridge_authority_aggregator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BridgeCommittee>,
pub clients: Arc<BTreeMap<BridgeAuthorityPublicKeyBytes, Arc<BridgeClient>>>,
Expand Down Expand Up @@ -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)))
Expand Down

0 comments on commit 74cccbf

Please sign in to comment.