Files
nanoreth/crates/net/discv4
Dan Cline 635203759b feat(discv4): support eth entries (#447)
* add ENRRequest and ENRResponse messages

 * todo: encode and decode impls

* scaffold enrrequest and enrresponse msgs

* implement encodable and decodable for enr

* cargo fmt

* impl sending enr requests

* silence clippy for now

* add todos for enrrequest and response in mocks

* make payload length fold more explicit

* feat: add enr support to ping pong

* integrate enr

* add update methods

* add enr handling

* feat: add enr handling

* integrate fork id

* fix: set frontier forkid

* disable eip868 by default

* address comments

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2022-12-16 14:14:19 +02:00
..
2022-10-25 14:23:24 +02:00

discv4

This is a rust implementation of the Discovery v4 peer discovery protocol.

For comparison to Discovery v5, see discv5#comparison-with-node-discovery-v4

This is inspired by the discv5 crate and reuses its kademlia implementation.

Finding peers

The discovery service continuously attempts to connect to other nodes on the network until it has found enough peers. If UPnP (Universal Plug and Play) is supported by the router the service is running on, it will also accept connections from external nodes. In the discovery protocol, nodes exchange information about where the node can be reached to eventually establish RLPx sessions.

Trouble Shooting

The discv4 protocol depends on the local system clock. If the clock is not accurate it can cause connectivity issues because the expiration timestamps might be wrong.