Skip to content

Commit

Permalink
review feedback #1
Browse files Browse the repository at this point in the history
  • Loading branch information
countvonzero committed Aug 17, 2022
1 parent d183eb2 commit 841f7f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions blocks/certifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type CertConfig struct {
func defaultCertConfig() CertConfig {
return CertConfig{
CommitteeSize: 10,
CertifyThreshold: 5,
CertifyThreshold: 6,
SignatureWaitDuration: 10,
NumLayersToKeep: 5,
}
Expand Down Expand Up @@ -177,7 +177,7 @@ func (c *Certifier) RegisterDeadline(lid types.LayerID, bid types.BlockID, now t
c.certMsgs[lid] = &certInfo{
bid: bid,
deadline: now.Add(time.Duration(c.cfg.SignatureWaitDuration) * time.Second),
signatures: make([]types.CertifyMessage, 0, c.cfg.CommitteeSize),
signatures: make([]types.CertifyMessage, 0, c.cfg.CertifyThreshold),
}
}
}
Expand Down Expand Up @@ -391,7 +391,7 @@ func (c *Certifier) tryGenCert() error {
}

func (c *Certifier) tryGenCertLocked(logger log.Log, lid types.LayerID, bid types.BlockID, sigs []types.CertifyMessage) (bool, error) {
if len(sigs) < c.cfg.CertifyThreshold+1 {
if len(sigs) < c.cfg.CertifyThreshold {
return false, nil
}
cert := &types.Certificate{
Expand Down
2 changes: 1 addition & 1 deletion blocks/certifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func Test_HandleCertifyMessage(t *testing.T) {
func Test_HandleCertifyMessage_Certified(t *testing.T) {
tc := newTestCertifier(t)
numMsgs := tc.cfg.CommitteeSize
cutoff := tc.cfg.CertifyThreshold + 1
cutoff := tc.cfg.CertifyThreshold
b := generateBlock(t, tc.db)
tc.RegisterDeadline(b.LayerIndex, b.ID(), time.Now())
for i := 0; i < numMsgs; i++ {
Expand Down
2 changes: 1 addition & 1 deletion cmd/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func (app *App) initServices(ctx context.Context,
blocks.WithCertContext(ctx),
blocks.WithCertConfig(blocks.CertConfig{
CommitteeSize: app.Config.HARE.N,
CertifyThreshold: app.Config.HARE.F,
CertifyThreshold: app.Config.HARE.F + 1,
SignatureWaitDuration: app.Config.HARE.WakeupDelta,
NumLayersToKeep: app.Config.Tortoise.Zdist,
}),
Expand Down

0 comments on commit 841f7f0

Please sign in to comment.