Skip to content

Commit

Permalink
rm collect
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Dec 5, 2024
1 parent 7010b18 commit e6c0f18
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
20 changes: 6 additions & 14 deletions crates/net/network/src/transactions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -987,20 +987,12 @@ where
let _ = response.send(Ok(PooledTransactions::default()));
return
}
let transactions = self
.pool
.get_pooled_transaction_elements(
request.0,
GetPooledTransactionLimit::ResponseSizeSoftLimit(
self.transaction_fetcher
.info
.soft_limit_byte_size_pooled_transactions_response,
),
)
.into_iter()
.map(|tx| tx.into_signed())
.collect::<Vec<_>>();

let transactions = self.pool.get_pooled_transaction_elements(
request.0,
GetPooledTransactionLimit::ResponseSizeSoftLimit(
self.transaction_fetcher.info.soft_limit_byte_size_pooled_transactions_response,
),
);
trace!(target: "net::tx::propagation", sent_txs=?transactions.iter().map(|tx| tx.tx_hash()), "Sending requested transactions to peer");

// we sent a response at which point we assume that the peer is aware of the
Expand Down
3 changes: 1 addition & 2 deletions crates/transaction-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ where
&self,
tx_hashes: Vec<TxHash>,
limit: GetPooledTransactionLimit,
) -> Vec<RecoveredTx<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>>
{
) -> Vec<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled> {
self.pool.get_pooled_transaction_elements(tx_hashes, limit)
}

Expand Down
2 changes: 1 addition & 1 deletion crates/transaction-pool/src/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl TransactionPool for NoopTransactionPool {
&self,
_tx_hashes: Vec<TxHash>,
_limit: GetPooledTransactionLimit,
) -> Vec<RecoveredTx<<Self::Transaction as PoolTransaction>::Pooled>> {
) -> Vec<<Self::Transaction as PoolTransaction>::Pooled> {
vec![]
}

Expand Down
4 changes: 2 additions & 2 deletions crates/transaction-pool/src/pool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ where
&self,
tx_hashes: Vec<TxHash>,
limit: GetPooledTransactionLimit,
) -> Vec<RecoveredTx<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>>
) -> Vec<<<V as TransactionValidator>::Transaction as PoolTransaction>::Pooled>
where
<V as TransactionValidator>::Transaction: EthPoolTransaction,
{
Expand All @@ -354,7 +354,7 @@ where
};

size += encoded_len;
elements.push(pooled);
elements.push(pooled.into_signed());

if limit.exceeds(size) {
break
Expand Down
2 changes: 1 addition & 1 deletion crates/transaction-pool/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ pub trait TransactionPool: Send + Sync + Clone {
&self,
tx_hashes: Vec<TxHash>,
limit: GetPooledTransactionLimit,
) -> Vec<RecoveredTx<<Self::Transaction as PoolTransaction>::Pooled>>;
) -> Vec<<Self::Transaction as PoolTransaction>::Pooled>;

/// Returns the pooled transaction variant for the given transaction hash.
///
Expand Down

0 comments on commit e6c0f18

Please sign in to comment.