Drand over Gossipsub
Forest listens to the drand relays over gossipsub, verifies every round it receives and caches the ones a block can carry. Block production then reads its rounds from the cache instead of fetching them over HTTP, and block validation skips the signature check for a cached round. HTTP remains the fallback for a cache miss.
Five views, from the outside in: who Forest talks to, what runs inside it, how the network service is put together, when a verdict is decided, and what happens to one gossiped round.
The overall view
Only the drand relays publish rounds. Every other peer on the mesh, Lotus or Forest, forwards the rounds it verifies, so Forest passes rounds on to its peers as well as consuming them.
Zoom-in on Forest
Two parts of Forest take part. The network service talks to the mesh and reports every verdict. The beacon's DrandGossip service verifies and caches the rounds the service hands it, and sends the verdicts back; the beacon also talks to the HTTP API. Block validation reads the same cache.
Components of the libp2p service
The service touches DrandGossip at two points: a bounded channel in, fed by the gossip handler, and the service's own message channel out, carrying the verdict. Everything drand-specific lives in beacon::gossipsub.
When the verdict is decided
The gossipsub behaviour holds every message until a verdict is reported. A drand round is queued for DrandGossip, which runs the cheap checks and one BLS verification on its own task and sends the verdict back; a later select! iteration reports it. When the queue is full the round is ignored.
Verdicts
| Verdict | Forwarded | Sender penalised | Used for |
|---|---|---|---|
| Accept | yes | no | a round that verifies against the chain's public key and wasn't cached yet |
| Ignore | no | no | anything an honest peer may send that we can't use: stale, duplicate |
| Reject | no | yes | what no honest peer sends: undecodable payloads, bad or forged signatures |
Only unchained networks (quicknet) are gossiped. As in Lotus there is no time window: a round only has to be newer than the last one accepted, so a slow local clock never loses a round, and a forged one is rejected by its signature.