Skip to content

Commit

Permalink
node: Use proper hops_limit config
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk-3 committed May 27, 2024
1 parent 88c3197 commit 7946a36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion node/src/chain/fsm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RwLock<HashSet<[u8; 32]>>>;
Expand Down
2 changes: 1 addition & 1 deletion node/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl<const N: usize> crate::Network for Kadcast<N> {
msg_inv.clone(),
self.public_addr,
ttl_as_sec,
hops_limit / REDUNDANCY_PEER_COUNT as u16,
hops_limit,
)),
REDUNDANCY_PEER_COUNT,
)
Expand Down

0 comments on commit 7946a36

Please sign in to comment.