-
Notifications
You must be signed in to change notification settings - Fork 165
Conversation
e049b6a
to
a0ae83d
Compare
error[E0053]: method `poll` has an incompatible type for trait
--> src/p2p/pubsub.rs:328:10
|
328 | ) -> Poll<PubsubNetworkBehaviourAction> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected enum `Void`, found enum `floodsub::layer::InnerMessage`
| help: change the output type to match the trait: `Poll<libp2p::libp2p_swarm::NetworkBehaviourAction<Void, OneShotHandler<FloodsubProtocol, FloodsubRpc, floodsub::layer::InnerMessage>, FloodsubRpc>>`
|
= note: expected fn pointer `fn(&mut Pubsub, &mut std::task::Context<'_>, &mut impl PollParameters) -> Poll<libp2p::libp2p_swarm::NetworkBehaviourAction<Void, _, _>>`
found fn pointer `fn(&mut Pubsub, &mut std::task::Context<'_>, &mut impl PollParameters) -> Poll<libp2p::libp2p_swarm::NetworkBehaviourAction<floodsub::layer::InnerMessage, _, _>>`
|
@mxinden I believe these are issues stemming from libp2p. error[E0599]: no method named `into_inner` found for struct `KademliaHandler` in the current scope
--> src/p2p/behaviour.rs:25:10
|
25 | #[derive(libp2p::NetworkBehaviour)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `KademliaHandler<QueryId>`
|
= note: this error originates in the derive macro `libp2p::NetworkBehaviour` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named `into_inner` found for struct `KademliaHandlerProto` in the current scope
--> src/p2p/behaviour.rs:25:10
|
25 | #[derive(libp2p::NetworkBehaviour)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `KademliaHandlerProto<QueryId>`
|
= note: this error originates in the derive macro `libp2p::NetworkBehaviour` (in Nightly builds, run with -Z macro-backtrace for more info) For this struct #[derive(libp2p::NetworkBehaviour)]
#[behaviour(out_event = "BehaviourEvent")]
pub struct Behaviour<Types: IpfsTypes> {
#[behaviour(ignore)]
repo: Arc<Repo<Types>>,
// mdns: Toggle<TokioMdns>,
kademlia: Kademlia<MemoryStore>,
#[behaviour(ignore)]
kad_subscriptions: SubscriptionRegistry<KadResult, String>,
bitswap: Bitswap,
ping: Ping,
identify: Identify,
pubsub: Pubsub,
pub swarm: SwarmApi,
} |
Isn't libp2p-swarm supposed to be version 0.35.0? error: failed to select a version for the requirement `libp2p-swarm = "^0.35"`
candidate versions found which didn't match: 0.34.0, 0.33.0, 0.32.0, ...
location searched: crates.io index |
|
Thanks for doing this @rand0m-cloud. I was on a vacation but back now. Let me know when this is ready, or if you need any help with it. |
I've had a chance to play around more with the code and I can't figure out to how to solve the error. I've compared it to the I am lost but it feels like a bug in the derive macro. |
@rand0m-cloud mind posting the compiler error here? |
Sure, the errors in the PR description are the current ones but here it is again: error[E0599]: no method named `into_inner` found for struct `KademliaHandler` in the current scope
--> src/p2p/behaviour.rs:25:10
|
25 | #[derive(libp2p::NetworkBehaviour)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `KademliaHandler<QueryId>`
|
= note: this error originates in the derive macro `libp2p::NetworkBehaviour` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0599]: no method named `into_inner` found for struct `KademliaHandlerProto` in the current scope
--> src/p2p/behaviour.rs:25:10
|
25 | #[derive(libp2p::NetworkBehaviour)]
| ^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `KademliaHandlerProto<QueryId>`
|
= note: this error originates in the derive macro `libp2p::NetworkBehaviour` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0599`. |
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.
Would this fix your compile time error?
Thanks to @mxinden's workaround, I was able to continue working on the PR. Now the PR builds, lints, but fails testing: failures:
---- p2p::swarm::tests::racy_connecting_attempts stdout ----
thread 'p2p::swarm::tests::racy_connecting_attempts' panicked at 'assertion failed: `(left == right)`
left: `[Err(Some("addresses exhausted")), Err(Some("addresses exhausted"))]`,
right: `[Ok(()), Err(Some("finished connecting to another address"))]`', src/p2p/swarm.rs:517:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
---- p2p::swarm::tests::wrong_peerid stdout ----
thread 'p2p::swarm::tests::wrong_peerid' panicked at 'assertion failed: `(left == right)`
left: `Some("addresses exhausted")`,
right: `Some("Pending connection: Invalid peer ID.")`', src/p2p/swarm.rs:466:21
failures:
p2p::swarm::tests::racy_connecting_attempts
p2p::swarm::tests::wrong_peerid
test result: FAILED. 85 passed; 2 failed; 1 ignored; 0 measured; 0 filtered out; finished in 0.66s |
413fbd1
to
b5df04a
Compare
@koivunej I need some guidance on these test failures. I've traced the error message to Some grepping I did,
The "finished connecting to another address" error seems to be from this crate, so I'll take that test failure as broken from this PR. |
Sorry, but I don't think I am of much help on the rust-ipfs specific tests. |
@rand0m-cloud Yeah ... these connection tests ... They are most likely extra, and become more and more useless now that libp2p must've evolved. Back in the day it was a bit more tricky trying to get the similar behaviour as to go-ipfs. I'll try to check the branch locally tomorrow! Thanks for your work so far. |
src/p2p/swarm.rs
Outdated
for failed in self | ||
.pending_connections | ||
.remove(&peer_id) | ||
.unwrap_or_default() | ||
{ | ||
self.connect_registry | ||
.finish_subscription(failed.into(), Err("addresses exhausted".into())); | ||
} |
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 this unconditionally creates the failure for p2p::swarm::tests::racy_connecting_attempts
.
I wonder ... why were changes around this necessary? Seems this logic would had been easiest to do handle with the old structure using the entry api?
I think this change also affects the p2p::swarm::tests::wrong_peerid
test case.
So in total I see 3 test failures:
For the last two, I think a solution should come out of the discussion thread I already started. For the first one, I think the near-correct answer is to add |
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.
Apart from my comment on the inject_dial_failure I think this is looking good!
b5df04a
to
f6a8312
Compare
Oh, sorry for the noise. I was hoping Github would collapse it all. Just reauthored those commits with my email. |
I've been experiencing |
@koivunej Okay, I think I've re-added the code fragment I removed and would make The problem is the original code was given the Multiaddr it failed to dial from |
Do we need a new |
src/p2p/swarm.rs
Outdated
// it is possible that these addresses have not been tried yet; they will be asked | ||
// for soon. | ||
let handler = self.new_handler(); | ||
self.events.push_back(swarm::NetworkBehaviourAction::Dial { |
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 feel like this needs to be removed? I'm not sure how to adapt the behavior because inject_dial_failure
only tells us when a connection failed to dial.
I think this current block was made for attempting another connection when one fails.
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.
All right ... Looking at the networkbehaviour, I think this is how it used to work:
- dial event is given to swarm
- swarm collects all of the known addresses with
NetworkBehaviour::addresses_of_peer
, dials them somehow - for each of the dials, we used to get a signal that this multiaddr failed and we would signal that future as failure
- there used to be another trait method for having exhausted the addresses, when we'd know to launch a new dial if we'd still have addresses
While writing this @mxinden replied. Oki yeah it would appear the failures have now moved within the dialerror, which I did not expect, AND there is only one "notification" for all of the attempts.
However I think the idea with the original impl was that since there would be one gathering of addresses for the peer (NetworkBehaviour::addresses_of_peer
) per dial events (caused either by "swarm_api" or by any other place) it would be possible to add new addresses during a dial attempt, and those would be noticed at (4) in the above ordered list, and thus get dialed afterwards.
I now realize that this all should had been in the swarm api implementation as comments, but I guess I was expecting the datastructures and network behaviour api to make this "apparent" and did not account for possible future changes in the network behaviour api.
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 for the next steps would be to gather the failed addresses from the error (if found), then continue dialing to the remaining addresses, if any.
this might take care of the node-gyp problem, which might also be fixed by updating it's version.
forgot, you must not use backticks outside apostrophes...
originally created in 8eae8e1 by altering the single topic test, included in this commit as duplicating version. Co-authored-by: Addy Bryant <rand0m-cloud@outlook.com>
simplify away the use of hashset's for messages along with any filtering, instead simply assert that who witnessed what message and include the sent message in the assertion as well. comment as in use less broad technical names and more context specific names. also removes some of the duplicate comments.
needs to be looked at.
I would rather not delay this further and a lot of work has been put into this already. Thanks @rand0m-cloud! I ended up ignoring the problematic windows tests pending a) packet capture b) additional logging in the js test. Also added a FIXME for my concern. bors r+ |
Build succeeded: |
This PR updates the dependency on libp2p. This is needed because currently building
ipfs-http
fails with an ambiguous type error inside oflibp2p
.