Skip to content

Commit

Permalink
dbft: prohibit WatchOnly to send RecoveryMessage
Browse files Browse the repository at this point in the history
Fix a bug introduced by ffa8c1f.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
  • Loading branch information
AnnaShaleva committed Nov 28, 2024
1 parent 82ad778 commit 2faf31a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dbft.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ func (d *DBFT[H]) onCommit(msg ConsensusPayload[H]) {
}

func (d *DBFT[H]) onRecoveryRequest(msg ConsensusPayload[H]) {
// Only validators are allowed to send consensus messages.
if d.Context.WatchOnly() {
return
}

Check warning on line 616 in dbft.go

View check run for this annotation

Codecov / codecov/patch

dbft.go#L615-L616

Added lines #L615 - L616 were not covered by tests

if !d.CommitSent() && (!d.isAntiMEVExtensionEnabled() || !d.PreCommitSent()) {
// Ignore the message if our index is not in F+1 range of the
// next (%N) ones from the sender. This limits recovery
Expand Down

0 comments on commit 2faf31a

Please sign in to comment.