Skip to content

Commit

Permalink
remove debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ssd04 committed Dec 18, 2024
1 parent 537eb34 commit 2f56ebd
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions consensus/spos/bls/v2/subroundEndRound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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(), "+"))
Expand All @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -870,12 +865,6 @@ func (sr *subroundEndRound) getNumOfSignaturesCollected() int {
continue
}

// log.Error("getNumOfSignaturesCollected.JobDone",
// "node", node,
// "isSignJobDone", isSignJobDone,
// "subround", sr.Name(),
// )

if isSignJobDone {
n++
}
Expand Down

0 comments on commit 2f56ebd

Please sign in to comment.