From cfec3bff4aed4ae4125478816c41c10717a7c06e Mon Sep 17 00:00:00 2001 From: pingqiu Date: Mon, 30 Mar 2026 20:44:04 -0700 Subject: [PATCH] fix: update contract.go field source docs to match P1 implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BlockVolState field mapping now matches actual StatusSnapshot(): - WALTailLSN ← super.WALCheckpointLSN (was: flusher.RetentionFloor) - CommittedLSN ← flusher.CheckpointLSN() V1 interim (was: distCommit) - CheckpointTrusted ← super.Validate()==nil (was: superblock.Valid) Co-Authored-By: Claude Opus 4.6 (1M context) --- sw-block/bridge/blockvol/contract.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sw-block/bridge/blockvol/contract.go b/sw-block/bridge/blockvol/contract.go index c7f5c3b22..ef41b6465 100644 --- a/sw-block/bridge/blockvol/contract.go +++ b/sw-block/bridge/blockvol/contract.go @@ -17,13 +17,13 @@ package blockvol // sw-block/bridge/blockvol/ does NOT import weed/ // BlockVolState represents the real storage state from a blockvol instance. -// Each field maps to a specific blockvol source: +// Each field maps to a specific blockvol source (current P1 implementation): // -// WALHeadLSN ← vol.nextLSN - 1 or vol.Status().WALHeadLSN -// WALTailLSN ← vol.flusher.RetentionFloor() -// CommittedLSN ← vol.distCommit.CommittedLSN() -// CheckpointLSN ← vol.flusher.CheckpointLSN() -// CheckpointTrusted ← vol.superblock.Valid + checkpoint file exists +// WALHeadLSN ← vol.nextLSN - 1 (last written LSN) +// WALTailLSN ← vol.super.WALCheckpointLSN (LSN boundary, not byte offset) +// CommittedLSN ← vol.flusher.CheckpointLSN() (V1 interim: committed = checkpointed) +// CheckpointLSN ← vol.super.WALCheckpointLSN (durable base image) +// CheckpointTrusted ← vol.super.Validate() == nil (superblock integrity) type BlockVolState struct { WALHeadLSN uint64 WALTailLSN uint64