From 7946a36e1451db0bad4c965b18d221b8a718776b Mon Sep 17 00:00:00 2001 From: goshawk-3 Date: Mon, 27 May 2024 12:01:37 +0300 Subject: [PATCH] node: Use proper hops_limit config --- node/src/chain/fsm.rs | 5 ++++- node/src/network.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/node/src/chain/fsm.rs b/node/src/chain/fsm.rs index 7c315e9a22..aae7d399a3 100644 --- a/node/src/chain/fsm.rs +++ b/node/src/chain/fsm.rs @@ -30,7 +30,10 @@ use tracing::{debug, error, info, warn}; const MAX_BLOCKS_TO_REQUEST: i16 = 50; const EXPIRY_TIMEOUT_MILLIS: i16 = 5000; const DEFAULT_CERT_CACHE_EXPIRY: Duration = Duration::from_secs(60); -const DEFAULT_HOPS_LIMIT: u16 = 128; + +/// Maximum number of hops between the requester and the node that contains the +/// requested resource +const DEFAULT_HOPS_LIMIT: u16 = 16; pub(crate) const REDUNDANCY_PEER_FACTOR: usize = 5; type SharedHashSet = Arc>>; diff --git a/node/src/network.rs b/node/src/network.rs index dab267cafa..d6eddb6023 100644 --- a/node/src/network.rs +++ b/node/src/network.rs @@ -260,7 +260,7 @@ impl crate::Network for Kadcast { msg_inv.clone(), self.public_addr, ttl_as_sec, - hops_limit / REDUNDANCY_PEER_COUNT as u16, + hops_limit, )), REDUNDANCY_PEER_COUNT, )