-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(network): README #2100
docs(network): README #2100
Conversation
1b72fc8
to
a1a3cf7
Compare
Codecov Report
@@ Coverage Diff @@
## development #2100 +/- ##
============================================
Coverage 61.35% 61.36%
============================================
Files 202 202
Lines 27355 27355
============================================
+ Hits 16785 16787 +2
+ Misses 8694 8691 -3
- Partials 1876 1877 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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 you said this is a WIP, but looks great so far!
f3477da
to
7fcabc1
Compare
dot/network/README.md
Outdated
[key distribution](#identity--key-management) capabilities. The Noise protocol is | ||
[well documented](http://cryptowiki.net/index.php?title=Noise_Protocol_Framework) and the Go implementation is |
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.
it might be nicer to link to the libp2p spec: https://github.com/libp2p/specs/blob/master/noise/README.md afaik the libp2p version of noise and the "official" version have some slight differences
dot/network/README.md
Outdated
unidirectionally "push" information to other peers in the network. Although the peer receiving the information must | ||
explicitly accept a handshake in order to open a stream for a notification protocol, this stream does not allow the | ||
receiver to "push" information to the sender. |
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.
unidirectionally "push" information to other peers in the network. Although the peer receiving the information must | |
explicitly accept a handshake in order to open a stream for a notification protocol, this stream does not allow the | |
receiver to "push" information to the sender. | |
unidirectionally "push" information to other peers in the network. On stream opening, the outgoing and incoming sides will exchange a handshake. After this handshake is completed, the incoming side is closed for writing; ie. the receiver of the stream can only receive data over the stream, but not write to it. The opposite is true for the outgoing side; the stream is closed for reading after the handshake has completed, and data can only be sent. |
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'd also update this to say something like "the stream can be left open indefinitely until one side no longer wishes to communicate"
dot/network/README.md
Outdated
contains a [block header](https://docs.substrate.io/v3/getting-started/glossary/#header) and associated data, such as | ||
the [BABE pre-runtime digest](https://crates.parity.io/sp_consensus_babe/digests/enum.PreDigest.html). |
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.
the BABE digests are part of the header, so I'd just leave this as saying the message is a block header.
dot/network/README.md
Outdated
[Finality](https://wiki.polkadot.network/docs/learn-consensus#finality-gadget-grandpa) protocols ("gadgets") such as | ||
GRANDPA are often described in terms of "games" that are played by the participants in a network. In GRANDPA, this game | ||
relates to voting on the blocks that inform the canonical chain. This notification protocol is used by peers to cast | ||
votes for participation in the GRANDPA game. |
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.
votes for participation in the GRANDPA game. | |
votes for participation in the GRANDPA game, and as well to gossip a `Commit` message when a chain has been finalised. |
dot/network/README.md
Outdated
|
||
[These protocols](https://crates.parity.io/sc_network/index.html#request-response-protocols) allow peers to request | ||
specific information from one another. The requesting peer sends a protocol-specific message that describes the request | ||
and the peer to which the request was sent replies with a message. |
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'd update this to also say if a node opens a stream with some remote peer, then the outgoing side will only push requests and the incoming side will only expect to receive requests. same for the other way around, the outgoing side expects to only receive responses.
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.
nice work! just a few comments/suggestions. it might also be good to add something about "polite gossip" - ie. don't send the same message to a peer twice and that kinda thing
peer-to-peer networks use have evolved over time - [Napster](https://en.wikipedia.org/wiki/Napster) relied on a central | ||
database, [Gnutella](https://en.wikipedia.org/wiki/Gnutella) used a brute-force technique called "flooding", | ||
[BitTorrent](https://en.wikipedia.org/wiki/BitTorrent) takes a performance-preserving approach that relies on a | ||
[distributed hash table (DHT)](https://en.wikipedia.org/wiki/Distributed_hash_table). Gossamer uses a `libp2p`-based |
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.
BitTorrent also uses Kademlia
Co-authored-by: Quentin McGaw <quentin.mcgaw@gmail.com>
Co-authored-by: Eclésio Junior <eclesiomelo.1@gmail.com>
Co-authored-by: noot <36753753+noot@users.noreply.github.com>
9dd1fd5
to
e26b4c9
Compare
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.
looks good to me! do you still plan to add links to the codebase here? oh, and also stuff about polite gossip?
@noot yes I am working on "deeper" links into the codebase/godocs but if you think this is correct and compete enough I say that we go ahead and merge it in and I can continue with iterative improvements on the docs 👍🏻 |
Changes
Added README to
network
package. Rendered docs here.Tests
N/A
Issues
Closes #2036
Primary Reviewer
@noot