diff --git a/bridges/relays/ethereum/Cargo.toml b/bridges/relays/ethereum/Cargo.toml index 816b1af14a..69e9e010d8 100644 --- a/bridges/relays/ethereum/Cargo.toml +++ b/bridges/relays/ethereum/Cargo.toml @@ -15,7 +15,7 @@ env_logger = "0.8.2" ethabi = "12.0" ethabi-contract = "11.0" ethabi-derive = "12.0" -futures = "0.3.7" +futures = "0.3.8" hex = "0.4" hex-literal = "0.3" log = "0.4.11" diff --git a/bridges/relays/headers-relay/src/sync_loop.rs b/bridges/relays/headers-relay/src/sync_loop.rs index 4a09e3518d..15f982af76 100644 --- a/bridges/relays/headers-relay/src/sync_loop.rs +++ b/bridges/relays/headers-relay/src/sync_loop.rs @@ -126,6 +126,7 @@ pub fn run>( metrics_params: Option, exit_signal: impl Future, ) { + #![allow(unused_variables)] // this is to suppress weird errors from clippy let mut local_pool = futures::executor::LocalPool::new(); let mut progress_context = (Instant::now(), None, None); @@ -203,7 +204,7 @@ pub fn run>( &mut source_retry_backoff, |source_best_block_number| sync.source_best_header_number_response(source_best_block_number), &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving best header number from {}", P::SOURCE_NAME), ).is_ok(); }, @@ -213,7 +214,7 @@ pub fn run>( &mut source_retry_backoff, |source_new_header| sync.headers_mut().header_response(source_new_header), &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving header from {} node", P::SOURCE_NAME), ).is_ok(); }, @@ -223,7 +224,7 @@ pub fn run>( &mut source_retry_backoff, |source_orphan_header| sync.headers_mut().header_response(source_orphan_header), &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving orphan header from {} node", P::SOURCE_NAME), ).is_ok(); }, @@ -233,7 +234,7 @@ pub fn run>( &mut source_retry_backoff, |(header, extra)| sync.headers_mut().extra_response(&header, extra), &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving extra data from {} node", P::SOURCE_NAME), ).is_ok(); }, @@ -243,7 +244,7 @@ pub fn run>( &mut source_retry_backoff, |(header, completion)| sync.headers_mut().completion_response(&header, completion), &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving completion data from {} node", P::SOURCE_NAME), ).is_ok(); }, @@ -294,7 +295,7 @@ pub fn run>( } }, &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving best known {} header from {} node", P::SOURCE_NAME, P::TARGET_NAME), ).is_ok(); }, @@ -306,7 +307,7 @@ pub fn run>( &mut target_retry_backoff, |incomplete_headers_ids| sync.headers_mut().incomplete_headers_response(incomplete_headers_ids), &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving incomplete headers from {} node", P::TARGET_NAME), ).is_ok(); }, @@ -318,7 +319,7 @@ pub fn run>( .headers_mut() .maybe_orphan_response(&target_header, target_existence_status), &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving existence status from {} node", P::TARGET_NAME), ).is_ok(); }, @@ -346,7 +347,7 @@ pub fn run>( &mut target_retry_backoff, |_| {}, &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error submitting headers to {} node", P::TARGET_NAME), ).is_ok(); @@ -367,7 +368,7 @@ pub fn run>( &mut target_retry_backoff, |completed_header| sync.headers_mut().header_completed(&completed_header), &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error completing headers at {}", P::TARGET_NAME), ).is_ok(); }, @@ -379,7 +380,7 @@ pub fn run>( .headers_mut() .maybe_extra_response(&header, extra_check_result), &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving receipts requirement from {} node", P::TARGET_NAME), ).is_ok(); }, diff --git a/bridges/relays/messages-relay/src/message_lane_loop.rs b/bridges/relays/messages-relay/src/message_lane_loop.rs index 79f4a9493c..8278f8c3ec 100644 --- a/bridges/relays/messages-relay/src/message_lane_loop.rs +++ b/bridges/relays/messages-relay/src/message_lane_loop.rs @@ -374,7 +374,7 @@ async fn run_until_connection_lost, TC: Targ } }, &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving state from {} node", P::SOURCE_NAME), ).fail_if_connection_error(FailedClient::Source)?; }, @@ -405,7 +405,7 @@ async fn run_until_connection_lost, TC: Targ } }, &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving state from {} node", P::TARGET_NAME), ).fail_if_connection_error(FailedClient::Target)?; }, diff --git a/bridges/relays/messages-relay/src/message_race_loop.rs b/bridges/relays/messages-relay/src/message_race_loop.rs index 5db54fbecf..3267ea9dc2 100644 --- a/bridges/relays/messages-relay/src/message_race_loop.rs +++ b/bridges/relays/messages-relay/src/message_race_loop.rs @@ -269,7 +269,7 @@ pub async fn run>( strategy.source_nonces_updated(at_block, nonces); }, &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving nonces from {}", P::source_name()), ).fail_if_connection_error(FailedClient::Source)?; }, @@ -290,7 +290,7 @@ pub async fn run>( strategy.target_nonces_updated(nonces, &mut race_state); }, &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error retrieving nonces from {}", P::target_name()), ).fail_if_connection_error(FailedClient::Target)?; }, @@ -311,7 +311,7 @@ pub async fn run>( race_state.nonces_to_submit = Some((at_block, nonces_range, proof)); }, &mut source_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error generating proof at {}", P::source_name()), ).fail_if_connection_error(FailedClient::Source)?; }, @@ -331,7 +331,7 @@ pub async fn run>( race_state.nonces_submitted = Some(nonces_range); }, &mut target_go_offline_future, - |delay| async_std::task::sleep(delay), + async_std::task::sleep, || format!("Error submitting proof {}", P::target_name()), ).fail_if_connection_error(FailedClient::Target)?; } diff --git a/bridges/relays/substrate/Cargo.toml b/bridges/relays/substrate/Cargo.toml index 66a6aaea50..6cb9847ea2 100644 --- a/bridges/relays/substrate/Cargo.toml +++ b/bridges/relays/substrate/Cargo.toml @@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" async-std = "1.7.0" async-trait = "0.1.42" codec = { package = "parity-scale-codec", version = "1.3.4" } -futures = "0.3.7" +futures = "0.3.8" hex = "0.4" log = "0.4.11" num-traits = "0.2"