This repository was archived by the owner on Nov 15, 2023. It is now read-only.
[WIP] Switch from devp2p to libp2p#263
Closed
tomaka wants to merge 1 commit intoparitytech:masterfrom
Closed
Conversation
Contributor
Author
|
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. |
Contributor
Author
|
I've been asked to use a branch in the local repo instead, so re-opening as #268 |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #187
Removes the
ethcore-network-devp2pcrate and integrates a newsubstrate-libp2pcrate.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_NODErequest every 30 seconds, and tries to open the/substrate/dot/0protocol with each of the resulting nodes (until we reachmin_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 theQmpart 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.