Update libp2p to v0.3 (#1634)

* Update libp2p

* Some more diagnostics

* 30 seconds back to 5 seconds

* Bump libp2p-core and improve test

* Fix runtime Cargo.lock

* More work

* Finish upgrade to libp2p 0.3

* Add a maximum of 60 seconds for the rounds

* Remove env_logger

* Update Cargo.lock

* Update Cargo.lock in test-runtime

* Fix test compilation

* Make the test pass

* Add identify addresses to Kademlia

* Don't connect to nodes we're already connected to

* Add warning for non-Substrate nodes

* Fix external address not added

* Start in Enabled mode
This commit is contained in:
Pierre Krieger
2019-02-06 16:39:22 +01:00
committed by Arkadiy Paronyan
parent 7d8ae2df5c
commit b6fd967dfb
18 changed files with 599 additions and 411 deletions
+8 -5
View File
@@ -124,7 +124,7 @@ fn two_nodes_transfer_lots_of_packets() {
});
let combined = fut1.select(fut2).map_err(|(err, _)| err);
tokio::runtime::Runtime::new().unwrap().block_on_all(combined).unwrap();
tokio::runtime::Runtime::new().unwrap().block_on(combined).unwrap();
}
#[test]
@@ -148,10 +148,13 @@ fn many_nodes_connectivity() {
return Ok(Async::Ready(Some(())))
}
}
// TODO: we sometimes receive a closed connection event; maybe this is
// benign, but it would be nice to figure out why
// (https://github.com/libp2p/rust-libp2p/issues/844)
Some(ServiceEvent::ClosedCustomProtocol { .. }) => {}
Some(ServiceEvent::ClosedCustomProtocol { .. }) => {
// Only remove 1 if we haven't returned success yet, otherwise we
// will succeed the test multiple times.
if num_connecs < NUM_NODES - 1 {
num_connecs -= 1;
}
}
_ => panic!(),
}
}