-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add Networking Layer materials to /developers/docs #5838
Conversation
Gatsby Cloud Build Reportethereum-org-website-dev 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 13m PerformanceLighthouse report
|
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.
Hey @jmcook1186, this is great! Things are nicely organised and very well explained. Really enjoyed reading it so far.
Done a partial review because I'm trying to wrap my head around concepts whilst reviewing and it's taking a while 😬 will look again later.
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
…/index.md Co-authored-by: Joshua <[email protected]>
…/index.md Co-authored-by: Joshua <[email protected]>
…/index.md Co-authored-by: Joshua <[email protected]>
…/index.md Co-authored-by: Joshua <[email protected]>
Co-authored-by: Joshua <[email protected]>
…/index.md Co-authored-by: Joshua <[email protected]>
Co-authored-by: Joshua <[email protected]>
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.
@jmcook1186 Nicely done =) This was a good read, learned some things in the process. Left a couple small adjustments / typo corrections, but nothing too significant.
General question: Handful or eth1
and eth2
terms floating around... do you know if any of these have updated names since the renaming?
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
src/content/developers/docs/networking-layer/network-addresses/index.md
Outdated
Show resolved
Hide resolved
|
||
## Ethereum Node Records (ENRs) {#enr} | ||
|
||
Ethereum Node Records (ENRs) are a standardized format for network addresses on Ethereum. They supercede multiaddr's and enodes. These are especially useful because they allow greater informational exchange between nodes. The ENR contains a signature, sequence number and fields detailing the identity scheme used to generate and validate signatures. The ENR can also be populated with arbitrary data organized as key-value pairs. These key-value pairs contain the node's IP address and information about the sub-protocols the node is able to use. Consensus clients use a [specific ENR structure](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/p2p-interface.md#enr-structure) to identify boot nodes and also include an `eth2` field containing information about the current Ethereum fork and the attestation gossip subnet (this connects the node to a particular set of peers whose attestations are aggregated together). |
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.
Same as before, do we have an updated term for eth2
here since the renaming?
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 the eth2
field persists - there are no updates to this in the capella, altair or bellatrix specs afaics
|
||
Discovery is the process of finding other nodes in network. This is bootstrapped using a small set of bootnodes (nodes whose addresses are [hardcoded](https://github.com/ethereum/go-ethereum/blob/master/params/bootnodes.go) into the client so they can be found immediately and connect the client to peers). These bootnodes only exist to introduce a new node to a set of peers - this is their sole purpose, they do not participate in normal client tasks like syncing the chain, and they are only used the very first time a client is spun up. | ||
|
||
The protocol used for the node-bootnode interactions is a modified form of [Kademlia](https://medium.com/coinmonks/a-brief-overview-of-kademlia-and-its-use-in-various-decentralized-platforms-da08a7f72b8f) which uses a distributed hash table to share lists of nodes. Each node has a version of this table containing the information required to connect to its closest peers. This 'closeness' is not geographical - distance is defined by the similarity of the node's ID. Each node's table is regularly refreshed as a security feature. For example, in the [Discv5](https://github.com/ethereum/devp2p/tree/master/discv5), discovery protocol nodes are also able to send 'ads' that display the subprotocols that the client supports, allowing peers to negotiate about the protocols they can both use to communicate over. |
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.
Slightly confused by the link to https://github.com/ethereum/devp2p/tree/master/discv5 - I didn't think devp2p was for discovery? Or are certain elements of it used for discovery?
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.
yea I've never been able to get an unambiguous answer about the scope of DevP2P. In my opinion although discv5 protocol is part of devp2p stack the networking layer is still best considered to be 3 distinct layers: discovery, devp2p and subprotocols, because this divides the whole layer up cleanly by function (find peers, establish and maintain secure connections, implement ethereum protocols).
|
||
#### ENR: Ethereum Node Records {#enr} | ||
|
||
The [Ethereum Node Record (ENR)](/developers/docs/networking-layer/network addresses/) is an object that contains three basic elements: a signature (hash of record contents made according to some agreed identity scheme), a sequence number that tracks changes to the record, and an arbitrary list of key:value pairs. This is a future-proof format that allows easier exchange of identifying information between new peers and is the preferred [network address](/developers/docs/networking-layer/network-addresses) format for Ethereum nodes. |
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.
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.
working for me...
Co-authored-by: Sam Richards <[email protected]> Co-authored-by: Joshua <[email protected]> Co-authored-by: Paul Wackerow <[email protected]>
Co-authored-by: Paul Wackerow <[email protected]>
Description
This PR adds a new directory,
networking-layer
to/developers/docs/
. This directory includes a landing page with new material relating to the Ethereum networking layer, on both the execution and consensus layer. There is also a subdirectorynetwork-addresses
that includes material relating to multiaddr, enode and ENR address types.These pages will act as redirect targets for several pages on the deprecated eth.wiki and ethdocs.org.
Most of the material is new, but the information on enodes is migrated from eth.wiki.
Related Issue
This resolves suggested PR 4 and 9 from #5690 and will enable several redirects from eth.wiki and ethdocs.org as explained in issues #5690 and #5731.