From 3366ae8a9671c5f2b65c321e299dfe52af929a01 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Mon, 4 May 2026 22:49:07 +0800 Subject: [PATCH] eth/downloader: use batch index in deliver reconstruct The reconstruct callback indexes parallel response slices (bodies, receipts). Passing the accept counter used the wrong element when an earlier header in the same batch failed validation or hit a stale slot. --- eth/downloader/queue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index dd17b7f1ed..585906b8bd 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -689,9 +689,9 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header, i++ } - for _, header := range request.Headers[:i] { + for k, header := range request.Headers[:i] { if res, stale, err := q.resultCache.GetDeliverySlot(header.Number.Uint64()); err == nil && !stale { - reconstruct(accepted, res) + reconstruct(k, res) accepted++ } else { // Between here and above, some other peer filled this result,