From 5ae250f5b3774bfc5d4370739631c25bcd062b55 Mon Sep 17 00:00:00 2001 From: Mark Holt <135143369+mh0lt@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:10:38 +0100 Subject: [PATCH] Fix bor event check start-up (#11909) Fixes: https://github.com/erigontech/erigon/issues/11905 --- turbo/snapshotsync/freezeblocks/bor_snapshots.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbo/snapshotsync/freezeblocks/bor_snapshots.go b/turbo/snapshotsync/freezeblocks/bor_snapshots.go index 2452be7e57a..d0ccc3a3fd2 100644 --- a/turbo/snapshotsync/freezeblocks/bor_snapshots.go +++ b/turbo/snapshotsync/freezeblocks/bor_snapshots.go @@ -305,7 +305,7 @@ func checkBlockEvents(ctx context.Context, config *borcfg.BorConfig, blockReader log.Error("[integrity] NoGapsInBorEvents: invalid event id", "block", block, "event", i, "expected", prevBlockStartId+uint64(i), "got", eventId) } } else { - eventId = prevBlockStartId + uint64(i) + eventId = heimdall.EventId(event) } eventTime := heimdall.EventTime(event) @@ -458,7 +458,7 @@ func checkBlockWindow(ctx context.Context, eventTime time.Time, firstBlockEventT return initialTime.After(from) } - return !(afterCheck(from, eventTime, firstBlockEventTime) || eventTime.After(to)) + return !afterCheck(from, eventTime, firstBlockEventTime) || !eventTime.After(to) } type BorView struct {