Skip to content

Commit 2e478aa

Browse files
authored
eth/fetcher: only make noise big mismatches (#28356)
1 parent 4632b7b commit 2e478aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

eth/fetcher/tx_fetcher.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,9 @@ func (f *TxFetcher) loop() {
593593
log.Warn("Announced transaction type mismatch", "peer", peer, "tx", hash, "type", delivery.metas[i].kind, "ann", meta.kind)
594594
f.dropPeer(peer)
595595
} else if delivery.metas[i].size != meta.size {
596-
log.Warn("Announced transaction size mismatch", "peer", peer, "tx", hash, "size", delivery.metas[i].size, "ann", meta.size)
597596
if math.Abs(float64(delivery.metas[i].size)-float64(meta.size)) > 8 {
597+
log.Warn("Announced transaction size mismatch", "peer", peer, "tx", hash, "size", delivery.metas[i].size, "ann", meta.size)
598+
598599
// Normally we should drop a peer considering this is a protocol violation.
599600
// However, due to the RLP vs consensus format messyness, allow a few bytes
600601
// wiggle-room where we only warn, but don't drop.
@@ -618,8 +619,9 @@ func (f *TxFetcher) loop() {
618619
log.Warn("Announced transaction type mismatch", "peer", peer, "tx", hash, "type", delivery.metas[i].kind, "ann", meta.kind)
619620
f.dropPeer(peer)
620621
} else if delivery.metas[i].size != meta.size {
621-
log.Warn("Announced transaction size mismatch", "peer", peer, "tx", hash, "size", delivery.metas[i].size, "ann", meta.size)
622622
if math.Abs(float64(delivery.metas[i].size)-float64(meta.size)) > 8 {
623+
log.Warn("Announced transaction size mismatch", "peer", peer, "tx", hash, "size", delivery.metas[i].size, "ann", meta.size)
624+
623625
// Normally we should drop a peer considering this is a protocol violation.
624626
// However, due to the RLP vs consensus format messyness, allow a few bytes
625627
// wiggle-room where we only warn, but don't drop.

0 commit comments

Comments
 (0)