Skip to content
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

Merged
merged 33 commits into from
May 16, 2022
Merged

Add Networking Layer materials to /developers/docs #5838

merged 33 commits into from
May 16, 2022

Conversation

jmcook1186
Copy link
Contributor

@jmcook1186 jmcook1186 commented Mar 30, 2022

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 subdirectory network-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.

@github-actions github-actions bot added content 🖋️ This involves copy additions or edits review needed 👀 labels Mar 30, 2022
@gatsby-cloud
Copy link

gatsby-cloud bot commented Mar 30, 2022

Gatsby Cloud Build Report

ethereum-org-website-dev

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 13m

Performance

Lighthouse report

Metric Score
Performance 🔶 24
Accessibility 💚 100
Best Practices 💚 100
SEO 💚 92

🔗 View full report

@jmcook1186 jmcook1186 marked this pull request as ready for review March 30, 2022 13:30
Copy link
Contributor

@minimalsm minimalsm left a 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/index.md Outdated Show resolved Hide resolved
src/content/developers/docs/networking-layer/index.md Outdated Show resolved Hide resolved
src/content/developers/docs/networking-layer/index.md Outdated Show resolved Hide resolved
src/content/developers/docs/networking-layer/index.md Outdated Show resolved Hide resolved
src/content/developers/docs/networking-layer/index.md Outdated Show resolved Hide resolved
Copy link
Member

@wackerow wackerow left a 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/index.md Outdated Show resolved Hide resolved
src/content/developers/docs/networking-layer/index.md Outdated Show resolved Hide resolved
src/content/developers/docs/networking-layer/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).
Copy link
Member

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?

Copy link
Contributor Author

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.
Copy link
Member

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?

Copy link
Contributor Author

@jmcook1186 jmcook1186 May 10, 2022

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.
Copy link
Member

Choose a reason for hiding this comment

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

Hmmm not sure why this Ethereum Node Record (ENR) link appears to not render?

Screen Shot 2022-05-06 at 12 47 48 PM

The markdown syntax looks correct 🧐

Copy link
Contributor Author

Choose a reason for hiding this comment

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

working for me...

@minimalsm minimalsm merged commit 4db2b66 into ethereum:dev May 16, 2022
@corwintines corwintines mentioned this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content 🖋️ This involves copy additions or edits
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants