Skip to content

Commit 6c908ca

Browse files
authored
perf(net): avoid collect allocation in tx announcement trace log (paradigmxyz#22985)
1 parent 093621f commit 6c908ca

File tree

1 file changed

+2
-1
lines changed
  • crates/net/network/src/transactions

1 file changed

+2
-1
lines changed

crates/net/network/src/transactions/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Transactions management for the p2p network.
22
33
use alloy_consensus::transaction::TxHashRef;
4+
use itertools::Itertools;
45
use rayon::iter::{IntoParallelIterator, ParallelIterator};
56

67
/// Aggregation on configurable parameters for [`TransactionsManager`].
@@ -758,7 +759,7 @@ impl<Pool: TransactionPool, N: NetworkPrimitives> TransactionsManager<Pool, N> {
758759
trace!(target: "net::tx::propagation",
759760
peer_id=format!("{peer_id:#}"),
760761
hashes_len=valid_announcement_data.len(),
761-
hashes=?valid_announcement_data.keys().collect::<Vec<_>>(),
762+
hashes=%valid_announcement_data.keys().format(", "),
762763
msg_version=%valid_announcement_data.msg_version(),
763764
client_version=%client,
764765
"received previously unseen and pending hashes in announcement from peer"

0 commit comments

Comments
 (0)