forest icon indicating copy to clipboard operation
forest copied to clipboard

Allow drand beacons to support multiple endpoints

Open austinabell opened this issue 4 years ago • 3 comments

Task summary

Currently we are only referencing one endpoint in https://github.com/ChainSafe/forest/blob/3eed3ac2a774853ae2fae5371696627fc4e3a81b/blockchain/beacon/src/drand.rs#L35

But there are multiple nodes available (Lotus has all the endpoints listed here https://github.com/filecoin-project/lotus/blob/master/build/drand.go)

It would be best if DrandBeacons can be initialized with multiple server endpoints, so that there isn't a reliance on one specific one. Implementation of how requests are done is a bit opinionated, but I would think there wouldn't be much overhead with sending requests to all endpoints and just awaiting as a race between them for the response. This way lag or an outage doesn't slow down the request.

Other motivation is that there is a single endpoint we use, which if it goes down, our node will stop validating.

Specification reference

Other information and links

austinabell avatar Feb 04 '21 21:02 austinabell

Another option for this is to use Drand over libp2p and have the HTTP endpoints as a fallback

ec2 avatar Feb 04 '21 22:02 ec2

Another option for this is to use Drand over libp2p and have the HTTP endpoints as a fallback

Do other implementations support this now? I thought that was just an idea. Either way good point to add to this discussion, it's worth looking into

austinabell avatar Feb 04 '21 22:02 austinabell

Yup, I'm pretty sure they have it in the Lotus code. You get new Drand blocks over gossipsub over the /drand/pubsub/v0.0.0/<DRAND HASH> topic.

ec2 avatar Feb 04 '21 22:02 ec2

Forest supports multiple drand endpoints now.

https://github.com/ChainSafe/forest/blob/fed8ec22426efa66f3468748126187261a4c4b9a/src/beacon/drand.rs#L50-L58

LesnyRumcajs avatar Apr 11 '24 08:04 LesnyRumcajs