Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit c03f133

Browse files
author
fbockaj
committed
Increase min threshold to 2
1 parent 955a535 commit c03f133

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func (b Base) validate() error {
6565
if b.SetSize < 2 {
6666
errs += "\tset_size must be 2 or higher\n"
6767
}
68-
if b.Threshold < 1 {
69-
errs += "\tthreshold must be 1 or higher\n"
68+
if b.Threshold < 2 {
69+
errs += "\tthreshold must be 2 or higher\n"
7070
}
7171
if b.StartRank < 1 {
7272
errs += "\tstart_rank must be 1 or higher\n"

config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func testInvalidBase(t *testing.T, base Base) {
4141
base.SetSize = testConfig(t).Base.SetSize
4242

4343
// Invalid Base.Threshold.
44-
base.Threshold = 0
44+
base.Threshold = 1
4545
err = base.validate()
4646
assert.Error(t, err)
4747
base.Threshold = testConfig(t).Base.Threshold

config/templates/base.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set_size = 2
1818
# a rank update in the set.
1919
# This value must be the same across all validators
2020
# in the set.
21-
# Must be 1 or higher.
21+
# Must be 2 or higher.
2222
threshold = 10
2323

2424
# Rank of the validator on startup.

types/signctrled.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ func (bsc *BaseSignCtrled) Missed() error {
139139
// that the next block will not contain the validator's signature. This is due
140140
// to a block containing the commit of the previous height which we know wasn't
141141
// signed. Therefore, skip ahead.
142+
// This is also the reason why the minimum threshold for blocks missed in a row
143+
// is at 2.
142144
bsc.currentHeight++
143145
return ErrThresholdExceeded
144146
}

0 commit comments

Comments
 (0)