Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update libp2p to v0.3 #1634

Merged
merged 23 commits into from
Feb 6, 2019
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jan 31, 2019

I'm marking this as "WIP" because the connectivity test has some issues which I'm trying to find out.
We spawn 25 nodes and the test succeeds when all the nodes are connected to the 24 others, but there are sometimes 2 or 3 them stuck at 22 or 23 connections.

@tomaka
Copy link
Contributor Author

tomaka commented Jan 31, 2019

For what it's worth, the test failure is very very likely caused by nodes trying to dial each other simultaneously. This is something that in practice only happens in a local network.
In --release, the test passes.
However I'd like to get to the bottom of this and try to properly fix this problem once and for all.

@tomaka tomaka mentioned this pull request Feb 4, 2019
@tomaka tomaka added A0-please_review Pull request needs code review. and removed A1-onice labels Feb 5, 2019
@tomaka tomaka changed the title [WIP] Update libp2p to v0.3 Update libp2p to v0.3 Feb 5, 2019
@arkpar
Copy link
Member

arkpar commented Feb 6, 2019

Does it break compatibility?

@tomaka
Copy link
Contributor Author

tomaka commented Feb 6, 2019

Libp2p is 0.3 because of some API breaking changes within libp2p itself. So no.
As for ring 0.14, I don't know.

@arkpar
Copy link
Member

arkpar commented Feb 6, 2019

I mean the network level compatibility. Would it be able to connect and communicate to 0.2 nodes?

@tomaka
Copy link
Contributor Author

tomaka commented Feb 6, 2019

Yes!

Copy link
Member

@bkchr bkchr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question.

@@ -90,11 +73,15 @@ where TProtos: IntoIterator<Item = RegisteredProtocol> {
}
}

// Add the bootstrap nodes to the topology and connect to them.
/*// Add external addresses.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that still required or just some leftover?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I forgot to uncomment this.

// kind of blurry. This problem will become irrelevant after
// https://github.com/paritytech/substrate/issues/1517
// TODO: also, we should shut down refused substreams gracefully; this should be fixed
// at the same time as the todo above
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just start in Enabled state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting in the enabled state also has trade-offs, most notably slightly poorer logs if we're unlucky. However I'll make the switch.

@arkpar arkpar merged commit 86f26a7 into paritytech:master Feb 6, 2019
@tomaka tomaka deleted the update-libp2p-20190129 branch February 6, 2019 15:48
andresilva pushed a commit that referenced this pull request Feb 6, 2019
* 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
MTDK1 pushed a commit to bdevux/substrate that referenced this pull request Apr 12, 2019
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants