Skip to content

Commit

Permalink
fix(sync): Allow generous buffer for heightThreshold calculation to a…
Browse files Browse the repository at this point in the history
…ccount for variability in block time (#103)
  • Loading branch information
renaynay authored Sep 5, 2023
1 parent 2fd3b1b commit d9e44d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sync/sync_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (s *Syncer[H]) verify(ctx context.Context, newHead H) (bool, error) {

var heightThreshold uint64
if s.Params.TrustingPeriod != 0 && s.Params.blockTime != 0 {
buffer := time.Hour * 6 / s.Params.blockTime // small buffer to account for network delays
buffer := time.Hour * 48 / s.Params.blockTime // generous buffer to account for variable block time
heightThreshold = uint64(s.Params.TrustingPeriod/s.Params.blockTime + buffer)
}

Expand Down

0 comments on commit d9e44d8

Please sign in to comment.