From 36a422ffed13ab80c99611046bc6beb44ab99813 Mon Sep 17 00:00:00 2001 From: Mark Holt Date: Fri, 23 Aug 2024 11:20:34 +0100 Subject: [PATCH 1/2] added overflow check --- eth/stagedsync/stage_bor_heimdall.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eth/stagedsync/stage_bor_heimdall.go b/eth/stagedsync/stage_bor_heimdall.go index 381511d02d3..11ba6d2423b 100644 --- a/eth/stagedsync/stage_bor_heimdall.go +++ b/eth/stagedsync/stage_bor_heimdall.go @@ -296,6 +296,11 @@ func BorHeimdallForward( return err } + // this will happen if for example chaindb is removed + if lastPersistedBlockNum > blockNum { + lastPersistedBlockNum = blockNum + } + // if the last time we persisted snapshots is too far away re-run the forward // initialization process - this is to avoid memory growth due to recusrion // in persistValidatorSets From 42ebd3f82aaf0e70242b5832c8ee0eba311ab8ee Mon Sep 17 00:00:00 2001 From: Mark Holt Date: Fri, 23 Aug 2024 11:37:20 +0100 Subject: [PATCH 2/2] demote verbose log --- eth/stagedsync/bor_heimdall_shared.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/stagedsync/bor_heimdall_shared.go b/eth/stagedsync/bor_heimdall_shared.go index 85c70abd7f7..2569e8228a1 100644 --- a/eth/stagedsync/bor_heimdall_shared.go +++ b/eth/stagedsync/bor_heimdall_shared.go @@ -525,7 +525,7 @@ func fetchAndWriteHeimdallStateSyncEvents( } if lastEventRecord != nil { - logger.Info("putting state sync events", "blockNum", blockNum, "lastID", lastEventRecord.ID) + logger.Debug("putting state sync events", "blockNum", blockNum, "lastID", lastEventRecord.ID) var blockNumBuf [8]byte binary.BigEndian.PutUint64(blockNumBuf[:], blockNum)