From bb24153af583788a497098c69c068119e65f42ab Mon Sep 17 00:00:00 2001 From: Miraculous Owonubi Date: Wed, 6 Nov 2024 17:11:33 +0300 Subject: [PATCH] chore: define max circuit bytes (#19) --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df120bb..bd6ebe5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -368,7 +368,7 @@ dependencies = [ [[package]] name = "boot-node" -version = "0.5.0" +version = "0.5.1" dependencies = [ "camino", "clap", diff --git a/Cargo.toml b/Cargo.toml index dc151a6..def6f54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [".", "examples/dcutr", "examples/chat"] [package] name = "boot-node" -version = "0.5.0" +version = "0.5.1" authors = ["Calimero Limited "] edition = "2021" repository = "https://github.com/calimero-network/boot-node" diff --git a/src/main.rs b/src/main.rs index 333fba8..957ed2c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ use tracing_subscriber::EnvFilter; const PROTOCOL_VERSION: &str = concat!("/", env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); const CALIMERO_KAD_PROTO_NAME: StreamProtocol = StreamProtocol::new("/calimero/kad/1.0.0"); +const MAX_RELAY_CIRCUIT_BYTES: u64 = 8 << 20; // 8 MiB #[derive(NetworkBehaviour)] struct Behaviour { @@ -95,7 +96,11 @@ async fn main() -> eyre::Result<()> { }, ping: ping::Behaviour::new(ping::Config::new()), rendezvous: rendezvous::server::Behaviour::new(rendezvous::server::Config::default()), - relay: relay::Behaviour::new(keypair.public().to_peer_id(), Default::default()), + relay: relay::Behaviour::new(keypair.public().to_peer_id(), { + let mut x = relay::Config::default(); + x.max_circuit_bytes = MAX_RELAY_CIRCUIT_BYTES; + x + }), })? .build();