Skip to content

Commit

Permalink
scale blockTimeout in regards to round timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
goran-ethernal committed May 30, 2024
1 parent c3593f6 commit 3a2acc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consensus/polybft/polybft.go
Original file line number Diff line number Diff line change
Expand Up @@ -770,11 +770,13 @@ func (p *Polybft) GetValidatorsWithTx(blockNumber uint64, parents []*types.Heade
func (p *Polybft) SetBlockTime(blockTime time.Duration) {
// if block time is greater than default base round timeout,
// set base round timeout as twice the block time
syncerBlockTimeout := blockTime * 3
if blockTime >= core.DefaultBaseRoundTimeout {
p.ibft.SetBaseRoundTimeout(blockTime * baseRoundTimeoutScaleFactor)
syncerBlockTimeout *= baseRoundTimeoutScaleFactor
}

p.syncer.UpdateBlockTimeout(blockTime * 3)
p.syncer.UpdateBlockTimeout(syncerBlockTimeout)
}

// ProcessHeaders updates the snapshot based on the verified headers
Expand Down

0 comments on commit 3a2acc5

Please sign in to comment.