Skip to content

Commit

Permalink
Merge pull request #665 from ava-labs/reduce-log-noise
Browse files Browse the repository at this point in the history
Reduce noisy logs
  • Loading branch information
cam-schultz authored Feb 6, 2025
2 parents b037265 + c350461 commit f136e3b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 4 additions & 2 deletions peers/app_request_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ func (n *appRequestNetwork) startUpdateValidators() {
// Fetch validators immediately when called, and refresh every ValidatorRefreshPeriod
ticker := time.NewTicker(ValidatorRefreshPeriod)
for ; true; <-ticker.C {
n.logger.Debug(
"Fetching validators for subnets",
zap.Any("subnetIDs", append([]ids.ID{constants.PrimaryNetworkID}, n.trackedSubnets.List()...)),
)
n.updateValidatorSet(context.Background(), constants.PrimaryNetworkID)
for _, subnet := range n.trackedSubnets.List() {
n.updateValidatorSet(context.Background(), subnet)
Expand All @@ -274,8 +278,6 @@ func (n *appRequestNetwork) updateValidatorSet(
n.lock.Lock()
defer n.lock.Unlock()

n.logger.Debug("Fetching validators for subnet ID", zap.Stringer("subnetID", subnetID))

// Fetch the subnet validators from the P-Chain
validators, err := n.validatorClient.GetProposedValidators(ctx, subnetID)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions relayer/application_relayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (r *ApplicationRelayer) ProcessHeight(
handlers []messages.MessageHandler,
errChan chan error,
) {
r.logger.Debug(
r.logger.Verbo(
"Processing block",
zap.Uint64("height", height),
zap.Stringer("relayerID", r.relayerID.ID),
Expand All @@ -167,7 +167,7 @@ func (r *ApplicationRelayer) ProcessHeight(
return
}
r.checkpointManager.StageCommittedHeight(height)
r.logger.Debug(
r.logger.Verbo(
"Processed block",
zap.Uint64("height", height),
zap.String("sourceBlockchainID", r.relayerID.SourceBlockchainID.String()),
Expand Down
8 changes: 4 additions & 4 deletions relayer/checkpoint/checkpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (cm *CheckpointManager) writeToDatabase() {
if storedHeight >= cm.committedHeight {
return
}
cm.logger.Debug(
cm.logger.Verbo(
"Writing height",
zap.Uint64("height", cm.committedHeight),
zap.String("relayerID", cm.relayerID.ID.String()),
Expand Down Expand Up @@ -123,16 +123,16 @@ func (cm *CheckpointManager) StageCommittedHeight(height uint64) {
// First push the height onto the pending commits min heap
// This will ensure that the heights are committed in order
heap.Push(cm.pendingCommits, height)
cm.logger.Debug(
cm.logger.Verbo(
"Pending committed heights",
zap.Any("pendingCommits", cm.pendingCommits),
zap.Any("maxPendingHeight", height),
zap.Uint64("maxCommittedHeight", cm.committedHeight),
zap.String("relayerID", cm.relayerID.ID.String()),
)

for cm.pendingCommits.Peek() == cm.committedHeight+1 {
h := heap.Pop(cm.pendingCommits).(uint64)
cm.logger.Debug(
cm.logger.Verbo(
"Committing height",
zap.Uint64("height", height),
zap.String("relayerID", cm.relayerID.ID.String()),
Expand Down
2 changes: 1 addition & 1 deletion relayer/message_coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (mc *MessageCoordinator) ProcessBlock(
// Dispatch all messages in the block to the appropriate application relayer.
// An empty slice is still a valid argument to ProcessHeight; in this case the height is immediately committed.
handlers := messageHandlers[appRelayer.relayerID.ID]
mc.logger.Debug(
mc.logger.Verbo(
"Dispatching to app relayer",
zap.Stringer("relayerID", appRelayer.relayerID.ID),
zap.Int("numMessages", len(handlers)),
Expand Down

0 comments on commit f136e3b

Please # to comment.