-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make kad::kbucket::Distance public again? #4108
Comments
Sorry for the trouble. No objections from my end. Mind creating a pull request? |
Perfect, will do! |
Similarly, there are a few interfaces no longer exposed in 0.52.0 in KBucketRef ( fn dial_next_peer(&mut self) {
let mut to_dial = None;
for kbucket in self.swarm.behaviour_mut().kad.kbuckets() {
if let Some(range) = self.kad_last_range {
if kbucket.range() == range {
continue;
}
}
// find the first disconnected node
for entry in kbucket.iter() {
if entry.status == NodeStatus::Disconnected {
let peer_id = entry.node.key.preimage();
let dial_opts = DialOpts::peer_id(*peer_id)
.condition(PeerCondition::Disconnected)
.addresses(entry.node.value.clone().into_vec())
.extend_addresses_through_behaviour()
.build();
to_dial = Some((dial_opts, kbucket.range()));
break;
}
}
}
if let Some((dial_opts, range)) = to_dial {
if let Err(e) = self.swarm.dial(dial_opts) {
warn!("failed to dial: {:?}", e);
}
self.kad_last_range = Some(range);
}
} |
@jsantell not opposed to exposing them, though in your above example, given that you don't reference the concrete types, do you actually need them exposed? |
Adds back in Distance as a public type. Follows `KBucketKey` naming for clarity. Resolves #4108. Pull-Request: #4109. Co-Authored-By: Josh Wilson <[email protected]> Co-Authored-By: Max Inden <[email protected]>
Are you currently running But perhaps that didn't work? Are you currently seeing those deprecation warnings? |
Just chiming in to mention that we did not see deprecation warnings. The reason is probably because the |
In this snippet, we check the status of the |
Interesting, I just checked out your repo and I can see a deprecation warning in my IDE: Yet, |
This almost seems like a rustc bug to me. Even with double |
Sorry, yes, I am conflating my language here a bit. But, you're right, we don't even see the warning with |
I think so yes although a quick search didn't reveal anything. cc @mxinden It seems that most of our efforts around deprecating modules so far was not very successful. |
Oh, that is surprising. They did show up whenever I upgraded https://github.com/mxinden/libp2p-lookup/, https://github.com/mxinden/kademlia-exporter/ and https://github.com/mxinden/rust-libp2p-server/. |
The EntryView struct exposes the node status however its type is not public making it impossible to use the status field. This change re-exports NodeStatus according to the existing naming pattern. See libp2p#4108 which was fixed however the NodeStatus type was not exposed.
The EntryView struct exposes the node status however its type is not public making it impossible to use the status field. This change re-exports NodeStatus according to the existing naming pattern. See libp2p#4108 which was fixed however the NodeStatus type was not exposed.
The EntryView struct exposes the node status however its type is not public making it impossible to use the status field. This change re-exports NodeStatus according to the existing naming pattern. See libp2p#4108 which was fixed however the NodeStatus type was not exposed.
We rely on the public
kbucket::Key
and use the.distance()
in some functionality.https://github.com/maidsafe/safe_network/blob/main/sn_protocol/src/lib.rs#L113C1-L116C6
I was have a look at upgrading but as of 0.52
Distance
is no longer exposed. #4103Is there a blocker to reenabling that as a
pub
API?The text was updated successfully, but these errors were encountered: