diff --git a/bin/reth/src/block_ingest.rs b/bin/reth/src/block_ingest.rs
index c6b60a1f5..74b82bbf0 100644
--- a/bin/reth/src/block_ingest.rs
+++ b/bin/reth/src/block_ingest.rs
@@ -159,15 +159,15 @@ impl BlockIngest {
return Some(block);
}
- if let Some(hlfs) = &self.hlfs {
- //info!("!! HEIGHT [{height}] :: HEAD [{head}]");
- if hlfs.try_fetch_one(height).await.ok().flatten().is_some() {
- if let Some(block) = self.try_collect_local_block(height).await {
- info!("Returning HLFS-fetched block @[{height}]");
- return Some(block);
- }
- }
- }
+ // if let Some(hlfs) = &self.hlfs {
+ // //info!("!! HEIGHT [{height}] :: HEAD [{head}]");
+ // if hlfs.try_fetch_one(height).await.ok().flatten().is_some() {
+ // if let Some(block) = self.try_collect_local_block(height).await {
+ // info!("Returning HLFS-fetched block @[{height}]");
+ // return Some(block);
+ // }
+ // }
+ // }
self.try_collect_s3_block(height)
}
diff --git a/bin/reth/src/share_blocks.rs b/bin/reth/src/share_blocks.rs
index 7eeddba08..ede25305c 100644
--- a/bin/reth/src/share_blocks.rs
+++ b/bin/reth/src/share_blocks.rs
@@ -1,14 +1,16 @@
use clap::Args;
-use reth_hlfs::{Backfiller, Client, Server, OP_REQ_MAX_BLOCK, OP_RES_MAX_BLOCK, PeerRecord};
+use reth_hlfs::{Backfiller, Client, PeerRecord, Server, OP_REQ_MAX_BLOCK, OP_RES_MAX_BLOCK};
use reth_network_api::{events::NetworkEvent, FullNetwork};
use std::{
collections::HashSet,
net::{IpAddr, SocketAddr},
path::PathBuf,
sync::Arc,
- time::Duration,
};
-use tokio::{task::JoinHandle, time::timeout};
+use tokio::{
+ task::JoinHandle,
+ time::{sleep, timeout, Duration},
+};
use tracing::{debug, info, warn};
// use futures_util::StreamExt;
@@ -27,7 +29,6 @@ pub(crate) struct ShareBlocksArgs {
}
pub(crate) struct ShareBlocks {
- pub(crate) _backfiller: Backfiller,
_server: JoinHandle<()>,
_autodetect: JoinHandle<()>,
}
@@ -53,65 +54,83 @@ impl ShareBlocks {
}
});
- let client = Client::new(&args.archive_dir, Vec::new()).with_timeout(Duration::from_secs(5));
- let bf = Backfiller::new(client, &args.archive_dir);
-
- let _autodetect = spawn_autodetect(network, host, args.share_blocks_port, bf.clone());
+ let _autodetect = spawn_autodetect(network, host, args.share_blocks_port, args.archive_dir.clone());
info!(%bind, dir=%args.archive_dir.display(), "hlfs: enabled (reth peers)");
- Ok(Self { _backfiller: bf, _server, _autodetect })
+ Ok(Self { _server, _autodetect })
}
- #[allow(dead_code)]
- pub(crate) async fn try_fetch_one(&self, block: u64) -> eyre::Result