From e0488b1eff6e8185d8e054488dc37e30aac1094a Mon Sep 17 00:00:00 2001 From: Uladzislau Muraveika Date: Thu, 6 Aug 2026 10:40:16 +0300 Subject: [PATCH] fix(consensus): count hooray only after successful final commit Remove the premature UpdateLeaderMetrics call from onPrepare. The metric is already updated in _finalCommit after the leader successfully commits the block and logs "HOORAY!!!!!!! CONSENSUS REACHED!!!!!!!". This prevents hooray and num_commits from being inflated for every received PREPARE message. --- consensus/leader.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/consensus/leader.go b/consensus/leader.go index 9e901e70c6..db69ef66e3 100644 --- a/consensus/leader.go +++ b/consensus/leader.go @@ -151,8 +151,6 @@ func (consensus *Consensus) onPrepare(recvMsg *FBFTMessage) { } //// Read - End - consensus.UpdateLeaderMetrics(float64(signerCount), float64(consensus.getBlockNum())) - // Check BLS signature for the multi-sig prepareSig := recvMsg.Payload var sign bls_core.Sign