From 27f8435f7f9c211a1f2aee3e9ba1df71e1500edc Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Sun, 29 Jun 2025 22:23:36 -0400 Subject: [PATCH 1/2] Reduce logging to lvl 1 for peer connect/disconnect --- lib/peer.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/peer.go b/lib/peer.go index 81915653a..3e138a655 100644 --- a/lib/peer.go +++ b/lib/peer.go @@ -566,7 +566,7 @@ func (pp *Peer) cleanupMessageProcessor() { // We assume that no more elements will be added to the message queue once this function // is called. - glog.Infof("StartDeSoMessageProcessor: Cleaning up message queue for peer: %v", pp) + glog.V(1).Infof("StartDeSoMessageProcessor: Cleaning up message queue for peer: %v", pp) pp.messageQueue = nil // Set a few more things to nil just to make sure the garbage collector doesn't // get confused when freeing up this Peer's memory. This is to fix a bug where @@ -579,11 +579,11 @@ func (pp *Peer) cleanupMessageProcessor() { func (pp *Peer) StartDeSoMessageProcessor() { pp.startGroup.Done() - glog.Infof("StartDeSoMessageProcessor: Starting for peer %v", pp) + glog.V(1).Infof("StartDeSoMessageProcessor: Starting for peer %v", pp) for { if pp.disconnected != 0 { pp.cleanupMessageProcessor() - glog.Infof("StartDeSoMessageProcessor: Stopping because peer disconnected: %v", pp) + glog.V(1).Infof("StartDeSoMessageProcessor: Stopping because peer disconnected: %v", pp) return } msgToProcess := pp.MaybeDequeueDeSoMessage() @@ -1267,7 +1267,7 @@ out: } func (pp *Peer) Start() { - glog.Infof("Peer.Start: Starting peer %v", pp) + glog.V(1).Infof("Peer.Start: Starting peer %v", pp) // The protocol has been negotiated successfully so start processing input // and output messages. pp.startGroup.Add(4) @@ -1362,7 +1362,7 @@ func (pp *Peer) ReadDeSoMessage() (DeSoMessage, error) { // Disconnect closes a peer's network connection. func (pp *Peer) Disconnect(reason string) { // Only run the logic the first time Disconnect is called. - glog.V(0).Infof(CLog(Yellow, "Peer.Disconnect: Starting for Peer %v with reason: %v"), pp, reason) + glog.V(1).Infof(CLog(Yellow, "Peer.Disconnect: Starting for Peer %v with reason: %v"), pp, reason) if atomic.LoadInt32(&pp.disconnected) != 0 { glog.V(1).Infof("Peer.Disconnect: Disconnect call ignored since it was already called before for Peer %v", pp) return From 15cd57c81629332e60da108a430cb897f9ccbc18 Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Sun, 29 Jun 2025 22:44:23 -0400 Subject: [PATCH 2/2] lvl 1 instead of 2 for local vote and timeout events --- lib/pos_consensus.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pos_consensus.go b/lib/pos_consensus.go index 0f412bba2..0b9ff6ad7 100644 --- a/lib/pos_consensus.go +++ b/lib/pos_consensus.go @@ -352,7 +352,7 @@ func (fc *FastHotStuffConsensus) handleBlockProposalEvent( // 3. Process the vote in the consensus module // 4. Broadcast the vote msg to the network func (fc *FastHotStuffConsensus) HandleLocalVoteEvent(event *consensus.FastHotStuffEvent) error { - glog.V(2).Infof("FastHotStuffConsensus.HandleLocalVoteEvent: %s", event.ToString()) + glog.V(1).Infof("FastHotStuffConsensus.HandleLocalVoteEvent: %s", event.ToString()) glog.V(2).Infof("FastHotStuffConsensus.HandleLocalVoteEvent: %s", fc.fastHotStuffEventLoop.ToString()) // Hold a read lock on the consensus. This is because we need to check the @@ -444,7 +444,7 @@ func (fc *FastHotStuffConsensus) HandleValidatorVote(pp *Peer, msg *MsgDeSoValid // 3. Process the timeout in the consensus module // 4. Broadcast the timeout msg to the network func (fc *FastHotStuffConsensus) HandleLocalTimeoutEvent(event *consensus.FastHotStuffEvent) error { - glog.V(2).Infof("FastHotStuffConsensus.HandleLocalTimeoutEvent: %s", event.ToString()) + glog.V(1).Infof("FastHotStuffConsensus.HandleLocalTimeoutEvent: %s", event.ToString()) glog.V(2).Infof("FastHotStuffConsensus.HandleLocalTimeoutEvent: %s", fc.fastHotStuffEventLoop.ToString()) // Hold a read lock on the consensus. This is because we need to check the