Networking
libp2p discovery, gossip, and liveness probes between paraloom validators.
Networking
Paraloom validators communicate over libp2p: peer discovery via Kademlia DHT, message propagation via gossipsub, and liveness probing via libp2p's ping protocol. Bootstrap multiaddrs are read from the on-chain validator registry, so the network has a verifiable seed.
Discovery
When a validator starts, it registers itself in Kademlia using its on-chain pubkey and multiaddr, then bootstraps its routing table from the registered seed peers:
| Protocol | Kademlia DHT |
| Seed source | on-chain ValidatorRegistry PDA |
| Routing-table refresh | periodic, every ~30s |
| Implementation | src/network/discovery.rs |
A Node lifecycle task (see src/node/) drives the bootstrap-refresh loop on start and aborts it on stop.
Liveness
Each validator pings its connected peers using libp2p's built-in ping behaviour. The PeerRegistry state machine consumes swarm events and distinguishes:
- Connected & responsive — recent ping reply
- Slow — high RTT, still responsive
- Offline — missed N consecutive pings (window-configurable)
The slow / offline distinction feeds reputation tracking — a slow peer is not slashed, but a persistently-offline one accrues unavailability evidence.
Gossip
Block proposals, vote messages, and compute job results propagate through gossipsub:
| Protocol | gossipsub (libp2p) |
| Codec | bincode, bounded reads (size-capped to prevent DoS) |
| Topics | per-network (devnet, mainnet) |
| Implementation | src/network/protocol.rs, src/network/req_resp.rs |
Tightening the codec read budget (issue #69) closed a class of DoS vectors where a malicious peer could send unbounded gossip and exhaust validator memory.
Behaviours composed in ParaloomBehaviour
The libp2p network behaviour aggregates:
Kademlia— peer discoveryPing— liveness probesGossipsub— block / vote / result propagationRequestResponse— direct queries (state sync, withdrawal proof requests)
See src/network/mod.rs for the full behaviour composition.
Devnet bootstrap
To join devnet, register on-chain (see Validator guide) and start your node — discovery happens automatically:
$ paraloom validator start --network devnet --config ./validator.toml
loading network=devnet from on-chain registry
✓ kademlia bootstrap: 4 seed peers
✓ gossipsub subscribed: paraloom/devnet/blocks
✓ ping behaviour active
ready: listening on /ip4/0.0.0.0/tcp/9001Smoke tests
End-to-end discovery is exercised in tests/network_tests.rs. The full peer-registry / kademlia / ping wiring was completed as part of issue #65.