From d8a7e285609c58b3b3d67b53c16f5f0feb97ed5f Mon Sep 17 00:00:00 2001 From: Mia Date: Sun, 20 Jul 2025 16:22:08 +0100 Subject: [PATCH] fix(consumer/firehose): someone's doing something weird but this should be fine. --- consumer/src/firehose/types.rs | 3 +++ consumer/src/indexer/mod.rs | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/consumer/src/firehose/types.rs b/consumer/src/firehose/types.rs index 44228c40..10784cdc 100644 --- a/consumer/src/firehose/types.rs +++ b/consumer/src/firehose/types.rs @@ -91,8 +91,11 @@ pub struct AtpCommitEvent { pub commit: Cid, #[serde(rename = "tooBig")] pub too_big: bool, + #[serde(default)] pub blocks: ByteBuf, + #[serde(default)] pub ops: Vec, + #[serde(default)] pub blobs: Vec, } diff --git a/consumer/src/indexer/mod.rs b/consumer/src/indexer/mod.rs index 78fdd72f..e1a1c147 100644 --- a/consumer/src/indexer/mod.rs +++ b/consumer/src/indexer/mod.rs @@ -371,6 +371,11 @@ async fn index_commit( } } + if commit.ops.is_empty() || commit.blocks.is_empty() { + tracing::debug!("skipping commit with no ops/data"); + return Ok(()); + } + // turn the car slice into a map of cid:block let car_reader = iroh_car::CarReader::new(commit.blocks.as_slice()).await?; let blocks = car_reader -- 2.51.2