Skip to content

Commit 1072888

Browse files
fix(lib/babe): check if authority index is in the authorities range (#2601)
1 parent 7886318 commit 1072888

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/babe/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ func (b *verifier) verifyPreRuntimeDigest(digest *types.PreRuntimeDigest) (scale
390390
authIdx = d.AuthorityIndex
391391
}
392392

393-
if len(b.authorities) <= int(authIdx) {
393+
if uint64(len(b.authorities)) <= uint64(authIdx) {
394394
logger.Tracef("verifyPreRuntimeDigest invalid auth index %d, we have %d auths",
395395
authIdx, len(b.authorities))
396396
return nil, ErrInvalidBlockProducerIndex

0 commit comments

Comments
 (0)