From e17719afa06ac5df98ef5fadbb977e68ac52d27b Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "eth: send big transactions by announce/retrieve only (#27618)" This reverts commit 60f192793ed4df4858af68eef7df8e350bb6e2e4. --- eth/handler.go | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/eth/handler.go b/eth/handler.go index 6a8487649e..46113fbc2f 100644 --- a/eth/handler.go +++ b/eth/handler.go @@ -45,11 +45,6 @@ const ( // txChanSize is the size of channel listening to NewTxsEvent. // The number is referenced from the size of tx pool. txChanSize = 4096 - - // txMaxBroadcastSize is the max size of a transaction that will be broadcasted. - // All transactions with a higher size will be announced and need to be fetched - // by the peer. - txMaxBroadcastSize = 4096 ) var ( @@ -569,12 +564,8 @@ func (h *handler) BroadcastTransactions(txs types.Transactions) { // Broadcast transactions to a batch of peers not knowing about it for _, tx := range txs { peers := h.peers.peersWithoutTransaction(tx.Hash()) - - var numDirect int - if tx.Size() <= txMaxBroadcastSize { - numDirect = int(math.Sqrt(float64(len(peers)))) - } // Send the tx unconditionally to a subset of our peers + numDirect := int(math.Sqrt(float64(len(peers)))) for _, peer := range peers[:numDirect] { txset[peer] = append(txset[peer], tx.Hash()) }