From dbb6e4cd8c704ca0ad617dfdd8ec4d23ef0ba4e1 Mon Sep 17 00:00:00 2001 From: satyakwok <119509589+satyakwok@users.noreply.github.com> Date: Tue, 2 Jun 2026 11:42:22 +0200 Subject: [PATCH] fix(consensus): remove double record_block(0) at epoch boundary in run_epoch_bookkeeping Callers (main.rs BFT-finalize, libp2p gossip + batch-sync) already call epoch_manager.record_block(reward) before run_epoch_bookkeeping. The extra record_block(0) inside the method incremented total_blocks_produced twice for every boundary block, inflating epoch history by 1 block per rollover. Reported by CodeRabbit on PR #763. --- crates/sentrix-core/src/blockchain.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/sentrix-core/src/blockchain.rs b/crates/sentrix-core/src/blockchain.rs index 90f0a6fb..5f114504 100644 --- a/crates/sentrix-core/src/blockchain.rs +++ b/crates/sentrix-core/src/blockchain.rs @@ -558,7 +558,6 @@ impl Blockchain { .map(|v| v.total_stake()) .sum(); - self.epoch_manager.record_block(0); let finished = self.epoch_manager.current_epoch.clone(); self.epoch_manager.history.push(finished); if self.epoch_manager.history.len() > self.epoch_manager.max_history {