Skip to content

Commit 924cb1f

Browse files
chore: add details of fp pk to logs (backport #737) (#744)
HAL FIND-005 # Description ## Vigilante Some error logs in vigilante are missing the delegation identifier (staking_tx_hash), making it difficult for operators to correlate operational failures to specific delegations during troubleshooting. ## Impact: Debugging difficulty: Operators cannot identify which delegation caused the error Operational overhead: Must correlate logs with other events to troubleshoot issues Inconsistent logging: Some errors include context, others don't<hr>This is an automatic backport of pull request #737 done by [Mergify](https://mergify.com). Co-authored-by: RafilxTenfen <[email protected]>
1 parent 0c51277 commit 924cb1f

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4747
* [#734](https://github.com/babylonlabs-io/finality-provider/pull/734) chore: rm unused cfg val
4848
* [#735](https://github.com/babylonlabs-io/finality-provider/pull/735) chore: use counter prometeus
4949
* [#736](https://github.com/babylonlabs-io/finality-provider/pull/736) chore: disable flag on unsafe/test RPCs
50+
* [#737](https://github.com/babylonlabs-io/finality-provider/pull/737) chore: add fp identifier to logs
5051
* [#739](https://github.com/babylonlabs-io/finality-provider/pull/739) chore: bump babylon to `v4.0.0`
5152

5253
## v2.0.0-rc.5

finality-provider/service/fp_instance.go

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,10 @@ func (fp *FinalityProviderInstance) finalitySigSubmissionLoop(ctx context.Contex
236236
case <-ticker.C:
237237
fp.processAndSubmitSignatures(ctx)
238238
case <-fp.quit:
239-
fp.logger.Info("the finality signature submission loop is closing")
239+
fp.logger.Info(
240+
"the finality signature submission loop is closing",
241+
zap.String("pk", fp.GetBtcPkHex()),
242+
)
240243

241244
return
242245
}
@@ -248,7 +251,10 @@ func (fp *FinalityProviderInstance) finalitySigSubmissionLoop(ctx context.Contex
248251
func (fp *FinalityProviderInstance) processAndSubmitSignatures(ctx context.Context) {
249252
select {
250253
case <-fp.quit:
251-
fp.logger.Debug("processAndSubmitSignatures: the finality signature submission loop is closing")
254+
fp.logger.Debug(
255+
"processAndSubmitSignatures: the finality signature submission loop is closing",
256+
zap.String("pk", fp.GetBtcPkHex()),
257+
)
252258

253259
return
254260
default:
@@ -342,7 +348,10 @@ func (fp *FinalityProviderInstance) randomnessCommitmentLoop(ctx context.Context
342348
case <-ticker.C:
343349
fp.processRandomnessCommitment(ctx)
344350
case <-fp.quit:
345-
fp.logger.Info("the randomness commitment loop is closing")
351+
fp.logger.Info(
352+
"the randomness commitment loop is closing",
353+
zap.String("pk", fp.GetBtcPkHex()),
354+
)
346355

347356
return
348357
}
@@ -390,9 +399,17 @@ func (fp *FinalityProviderInstance) reportCriticalErr(err error) {
390399
fpBtcPk: fp.GetBtcPkBIP340(),
391400
}:
392401
case <-fp.quit:
393-
fp.logger.Debug("skipping error report due to context cancellation", zap.Error(err))
402+
fp.logger.Debug(
403+
"skipping error report due to context cancellation",
404+
zap.String("pk", fp.GetBtcPkHex()),
405+
zap.Error(err),
406+
)
394407
default:
395-
fp.logger.Error("failed to report critical error (channel full)", zap.Error(err))
408+
fp.logger.Error(
409+
"failed to report critical error (channel full)",
410+
zap.String("pk", fp.GetBtcPkHex()),
411+
zap.Error(err),
412+
)
396413
}
397414
}
398415

@@ -450,6 +467,7 @@ func (fp *FinalityProviderInstance) GetVotingPowerWithRetry(height uint64) (bool
450467
}, RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) {
451468
fp.logger.Debug(
452469
"failed to query the voting power",
470+
zap.String("pk", fp.GetBtcPkHex()),
453471
zap.Uint("attempt", n+1),
454472
zap.Uint("max_attempts", RtyAttNum),
455473
zap.Error(err),

0 commit comments

Comments
 (0)