Skip to content

Commit

Permalink
fix(client): expand replicator_factor to get more closest_peers
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Dec 15, 2024
1 parent 0e8ded4 commit 9bea82c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ant-networking/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const PERIODIC_KAD_BOOTSTRAP_INTERVAL_MAX_S: u64 = 21600;

// Init during compilation, instead of runtime error that should never happen
// Option<T>::expect will be stabilised as const in the future (https://github.com/rust-lang/rust/issues/67441)
const REPLICATION_FACTOR: NonZeroUsize = match NonZeroUsize::new(CLOSE_GROUP_SIZE) {
const REPLICATION_FACTOR: NonZeroUsize = match NonZeroUsize::new(CLOSE_GROUP_SIZE + 2) {
Some(v) => v,
None => panic!("CLOSE_GROUP_SIZE should not be zero"),
};
Expand Down
4 changes: 4 additions & 0 deletions ant-networking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,10 @@ impl Network {
.await?;
// Filter out results from the ignored peers.
close_nodes.retain(|peer_id| !ignore_peers.contains(peer_id));
info!(
"For record {record_address:?} quoting {} nodes. ignore_peers is {ignore_peers:?}",
close_nodes.len()
);

if close_nodes.is_empty() {
error!("Can't get store_cost of {record_address:?}, as all close_nodes are ignored");
Expand Down

0 comments on commit 9bea82c

Please sign in to comment.