1 of 25

ETH 2.0(Serenity) Networking

Kevin Mai-Hsuan Chia

Ethereum Foundation

2 of 25

About me

  • Kevin(Mai-Hsuan) Chia, 賈脈瑄
  • Ethereum Research, ETH 2.0 Python implementation
  • Github/gitter id: mhchia
  • mhchia@ethereum.org

3 of 25

Peer-to-Peer networking in ETH 1.0

4 of 25

ETH 1.0 Node

Dapp

Consensus

Peer-to-Peer networking

5 of 25

ETH 1.0 Node

Dapp

Consensus

Peer-to-Peer networking

6 of 25

Peer-to-Peer networking

Discovery

Gossiping

RPC calls between peers

  • broadcast_transaction
  • broadcast_block
  • Bootstrapping nodes
  • find_peer

  • GetBlockHeader
  • GetBlockBody

7 of 25

ETH 2.0 Networking Requirement

8 of 25

Requirement

  • Shard subscription: clients should be able to subscribe to one or more shards

9 of 25

Requirement

  • Shard subscription: clients should be able to subscribe to one or more shards
    • And should only receive the data from the shards it has subscribed

10 of 25

Requirement

  • Shard subscription: clients should be able to subscribe to one or more shards
    • And should only receive the data from the shards it has subscribed
  • Shard peer discovery

11 of 25

  • broadcast_transaction
  • broadcast_block
  • broadcast_transaction_in_shard
  • broadcast_block_in_shard

Peer-to-Peer networking

Discovery

Gossiping

RPC calls between peers

  • Bootstrapping nodes
  • find_peer
  • find_peers_in_shard

  • GetBlockHeader
  • GetBlockBody
  • ...

ETH 2.0

networking

12 of 25

Design

13 of 25

Discovery: Discovery V5

  • Support topic advertisements
    • Nodes can advertise topics. Advertisements can be queried and nodes advertising a topic are found.
  • topic = “shard-{number}-(transaction|block)”

14 of 25

RPC methods in Phase 0

15 of 25

RPC methods in Phase 0

  • Hello
  • Goodbye
  • Get Status
  • Request Beacon Block Roots
  • Beacon Block Headers
  • Beacon Block Bodies
  • Beacon Chain State

16 of 25

Gossiping: PubSub

publisher

subscriber

topic

17 of 25

Gossiping: PubSub

  • topic = “shard-{number}-(transaction|block)”

publisher

subscriber

topic

18 of 25

libp2p

  • Is extracted from IPFS, and already used in many projects
  • Supports many networking modules

19 of 25

Why libp2p?

  • Provides well-maintained modules we need
    • E.g. Kademlia DHT, GossipSub
  • Is supported in multple languages
    • Implemented in Go, Rust, Javascript, Nim, Python
    • libp2p-daemon usable for the non-implemented languages with bindings
  • Allows us to do experiments with various technology
    • E.g. QUIC, Tor

20 of 25

devp2p v.s. libp2p

21 of 25

Current status

22 of 25

Testnets

  • Several clients launched client-internal testnets for phase 0
  • Some clients use libp2p, while some others don’t, implementing with a minimal wire protocol called Hobbits(https://github.com/Whiteblock/hobbits)

23 of 25

20190409 ETH2.0 Networking workshop

https://notes.ethereum.org/Zk4oL1m_SV2jQR8poRQrPg#Propagation

  • Networking spec
  • libp2p daemon
  • libp2p pubsub

24 of 25

Ongoing R&D works

25 of 25