From 0ea0726fdb4d65b4c60785574fda98132646ebeb Mon Sep 17 00:00:00 2001 From: Alice Date: Mon, 7 Sep 2026 20:24:18 +0700 Subject: [PATCH] fix: remove double-increment of local node in VLC receive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The receive() method was incrementing the local node's vector clock entry twice: once during merge() (which takes the max of both clocks) and again with an explicit increment(). This inflated the local node's clock value on every receive, breaking causal ordering guarantees. The standard HLC receive algorithm only merges clocks and updates logical_time — the local node's entry should not be incremented separately during receive. Fixes #22 --- crates/setu-vlc/src/lib.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/crates/setu-vlc/src/lib.rs b/crates/setu-vlc/src/lib.rs index 63e363f1..913256ca 100644 --- a/crates/setu-vlc/src/lib.rs +++ b/crates/setu-vlc/src/lib.rs @@ -265,9 +265,6 @@ impl VLCSnapshot { // Update logical time self.logical_time = self.logical_time.max(other.logical_time) + 1; - // Increment local node's vector clock - self.vector_clock.increment(local_node_id); - // Update physical time self.physical_time = Self::current_physical_time(); }