specborn documentation contents ↓

Networking: peers, discovery, ports #

Summary #

specborn runspecborn checkpoint-sync
Consensus peersdiscovered from --bootnodes ENR,... and/or listed in --peers FILE; at most --max-peers (16) connections--peers FILE, or discovered from --bootnodes FILE
Execution (eth) peersdiscovered (discv5 records with an eth entry, discv4) and listed in --el-peers FILE; at most --max-el-peers (4) connections to discovered peers, the peers of --el-peers dialed in addition (not counted toward that limit); only when the node has a JSON-RPC server or a transaction poolnone
Discoverydiscv5 and discv4 for the whole run (with --bootnodes)discv5, a bounded walk at start (at most 60 s), again when fewer than 8 peers are connected
UDPdiscv5 on --discovery-port (default: a port the system chooses), discv4 on another system-chosen port; both bound on all interfacesone socket during a discovery walk (--discovery-port N)
Listening TCP ports for peersnonenone
Local TCP portsJSON-RPC 127.0.0.1:8545 (unless --no-rpc); beacon API 127.0.0.1:5052 (only with --beacon-api)none
Inbound peer connectionsnot accepted (no listener)not accepted

specborn only dials out to peers. Its execution layer gets the payloads it executes inside the consensus layer's blocks and envelopes, in the same process; its eth sessions exist to exchange transactions and to serve chain data, not to sync.

The peers file #

--peers FILE lists consensus peers, one per line:

# label is free text for your logs; the peer id is the libp2p peer id (base58)
cl lighthouse-1 127.0.0.1 33000 16Uiu2HAm...
cl teku-1       127.0.0.1 33001 16Uiu2HAm...

Execution peers #

--el-peers FILE lists execution peers (eth protocol over RLPx), one per line:

el geth-1 127.0.0.1 30303 2b0f…(128 hex digits: the node's secp256k1 public key, without the 04 prefix)

Discovery and bootnodes #

specborn run --bootnodes ENR[,ENR...] takes discv5 node records on the command line (comma-separated; the flag may be repeated). specborn checkpoint-sync --bootnodes FILE takes a file with one enr: record per line, such as the bootstrap_nodes.yaml that networks publish in their configuration repositories.

In specborn run (docs/pieces/node.md W7r12, W7r13):

The checkpoint-sync command does a bounded discv5 walk instead (at most 1,024 records, 16 queries at once, 60 seconds or 48 consensus peers; docs/pieces/cpsync.md §14.6).

specborn contains no built-in bootnode: the records are yours. On Hoodi the project used the records published in eth-clients/hoodi (Tests/Cpsync/live/cpsync-hoodi.sh).

Known limit: on a local devnet whose execution clients find each other only through their own bootnode, discovery found every execution client only after that bootnode was configured to answer with the devnet's records (docs/pieces/node.md W7r13.9, open item OPEN-node-el-discovery for the standard devnet).

Ports, NAT and firewalls #

specborn listens on no TCP port for peers, so there is nothing to forward on a router and no inbound TCP rule to open. It needs:

The cost of not listening: other nodes cannot dial specborn, so it relies on peers that accept inbound connections and adds no inbound capacity to the network. Some peers may disconnect a node that relays little or no gossip (the checkpoint-sync command relays none; what specborn run relays is below). Listening for inbound peers is planned.

What the node exchanges with peers #

Misbehaving peers #

All peer input is untrusted and bounded (docs/pieces/node.md §8):

These are behaviour-based and temporary: no address or peer id is put on a fixed list. Apart from the gossip router's peer scores (gossipsub v1.1, kept per peer id and retained for up to an hour after a disconnect), specborn run keeps no score per peer id; the checkpoint-sync command also keeps a temporary, decaying score per peer id for invalid data-column sidecars, at most 1,024 of them (Checkpoint sync).