From 96891be7f99ea837a3021a33c28bb48248b9f6b1 Mon Sep 17 00:00:00 2001 From: healthykim Date: Sat, 29 Nov 2025 00:05:46 +0900 Subject: [PATCH] fix: remove second validation --- eth/protocols/eth/handlers.go | 1 - eth/protocols/eth/peer.go | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/eth/protocols/eth/handlers.go b/eth/protocols/eth/handlers.go index 37bd62d03a..9d2f1d701a 100644 --- a/eth/protocols/eth/handlers.go +++ b/eth/protocols/eth/handlers.go @@ -386,7 +386,6 @@ func serviceGetReceiptsQuery70(chain *core.BlockChain, query GetReceiptsRequest, } } - // todo: buffer if firstBlockReceiptIndex > 0 && lookups == 0 { results, lastBlockIncomplete = trimReceiptsRLP(results, int(firstBlockReceiptIndex)) } else if bytes+len(results) > maxPacketSize { diff --git a/eth/protocols/eth/peer.go b/eth/protocols/eth/peer.go index 7b5ff3065b..ed33cd5010 100644 --- a/eth/protocols/eth/peer.go +++ b/eth/protocols/eth/peer.go @@ -475,20 +475,13 @@ func (p *Peer) validateLastBlockReceipt(receiptLists []*ReceiptList69, id uint64 previousLog = buffer.lastLogSize } - // 1. Verify that the total number of transactions delivered is under the limit. + // Verify that the total number of transactions delivered is under the limit. if uint64(previousTxs+len(lastReceipts.items)) > header.GasUsed/21_000 { // should be dropped, don't clear the buffer return 0, fmt.Errorf("total number of tx exceeded limit") } - // 2. Verify the size of each receipt against the maximum transaction size. - for _, rc := range lastReceipts.items { - if uint64(len(rc.Logs)) > params.MaxTxGas/params.LogDataGas { - return 0, fmt.Errorf("total size of receipt exceeded limit") - } - log += uint64(len(rc.Logs)) - } - // 3. Verify that the overall downloaded receipt size does not exceed the block gas limit. + // Verify that the overall downloaded receipt size does not exceed the block gas limit. if previousLog+log > header.GasUsed/params.LogDataGas { return 0, fmt.Errorf("total download receipt size exceeded the limit") }