-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
We need a PerasVoteDB that stores all votes of the current Peras round, and builds certificates out of votes if possible, submitting them to the
A simple API would look like this:
data PerasVoteDB m blk = PerasVoteDB {
addVote :: PerasVote blk -> m () -- or a proper result/promise type
, getVoteSnapshot :: STM m (PerasVoteSnapshot blk)
}where PerasVoteSnapshot is defined analogously to PerasCertSnapshot.
Opening a PerasVoteDB should spawn two threads:
- One thread for garbage collection, removing all votes at the end of every round.
- One thread for validating votes1 and aggregating them into partial certificates, and finally submitting them to the PerasCertDB (or rather invoking a given callback).
It might make sense to approach this ticket in two steps:
- Implement just the vote storing + garbage collectiong functionality
- Implement the maintenance of the (partial) certificate for the current round.
Depends on #151
Footnotes
-
Maybe we already want to validate votes before (ie when they are received in the inbound mini-protocol thread), causing
addVoteto take aValidatedPerasVote. ↩
Metadata
Metadata
Assignees
Labels
No labels