Skip to content

Commit 75627b5

Browse files
authored
fix(lib/grandpa): use defaultGrandpaInterval if not set, fixes error on startup (#1982)
1 parent 383a5bc commit 75627b5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/grandpa/errors.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ var (
101101
// ErrAuthorityNotInSet is returned when a precommit within a justification is signed by a key not in the authority set
102102
ErrAuthorityNotInSet = errors.New("authority is not in set")
103103

104-
// ErrZeroInterval is returned when the grandpa sub-round interval is set to 0
105-
ErrZeroInterval = errors.New("cannot have zero second interval")
106-
107104
errVoteExists = errors.New("already have vote")
108105
errVoteToSignatureMismatch = errors.New("votes and authority count mismatch")
109106
errInvalidVoteBlock = errors.New("block in vote is not descendant of previously finalised block")

lib/grandpa/grandpa.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ import (
3838

3939
const (
4040
finalityGrandpaRoundMetrics = "gossamer/finality/grandpa/round"
41+
defaultGrandpaInterval = time.Second
4142
)
4243

4344
var (
@@ -147,7 +148,7 @@ func NewService(cfg *Config) (*Service, error) {
147148
}
148149

149150
if cfg.Interval == 0 {
150-
return nil, ErrZeroInterval
151+
cfg.Interval = defaultGrandpaInterval
151152
}
152153

153154
ctx, cancel := context.WithCancel(context.Background())

0 commit comments

Comments
 (0)