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

[WIP] Switch from devp2p to libp2p #263

Closed
wants to merge 1 commit into from
Closed

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jun 28, 2018

Close #187

Removes the ethcore-network-devp2p crate and integrates a new substrate-libp2p crate.
The API of this crate is exactly the same as devp2p, so the replacement is quite straight-forward.
Once this is merged I would like to refactor a bit the networking API in order to make it less error-prone.

What the code does on the wire is it performs a random Kademlia FIND_NODE request every 30 seconds, and tries to open the /substrate/dot/0 protocol with each of the resulting nodes (until we reach min_peers, after which it only listens to connections).
Consequently, in practice the bootstrap nodes should be used only for Kademlia and not for substrate/dot, unless there are not enough nodes available.

The format of a peer address in libp2p is not enode://...@..., but /ip4/1.2.3.4/tcp/10000/p2p/Qm... (or /ip6/::1/tcp/10000/p2p/Qm...) where the Qm part is the base56 encoding of a peer ID.

NAT traversal "works" in the sense that nodes have knowledge of their external IP and report it. However there is no such thing as UDP hole punching implemented yet.

I will continue to push commits on this branch in order to improve readability and reliability, but you can can start playing with it if you want. Since the change surface is really low, it should be easily rebasable on any other branch.

@gavofyork gavofyork added A0-please_review Pull request needs code review. A3-in_progress Pull request is in progress. No review needed at this stage. and removed A0-please_review Pull request needs code review. labels Jun 29, 2018
@tomaka
Copy link
Contributor Author

tomaka commented Jun 29, 2018

Note that the code can be greatly simplified by having the network immediately start when we create the service, and by passing a list of protocols to the constructor instead of registering them afterwards.

I will only do these changes after this PR has been merged, in order to not introduce merge conflicts.

@tomaka
Copy link
Contributor Author

tomaka commented Jun 30, 2018

I've been asked to use a branch in the local repo instead, so re-opening as #268

@tomaka tomaka closed this Jun 30, 2018
@tomaka tomaka deleted the libp2p2 branch June 30, 2018 07:41
liuchengxu added a commit to chainx-org/substrate that referenced this pull request Aug 23, 2021
* Various fixes

* Correct init

* Add name and url in endowed intentions

* Update wasm

* Init tokens vote weight of endowed

* 10 blocks per session

* Take care of precision between price and cross chain assets

* Update wasm

* Fix/spot quotationss  (paritytech#260)

rename online&add some event

* compile wasm

* compile wasm

* Fix run bug

* new genesis

* Add straging telemetry url

* update genesis

* Fix bridge storage name (paritytech#263)

* Fix bridge storage name

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Add pub

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update new wasm

* update genesis

* Adjust penalty as 0

* update genesis

* Fix/handicap (paritytech#264)

* fix handicap

* Let auth3 is charlie

* Rebuild
liuchengxu added a commit to chainx-org/substrate that referenced this pull request Aug 23, 2021
* Add FullIdentification type

* Update res/chainx_types.json
liuchengxu pushed a commit to autonomys/substrate that referenced this pull request Jun 3, 2022
Production profile for snapshots/release builds (slower to build and more optimized than just `--release`)
helin6 pushed a commit to boolnetwork/substrate that referenced this pull request Jul 25, 2023
* [jsonrpsee http client]: support tokio1 & tokio02.

* review grumbles: http client make non-optional
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants