consensus: update state from store before use in reactor (#8576)

Closes: #8575

This PR aims to fix the `LastCommitRound can only be negative for initial height 0` issue we see in the e2e tests by initializing the `state` object before starting the receive routines in the consensus reactor. This is somewhat inelegant, but it should fix the issue.
This commit is contained in:
William Banfield
2022-05-19 19:35:30 +00:00
committed by GitHub
parent 4a9bbe047f
commit ad73e6da2f
2 changed files with 13 additions and 7 deletions
+2
View File
@@ -216,6 +216,8 @@ func (r *Reactor) OnStart(ctx context.Context) error {
if err := r.state.Start(ctx); err != nil {
return err
}
} else if err := r.state.updateStateFromStore(); err != nil {
return err
}
go r.updateRoundStateRoutine(ctx)