Fantom-foundation / lachesis-rs

Lachesis BFT consensus for permission-less networks, in Rust
MIT License
35 stars 5 forks source link

Added Heartbeat Actor (#51) #52

Closed rishflab closed 5 years ago

rishflab commented 5 years ago

Implemented an actor that emits a heartbeat periodically. This periodic heartbeat functionality can be used to send sync requests to other nodes.

This commit demonstrates:

  1. how to run actix actors in conjunction with actix-web
  2. how to pass messages to an actor to mutate/query its state
Maxime2 commented 5 years ago

We need an exclusive heartbeat functionality which guarantees no new sync request initiated until previous one finishes, even heartbeat interval has passed since previous sync started. That would guarantee we will not overload a node with many concurrent syncs.

rishflab commented 5 years ago

@Maxime2 yes, the sync request dispatch needs to be in an actor, in a loop with a configurable delay after each dispatch.