Chg: Changed the maximum automatic rewind length from 256 to 126

This commit is contained in:
Vaibhav Jindal 2024-01-18 04:00:32 +05:30 committed by Arpit Temani
parent 241af1fa1e
commit 5c8625c999

View file

@ -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)
}
@ -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 {