From a1894d8e381985e1ba37032d09b01044aef50364 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 --- subxt/src/backend/unstable/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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);