2828use super :: {
2929 config:: TransactionFetcherConfig ,
3030 constants:: { tx_fetcher:: * , SOFT_LIMIT_COUNT_HASHES_IN_GET_POOLED_TRANSACTIONS_REQUEST } ,
31- MessageFilter , PeerMetadata , PooledTransactions ,
32- SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE ,
31+ PeerMetadata , PooledTransactions , SOFT_LIMIT_BYTE_SIZE_POOLED_TRANSACTIONS_RESPONSE ,
3332} ;
3433use crate :: {
3534 cache:: { LruCache , LruMap } ,
3635 duration_metered_exec,
3736 metrics:: TransactionFetcherMetrics ,
38- transactions:: { validation, PartiallyFilterMessage } ,
3937} ;
4038use alloy_consensus:: transaction:: PooledTransaction ;
4139use alloy_primitives:: TxHash ;
@@ -60,7 +58,6 @@ use std::{
6058} ;
6159use tokio:: sync:: { mpsc:: error:: TrySendError , oneshot, oneshot:: error:: RecvError } ;
6260use tracing:: trace;
63- use validation:: FilterOutcome ;
6461
6562/// The type responsible for fetching missing transactions from peers.
6663///
@@ -85,8 +82,6 @@ pub struct TransactionFetcher<N: NetworkPrimitives = EthNetworkPrimitives> {
8582 pub hashes_pending_fetch : LruCache < TxHash > ,
8683 /// Tracks all hashes in the transaction fetcher.
8784 pub hashes_fetch_inflight_and_pending_fetch : LruMap < TxHash , TxFetchMetadata , ByLength > ,
88- /// Filter for valid announcement and response data.
89- pub ( super ) filter_valid_message : MessageFilter ,
9085 /// Info on capacity of the transaction fetcher.
9186 pub info : TransactionFetcherInfo ,
9287 #[ doc( hidden) ]
@@ -919,20 +914,19 @@ impl<N: NetworkPrimitives> TransactionFetcher<N> {
919914 //
920915 let unvalidated_payload_len = verified_payload. len ( ) ;
921916
922- let ( validation_outcome, valid_payload) =
923- self . filter_valid_message . partially_filter_valid_entries ( verified_payload) ;
917+ let valid_payload = verified_payload. dedup ( ) ;
924918
925919 // todo: validate based on announced tx size/type and report peer for sending
926920 // invalid response <https://github.com/paradigmxyz/reth/issues/6529>. requires
927921 // passing the rlp encoded length down from active session along with the decoded
928922 // tx.
929923
930- if validation_outcome == FilterOutcome :: ReportPeer {
924+ if valid_payload . len ( ) != unvalidated_payload_len {
931925 trace ! ( target: "net::tx" ,
932- peer_id=format!( "{peer_id:#}" ) ,
933- unvalidated_payload_len,
934- valid_payload_len=valid_payload. len( ) ,
935- "received invalid `PooledTransactions` response from peer, filtered out duplicate entries"
926+ peer_id=format!( "{peer_id:#}" ) ,
927+ unvalidated_payload_len,
928+ valid_payload_len=valid_payload. len( ) ,
929+ "received `PooledTransactions` response from peer with duplicate entries, filtered them out "
936930 ) ;
937931 }
938932 // valid payload will have at least one transaction at this point. even if the tx
@@ -1014,7 +1008,6 @@ impl<T: NetworkPrimitives> Default for TransactionFetcher<T> {
10141008 hashes_fetch_inflight_and_pending_fetch : LruMap :: new (
10151009 DEFAULT_MAX_CAPACITY_CACHE_INFLIGHT_AND_PENDING_FETCH ,
10161010 ) ,
1017- filter_valid_message : Default :: default ( ) ,
10181011 info : TransactionFetcherInfo :: default ( ) ,
10191012 metrics : Default :: default ( ) ,
10201013 }
0 commit comments