From 5c3828382c20dab4fd0ca5d7105ba558d142c992 Mon Sep 17 00:00:00 2001 From: Nicholas Wehr Date: Fri, 22 Aug 2025 00:00:23 -0700 Subject: [PATCH] debug --- bin/reth/src/share_blocks.rs | 5 +++-- crates/net/hlfs/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/reth/src/share_blocks.rs b/bin/reth/src/share_blocks.rs index 6383bb4c1..8edee53a6 100644 --- a/bin/reth/src/share_blocks.rs +++ b/bin/reth/src/share_blocks.rs @@ -88,9 +88,10 @@ where let mut bf = backfiller.lock().await; if bf.client.max_block < bf.max_block_seen { let block = bf.client.max_block + 1; - let _ = bf.fetch_if_missing(block).await; + let new_height = bf.fetch_if_missing(block).await.expect("new height"); + bf.client.max_block = new_height.unwrap(); } - sleep(Duration::from_secs(1)).await; + sleep(Duration::from_millis(50)).await; } } }); diff --git a/crates/net/hlfs/src/lib.rs b/crates/net/hlfs/src/lib.rs index a5c739a02..d8ba3a059 100644 --- a/crates/net/hlfs/src/lib.rs +++ b/crates/net/hlfs/src/lib.rs @@ -330,7 +330,7 @@ impl Backfiller { pub async fn fetch_if_missing( &mut self, number: u64, - ) -> Result, HlfsError> { + ) -> Result, HlfsError> { let rr_index = number as usize; let n = number.saturating_sub(1); // 0 -> 0, others -> number-1 let f = (n / 1_000_000) * 1_000_000; @@ -357,7 +357,7 @@ impl Backfiller { return Ok(None); } debug!(block = number, "hlfs: got block"); - Ok(Some(data.len())) + Ok(Some(number)) } } }