From b98bf85fa94f95996830cd0f4097ab4d51d7e013 Mon Sep 17 00:00:00 2001 From: Bastian Gruber Date: Thu, 18 Apr 2024 12:53:43 -0300 Subject: [PATCH] fix: increase channel sizes and interval speed further --- crates/topos-config/src/tce/synchronization.rs | 2 +- crates/topos-p2p/src/behaviour/gossip.rs | 4 ++-- crates/topos-sequencer-subnet-runtime/src/proxy.rs | 2 +- crates/topos-tce-api/src/grpc/mod.rs | 2 +- crates/topos-tce-broadcast/src/task_manager/mod.rs | 2 +- crates/topos-tce-proxy/src/client.rs | 6 +++--- crates/topos-tce/src/app_context.rs | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/topos-config/src/tce/synchronization.rs b/crates/topos-config/src/tce/synchronization.rs index e09dbd6ad..b6ff4050d 100644 --- a/crates/topos-config/src/tce/synchronization.rs +++ b/crates/topos-config/src/tce/synchronization.rs @@ -23,7 +23,7 @@ impl Default for SynchronizationConfig { } impl SynchronizationConfig { - pub const INTERVAL_SECONDS: u64 = 30; + pub const INTERVAL_SECONDS: u64 = 60; pub const LIMIT_PER_SUBNET: usize = 100; const fn default_interval_seconds() -> u64 { diff --git a/crates/topos-p2p/src/behaviour/gossip.rs b/crates/topos-p2p/src/behaviour/gossip.rs index 6afe89ec4..d5cd8a252 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; +const MAX_BATCH_SIZE: usize = 2048; pub struct Behaviour { batch_size: usize, @@ -76,7 +76,7 @@ impl Behaviour { .unwrap_or(Ok(MAX_BATCH_SIZE)) .unwrap(); let gossipsub = gossipsub::ConfigBuilder::default() - .max_transmit_size(2 * 2048 * 2048) + .max_transmit_size(5 * 2048 * 2048) .validation_mode(gossipsub::ValidationMode::Strict) .message_id_fn(|msg_id| { // Content based id diff --git a/crates/topos-sequencer-subnet-runtime/src/proxy.rs b/crates/topos-sequencer-subnet-runtime/src/proxy.rs index f2edc8f29..8160b62e1 100644 --- a/crates/topos-sequencer-subnet-runtime/src/proxy.rs +++ b/crates/topos-sequencer-subnet-runtime/src/proxy.rs @@ -68,7 +68,7 @@ impl SubnetRuntimeProxy { address: {}, ", &config.http_endpoint, &config.ws_endpoint, &config.subnet_contract_address ); - let (command_sender, mut command_rcv) = mpsc::channel::(1024); + let (command_sender, mut command_rcv) = mpsc::channel::(5120); let ws_runtime_endpoint = config.ws_endpoint.clone(); let http_runtime_endpoint = config.http_endpoint.clone(); let subnet_contract_address = Arc::new(config.subnet_contract_address.clone()); diff --git a/crates/topos-tce-api/src/grpc/mod.rs b/crates/topos-tce-api/src/grpc/mod.rs index 72e386d5d..c7e9fbc06 100644 --- a/crates/topos-tce-api/src/grpc/mod.rs +++ b/crates/topos-tce-api/src/grpc/mod.rs @@ -29,7 +29,7 @@ pub(crate) mod console; #[cfg(test)] mod tests; -const DEFAULT_CHANNEL_STREAM_CAPACITY: usize = 1024; +const DEFAULT_CHANNEL_STREAM_CAPACITY: usize = 5120; pub(crate) mod builder; pub(crate) mod messaging; diff --git a/crates/topos-tce-broadcast/src/task_manager/mod.rs b/crates/topos-tce-broadcast/src/task_manager/mod.rs index f1dec56e4..783945f8f 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 interval = tokio::time::interval(Duration::from_millis(15)); + let mut interval = tokio::time::interval(Duration::from_millis(5)); loop { tokio::select! { diff --git a/crates/topos-tce-proxy/src/client.rs b/crates/topos-tce-proxy/src/client.rs index 11f477157..18f917cc9 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 = 2048; -const CERTIFICATE_INBOUND_CHANNEL_SIZE: usize = 2048; -const TCE_PROXY_COMMAND_CHANNEL_SIZE: usize = 2048; +const CERTIFICATE_OUTBOUND_CHANNEL_SIZE: usize = 5120; +const CERTIFICATE_INBOUND_CHANNEL_SIZE: usize = 5120; +const TCE_PROXY_COMMAND_CHANNEL_SIZE: usize = 5120; // 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/src/app_context.rs b/crates/topos-tce/src/app_context.rs index fa35e825a..1a410438c 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(2048); + let (events, receiver) = mpsc::channel(5120); ( Self { is_validator,