-
Notifications
You must be signed in to change notification settings - Fork 82
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
Use upstream libp2p #820
Use upstream libp2p #820
Conversation
036dff3
to
385fe73
Compare
f7fcb14
to
4fade34
Compare
the rendezvous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Couple of comments inline, I wouldn't worry about the test locally if it passes CI.
It is not passing CI either but hanging forever, I will have a look! |
7623b8a
to
12a4956
Compare
@@ -59,7 +55,7 @@ where | |||
where | |||
T: AsyncRead + Unpin + Send, | |||
{ | |||
let message = upgrade::read_one(io, BUF_SIZE) | |||
let message = upgrade::read_length_prefixed(io, BUF_SIZE) | |||
.await | |||
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also get rid of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use ?
here?
@@ -55,7 +55,7 @@ where | |||
where | |||
T: AsyncRead + Unpin + Send, | |||
{ | |||
let message = upgrade::read_one(io, BUF_SIZE) | |||
let message = upgrade::read_length_prefixed(io, BUF_SIZE) | |||
.await | |||
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
14dcaae
to
102e6b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Couple of comments :)
[[package]] | ||
name = "open-metrics-client" | ||
version = "0.12.0" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "7337d80c23c2d8b1349563981bc4fb531220733743ba8115454a67b181173f0d" | ||
dependencies = [ | ||
"dtoa", | ||
"itoa", | ||
"open-metrics-client-derive-text-encode", | ||
"owning_ref", | ||
] | ||
|
||
[[package]] | ||
name = "open-metrics-client-derive-text-encode" | ||
version = "0.1.1" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "a15c83b586f00268c619c1cb3340ec1a6f59dd9ba1d9833a273a68e6d5cd8ffc" | ||
dependencies = [ | ||
"proc-macro2", | ||
"quote", | ||
"syn", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've opened an issue about this: libp2p/rust-libp2p#2286
SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::Event::RegisterFailed(error))) => { | ||
tracing::error!("Registration with rendezvous node failed: {:#}", error); | ||
SwarmEvent::Behaviour(OutEvent::Rendezvous(libp2p::rendezvous::client::Event::RegisterFailed(error))) => { | ||
tracing::error!("Registration with rendezvous node failed: {:?}", error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error does not implement Display
? Damn.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont think so :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an upstream issue / PR please?
swap/src/cli.rs
Outdated
let mut rendezvous_node = new_swarm(|_, _| RendezvousPointBehaviour { | ||
rendezvous: libp2p::rendezvous::server::Behaviour::new( | ||
libp2p::rendezvous::server::Config::default(), | ||
), | ||
ping: Default::default(), | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could implement Default
here now and make this a bit more concise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its only constructed once and in a test. not sure if worth it
swap/src/cli.rs
Outdated
impl NetworkBehaviourEventProcess<libp2p::rendezvous::Event> for StaticQuoteAsbBehaviour { | ||
fn inject_event(&mut self, event: libp2p::rendezvous::Event) { | ||
if let libp2p::rendezvous::Event::Registered { .. } = event { | ||
impl NetworkBehaviourEventProcess<libp2p::rendezvous::client::Event> for StaticQuoteAsbBehaviour { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doing use libp2p::rendezvous;
would go along way in this file as well.
@@ -59,7 +55,7 @@ where | |||
where | |||
T: AsyncRead + Unpin + Send, | |||
{ | |||
let message = upgrade::read_one(io, BUF_SIZE) | |||
let message = upgrade::read_length_prefixed(io, BUF_SIZE) | |||
.await | |||
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use ?
here?
102e6b4
to
f77f104
Compare
The rendezvous protocol has been merged into upstream. We no longer need to depend on our fork. The ASB no longer works as a rendezvous point.
f77f104
to
a0df789
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thank you!
Feel free to merge once green.
bors r+ |
todo: remove ping