From 2f56ebd13e788a8432103bc596924775d10b3190 Mon Sep 17 00:00:00 2001 From: ssd04 Date: Wed, 18 Dec 2024 15:39:29 +0200 Subject: [PATCH] remove debug logs --- consensus/spos/bls/v2/subroundEndRound.go | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/consensus/spos/bls/v2/subroundEndRound.go b/consensus/spos/bls/v2/subroundEndRound.go index 30194e3970..117b861bed 100644 --- a/consensus/spos/bls/v2/subroundEndRound.go +++ b/consensus/spos/bls/v2/subroundEndRound.go @@ -101,8 +101,6 @@ func (sr *subroundEndRound) receivedProof(proof consensus.ProofHandler) { sr.mutProcessingEndRound.Lock() defer sr.mutProcessingEndRound.Unlock() - log.Error("receivedProof: PROOF", "proofHeader", proof.GetHeaderHash()) - if sr.IsJobDone(sr.SelfPubKey(), sr.Current()) { return } @@ -276,7 +274,6 @@ func (sr *subroundEndRound) doEndRoundJobByNode() bool { sr.worker.DisplayStatistics() log.Debug("step 3: Body and Header have been committed") - log.Trace("step 3: Body and Header have been committed", "headerHash", sr.GetData()) msg := fmt.Sprintf("Added proposed block with nonce %d in blockchain", sr.GetHeader().GetNonce()) log.Debug(display.Headline(msg, sr.SyncTimer().FormattedCurrentTime(), "+")) @@ -288,7 +285,6 @@ func (sr *subroundEndRound) doEndRoundJobByNode() bool { func (sr *subroundEndRound) sendProof() (data.HeaderProofHandler, bool) { if !sr.shouldSendProof() { - log.Trace("sendProof: should not send proof") return nil, true } @@ -322,7 +318,8 @@ func (sr *subroundEndRound) sendProof() (data.HeaderProofHandler, bool) { } // broadcast header proof - return sr.createAndBroadcastProof(sig, bitmap) + proof, err := sr.createAndBroadcastProof(sig, bitmap) + return proof, err == nil } func (sr *subroundEndRound) shouldSendProof() bool { @@ -530,7 +527,7 @@ func (sr *subroundEndRound) computeAggSigOnValidNodes() ([]byte, []byte, error) return bitmap, sig, nil } -func (sr *subroundEndRound) createAndBroadcastProof(signature []byte, bitmap []byte) (*block.HeaderProof, bool) { +func (sr *subroundEndRound) createAndBroadcastProof(signature []byte, bitmap []byte) (*block.HeaderProof, error) { headerProof := &block.HeaderProof{ PubKeysBitmap: bitmap, AggregatedSignature: signature, @@ -543,14 +540,14 @@ func (sr *subroundEndRound) createAndBroadcastProof(signature []byte, bitmap []b err := sr.BroadcastMessenger().BroadcastEquivalentProof(headerProof, []byte(sr.SelfPubKey())) if err != nil { log.Error("failed to broadcast equivalent proof", "error", err) - return nil, false + return nil, err } log.Debug("step 3: block header proof has been sent", "PubKeysBitmap", bitmap, "AggregateSignature", signature) - return headerProof, true + return headerProof, nil } func (sr *subroundEndRound) createAndBroadcastInvalidSigners(invalidSigners []byte) { @@ -722,7 +719,7 @@ func (sr *subroundEndRound) waitForSignalSync() bool { case <-timerBetweenStatusChecks.C: if sr.IsSubroundFinished(sr.Current()) { log.Trace("subround already finished", "subround", sr.Name()) - return true + return false } if sr.checkReceivedSignatures() { @@ -840,8 +837,6 @@ func (sr *subroundEndRound) checkReceivedSignatures() bool { isSelfJobDone := sr.IsSelfJobDone(bls.SrSignature) - // log.Error("checkReceivedSignatures", "isSelfJobDone", isSelfJobDone, "numSigs", numSigs, "consensusSize", sr.ConsensusGroupSize()) - shouldStopWaitingSignatures := isSelfJobDone && isSignatureCollectionDone if shouldStopWaitingSignatures { log.Debug("step 2: signatures collection done", @@ -870,12 +865,6 @@ func (sr *subroundEndRound) getNumOfSignaturesCollected() int { continue } - // log.Error("getNumOfSignaturesCollected.JobDone", - // "node", node, - // "isSignJobDone", isSignJobDone, - // "subround", sr.Name(), - // ) - if isSignJobDone { n++ }