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 <[email protected]>
  • Loading branch information
AnnaShaleva committed Nov 28, 2024
1 parent 82ad778 commit 0e51420
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Bugs fixed:
* PreHeader is constructed instead of PreBlock to create PreCommit message (#128)
* enable anti-MEV extension with respect to the current block index (#132)
* (*Context).PreBlock() method returns PreHeader instead of PreBlock (#133)
* WatchOnly node may send RecoveryMessage on RecoveryRequest (#135)

## [0.3.0] (01 August 2024)

Expand Down
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 0e51420

Please sign in to comment.