From 2af42fbb2f552e8aa14112bd7e4f4d2d1695e6cc Mon Sep 17 00:00:00 2001 From: Kirill Lykov Date: Mon, 2 Dec 2024 17:12:28 +0100 Subject: [PATCH] add comment for size of channel --- send-transaction-service/src/transaction_client.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/send-transaction-service/src/transaction_client.rs b/send-transaction-service/src/transaction_client.rs index 2b0821f999dde6..c3a47b4a3d9722 100644 --- a/send-transaction-service/src/transaction_client.rs +++ b/send-transaction-service/src/transaction_client.rs @@ -230,6 +230,11 @@ where where T: TpuInfoWithSendStatic + Clone, { + // The channel size is a compromise value designed to prevent packet + // loss during outages lasting up to (128 * batch_size / rpc_tps) + // seconds. + // For a reasonable batch_size of 64 and rpc_tps of approximately 1000 transactions per second, + // this channel size can handle an outage of up to 8 seconds without dropping packets. let (sender, receiver) = mpsc::channel(128); let cancel = CancellationToken::new();