From e447a2696de71d9d6c56664a9e7c87ac6077f178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toni=20Wahrst=C3=A4tter?= <51536394+nerolation@users.noreply.github.com> Date: Tue, 21 Apr 2026 03:19:03 +0200 Subject: [PATCH] core/rawdb: clarify ReadLastPivotNumber comment (#34773) clarify that `ReadLastPivotNumber` returns `nil` only when snap sync has never been attempted, since the marker is written during snap sync and never cleared. --- core/rawdb/accessors_chain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/rawdb/accessors_chain.go b/core/rawdb/accessors_chain.go index 0582e842c3..987b8df392 100644 --- a/core/rawdb/accessors_chain.go +++ b/core/rawdb/accessors_chain.go @@ -175,7 +175,9 @@ func WriteFinalizedBlockHash(db ethdb.KeyValueWriter, hash common.Hash) { } // ReadLastPivotNumber retrieves the number of the last pivot block. If the node -// full synced, the last pivot will always be nil. +// has never attempted snap sync, the last pivot will always be nil. The marker +// is written during snap sync and never cleared, so that a rollback past the +// pivot can re-enable snap sync. func ReadLastPivotNumber(db ethdb.KeyValueReader) *uint64 { data, _ := db.Get(lastPivotKey) if len(data) == 0 {