Skip to content

Commit

Permalink
Chg: Changed the maximum automatic rewind length from 256 to 126
Browse files Browse the repository at this point in the history
  • Loading branch information
VAIBHAVJINDAL3012 authored and temaniarpit27 committed Jan 30, 2024
1 parent 241af1f commit 5c8625c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions eth/bor_checkpoint_verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ var (
rewindLengthMeter = metrics.NewRegisteredMeter("chain/autorewind/length", nil)
)

const maxRewindLen uint64 = 126

type borVerifier struct {
verify func(ctx context.Context, eth *Ethereum, handler *ethHandler, start uint64, end uint64, hash string, isCheckpoint bool) (string, error)
}
Expand Down Expand Up @@ -117,8 +119,8 @@ func borVerify(ctx context.Context, eth *Ethereum, handler *ethHandler, start ui
}
}

if head-rewindTo > 255 {
rewindTo = head - 255
if head-rewindTo > maxRewindLen {
rewindTo = head - maxRewindLen
}

if isCheckpoint {
Expand Down

0 comments on commit 5c8625c

Please sign in to comment.