From 597363d2f9f20664b5f3298ecb1f55ddff1d012b Mon Sep 17 00:00:00 2001 From: Emilia Hane Date: Thu, 5 Jan 2023 10:30:10 +0100 Subject: [PATCH] Don't send empty blobs sidecar for blobs by range request --- .../network/src/beacon_processor/worker/rpc_methods.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs b/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs index 69bd7da11..892d2671a 100644 --- a/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs @@ -660,10 +660,15 @@ impl Worker { for root in block_roots { match self.chain.store.get_blobs(&root) { Ok(Some(blob)) => { + let response_data = if blob.blobs.len() > 0 { + Some(Arc::new(blob)) + } else { + None + }; blobs_sent += 1; self.send_network_message(NetworkMessage::SendResponse { peer_id, - response: Response::BlobsByRange(Some(Arc::new(blob))), + response: Response::BlobsByRange(response_data), id: request_id, }); }