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.
This commit is contained in:
Toni Wahrstätter 2026-04-21 03:19:03 +02:00 committed by GitHub
parent acbf699c33
commit e447a2696d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -175,7 +175,9 @@ func WriteFinalizedBlockHash(db ethdb.KeyValueWriter, hash common.Hash) {
} }
// ReadLastPivotNumber retrieves the number of the last pivot block. If the node // 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 { func ReadLastPivotNumber(db ethdb.KeyValueReader) *uint64 {
data, _ := db.Get(lastPivotKey) data, _ := db.Get(lastPivotKey)
if len(data) == 0 { if len(data) == 0 {