Skip to content

Commit

Permalink
add comments for backOffTime
Browse files Browse the repository at this point in the history
  • Loading branch information
buddh0 committed Mar 4, 2025
1 parent a7ccdc9 commit fe13670
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -2138,6 +2138,7 @@ func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Ad
} else {
delay := defaultInitialBackOffTime
if p.chainConfig.IsLorentz(header.Number, header.Time) {
// If the in-turn validator has not signed recently, the expected backoff times are [2, 3, 4, ...].
delay = lorentzInitialBackOffTime
}
validators := snap.validators()
Expand Down Expand Up @@ -2205,6 +2206,7 @@ func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Ad
})

if delay == 0 && p.chainConfig.IsLorentz(header.Number, header.Time) && backOffSteps[idx] > 0 {
// If the in-turn validator has signed recently, the expected backoff times are [0, 2, 3, ...].
return lorentzInitialBackOffTime + (backOffSteps[idx]-1)*wiggleTime
}
delay += backOffSteps[idx] * wiggleTime
Expand Down

0 comments on commit fe13670

Please sign in to comment.