diff --git a/Cargo.toml b/Cargo.toml index a883abff5..f758d9b67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ deprecated-in-future = "warn" strip = true codegen-units = 1 # https://nnethercote.github.io/perf-book/build-configuration.html#codegen-units lto = "fat" # https://nnethercote.github.io/perf-book/build-configuration.html#link-time-optimization +debug = true # So we can un `perf` on the Rust binary [workspace.dependencies] topos-core = { path = "./crates/topos-core", default-features = false } diff --git a/crates/topos-p2p/src/behaviour/gossip.rs b/crates/topos-p2p/src/behaviour/gossip.rs index 6bf3d341b..ab09cda94 100644 --- a/crates/topos-p2p/src/behaviour/gossip.rs +++ b/crates/topos-p2p/src/behaviour/gossip.rs @@ -25,7 +25,7 @@ use crate::{constants, event::ComposedEvent, TOPOS_ECHO, TOPOS_GOSSIP, TOPOS_REA use super::HealthStatus; -const MAX_BATCH_SIZE: usize = 1024 * 100; +const MAX_BATCH_SIZE: usize = 1024 * 20; pub struct Behaviour { batch_size: usize, diff --git a/crates/topos-tce-broadcast/src/task_manager/mod.rs b/crates/topos-tce-broadcast/src/task_manager/mod.rs index 5e96d1b20..7b7d3302a 100644 --- a/crates/topos-tce-broadcast/src/task_manager/mod.rs +++ b/crates/topos-tce-broadcast/src/task_manager/mod.rs @@ -107,7 +107,7 @@ impl TaskManager { } pub async fn run(mut self, shutdown_receiver: CancellationToken) { - let mut pending_certificate_interval = tokio::time::interval(Duration::from_micros(500)); + let mut pending_certificate_interval = tokio::time::interval(Duration::from_millis(200)); loop { tokio::select! { diff --git a/crates/topos-tce-proxy/src/client.rs b/crates/topos-tce-proxy/src/client.rs index a6682abb5..63d475bfc 100644 --- a/crates/topos-tce-proxy/src/client.rs +++ b/crates/topos-tce-proxy/src/client.rs @@ -22,9 +22,9 @@ use topos_core::{ use tracing::{debug, error, info, info_span, warn, Instrument, Span}; use tracing_opentelemetry::OpenTelemetrySpanExt; -const CERTIFICATE_OUTBOUND_CHANNEL_SIZE: usize = 100; -const CERTIFICATE_INBOUND_CHANNEL_SIZE: usize = 100; -const TCE_PROXY_COMMAND_CHANNEL_SIZE: usize = 100; +const CERTIFICATE_OUTBOUND_CHANNEL_SIZE: usize = 1024 * 10; +const CERTIFICATE_INBOUND_CHANNEL_SIZE: usize = 1024 * 10; +const TCE_PROXY_COMMAND_CHANNEL_SIZE: usize = 1024 * 10; // Maximum backoff retry timeout in seconds (1 hour) const TCE_SUBMIT_CERTIFICATE_BACKOFF_TIMEOUT: Duration = Duration::from_secs(3600); diff --git a/crates/topos-tce-proxy/src/worker.rs b/crates/topos-tce-proxy/src/worker.rs index 0869893af..0011e05dc 100644 --- a/crates/topos-tce-proxy/src/worker.rs +++ b/crates/topos-tce-proxy/src/worker.rs @@ -22,8 +22,8 @@ impl TceProxyWorker { /// Construct a new [`TceProxyWorker`] with a 128 items deep channel to send commands to and receive events from a TCE node on the given subnet. /// The worker holds a [`crate::client::TceClient`] pub async fn new(config: TceProxyConfig) -> Result<(Self, Option<(Certificate, u64)>), Error> { - let (command_sender, mut command_rcv) = mpsc::channel::(128); - let (evt_sender, evt_rcv) = mpsc::channel::(128); + let (command_sender, mut command_rcv) = mpsc::channel::(1024 * 20); + let (evt_sender, evt_rcv) = mpsc::channel::(1024 * 20); let (tce_client_shutdown_channel, shutdown_receiver) = mpsc::channel::>(1); diff --git a/crates/topos-tce-synchronizer/src/builder.rs b/crates/topos-tce-synchronizer/src/builder.rs index a7b70e08a..c85bc88d5 100644 --- a/crates/topos-tce-synchronizer/src/builder.rs +++ b/crates/topos-tce-synchronizer/src/builder.rs @@ -29,7 +29,7 @@ impl Default for SynchronizerBuilder { network_client: None, store: None, config: SynchronizationConfig::default(), - event_channel_size: 100, + event_channel_size: 1024 * 20, shutdown: None, } } diff --git a/crates/topos-tce/src/app_context.rs b/crates/topos-tce/src/app_context.rs index fedc50b66..f7478c508 100644 --- a/crates/topos-tce/src/app_context.rs +++ b/crates/topos-tce/src/app_context.rs @@ -69,7 +69,7 @@ impl AppContext { validator_store: Arc, api_context: RuntimeContext, ) -> (Self, mpsc::Receiver) { - let (events, receiver) = mpsc::channel(100); + let (events, receiver) = mpsc::channel(1024 * 20); ( Self { is_validator,