Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check: prohibit WatchOnly to send commits #139

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Behaviour changes:
Improvements:

Bugs fixed:
* inappropriate log on attempt to construct Commit for anti-MEV enabled WatchOnly
(#139)

## [0.3.1] (29 November 2024)

Expand Down
11 changes: 8 additions & 3 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,20 @@
d.preBlockProcessed = true
}

// Require PreCommit sent by self for reliability. This condition may be removed
// in the future.
// Require PreCommit sent by self for reliability. This condition must not be
// removed because:
// 1) we need to filter out WatchOnly nodes;
roman-khimov marked this conversation as resolved.
Show resolved Hide resolved
// 2) CNs that have not sent PreCommit must not skip this stage (although it's OK
// from the DKG/TPKE side to build final Block based only on other CN's data).
if d.PreCommitSent() {
d.verifyCommitPayloadsAgainstHeader()
d.sendCommit()
d.changeTimer(d.SecondsPerBlock)
d.checkCommit()
} else {
d.Logger.Debug("can't send commit since self preCommit not yet sent")
if !d.Context.WatchOnly() {
d.Logger.Debug("can't send commit since self preCommit not yet sent")
}

Check warning on line 95 in check.go

View check run for this annotation

Codecov / codecov/patch

check.go#L93-L95

Added lines #L93 - L95 were not covered by tests
}
}

Expand Down
Loading