From 5c8625c999eea10643fc0218262217aa919ec177 Mon Sep 17 00:00:00 2001 From: Vaibhav Jindal Date: Thu, 18 Jan 2024 04:00:32 +0530 Subject: [PATCH] Chg: Changed the maximum automatic rewind length from 256 to 126 --- eth/bor_checkpoint_verifier.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eth/bor_checkpoint_verifier.go b/eth/bor_checkpoint_verifier.go index f8ac341e74..a0bdfeac8e 100644 --- a/eth/bor_checkpoint_verifier.go +++ b/eth/bor_checkpoint_verifier.go @@ -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 {