Skip to content

Commit

Permalink
fix: uint64 type error when checking randomness commitment gap (eth…
Browse files Browse the repository at this point in the history
  • Loading branch information
gitferry authored Aug 30, 2023
1 parent 1199499 commit 85bc469
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion service/validator_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,8 @@ func (v *ValidatorInstance) CommitPubRand(tipBlock *BlockInfo) (*provider.Relaye
if lastCommittedHeight == uint64(0) {
// the validator has never submitted public rand before
startHeight = tipBlock.Height + 1
} else if lastCommittedHeight-tipBlock.Height < v.cfg.MinRandHeightGap {
// should not use subtraction because they are in the type of uint64
} else if lastCommittedHeight < v.cfg.MinRandHeightGap+tipBlock.Height {
// we are running out of the randomness
startHeight = lastCommittedHeight + 1
} else {
Expand Down

0 comments on commit 85bc469

Please sign in to comment.