Skip to content

Commit

Permalink
Update bookkeepers currentRound after calling into consensus
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Nov 17, 2023
1 parent f0bd9f9 commit 7fc4287
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Specs/Quint/executor.qnt
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,18 @@ pure def ListContains(list, value) =

// check whether the event has been already sent to consensus. If not, do so.
pure def callConsensus (es: ExecutorState, bk: Bookkeeper, ev: Event) : (ExecutorState, ConsensusOutput) = {
// check whether we already executed the event already
// Check whether we already executed the event already
if (es.executedEvents.ListContains((ev, es.cs.height, es.cs.round)))
( { ...es, bk:bk, cs: es.cs},
defaultResult )
({ ...es, bk: bk, cs: es.cs }, defaultResult)
else
// Go to consensus
val res = consensus(es.cs, ev)
( { ...es, bk: bk, cs: res.cs, executedEvents: es.executedEvents.append((ev, res.cs.height, res.cs.round))},
res.out )
// Update the round in the vote keeper, in case we moved to a new round
val newBk = { ...bk, currentRound: res.cs.round }
// Record that we executed the event
val events = es.executedEvents.append((ev, res.cs.height, res.cs.round))

({ ...es, bk: newBk, cs: res.cs, executedEvents: events }, res.out)
}


Expand Down

0 comments on commit 7fc4287

Please sign in to comment.