From 9d3bc1830c642bdd310977872af8d29816a5f357 Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Mon, 15 Jan 2024 13:33:58 +0200 Subject: [PATCH] backend: Add loop iteration debug and panic Signed-off-by: Alexandru Vasile --- Cargo.lock | 8 ++++---- subxt/src/backend/unstable/mod.rs | 8 ++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b6fd61731..c9d3916d72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2015,7 +2015,7 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.9", + "rustls 0.21.10", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -2264,7 +2264,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "776d009e2f591b78c038e0d053a796f94575d66ca4e77dd84bfc5e81419e436c" dependencies = [ "anyhow", - "async-lock 3.2.0", + "async-lock 3.3.0", "async-trait", "beef", "futures-timer", @@ -3289,7 +3289,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" dependencies = [ - "base64 0.21.5", + "base64 0.21.6", "rustls-pki-types", ] @@ -4665,7 +4665,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.9", + "rustls 0.21.10", "tokio", ] diff --git a/subxt/src/backend/unstable/mod.rs b/subxt/src/backend/unstable/mod.rs index fb1437352d..7a3a380dbd 100644 --- a/subxt/src/backend/unstable/mod.rs +++ b/subxt/src/backend/unstable/mod.rs @@ -474,9 +474,17 @@ impl Backend for UnstableBackend { // with chainHead_follow. let mut finalized_hash: Option = None; + let mut iter_num = 0; + let now = std::time::Instant::now(); + // Now we can attempt to associate tx events with pinned blocks. let tx_stream = futures::stream::poll_fn(move |cx| { loop { + iter_num += 1; + if now.elapsed().as_secs() > 120 { + panic!("iter={:#?}", iter_num); + } + // Bail early if no more tx events; we don't want to keep polling for pinned blocks. if done { return Poll::Ready(None);