Skip to content

add debug log statements #316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/connection-manager/agreement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ class Agreement {
for (const chain of agreementChains) {
const ledger_hashes = chain.ledgers

log.info(`Debug: ${chain.id}:${Array.from(chain.validators).join(',')}`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are useful debug logs. I would like them in the code base.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved version of this log statement is merged in this PR

https://github.com/ripple/validator-history-service/pull/328/files


for (const signing_key of chain.validators) {
promises.push(
this.calculateValidatorAgreement(
Expand Down
13 changes: 13 additions & 0 deletions src/connection-manager/chains.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable max-lines-per-function -- Disable for this for debug purposes. */
/* eslint-disable max-statements -- Disable for this for debug purposes. */
import { Knex } from 'knex'

import { query } from '../shared/database'
Expand Down Expand Up @@ -216,6 +218,11 @@ class Chains {
.shift()

if (chainAtThisIndex !== undefined) {
log.info(
`DebugSkipped1:${`${next}:${ledger.ledger_index}`}:${Array.from(
validators,
).join(',')}`,
)
return
}

Expand All @@ -233,6 +240,12 @@ class Chains {
if (skipped > 1 && skipped < 20) {
chainWithThisValidator.incomplete = true
addLedgerToChain(ledger, chainWithThisValidator)
} else {
log.info(
`DebugSkipped2:${`${next}:${ledger.ledger_index}`}:${Array.from(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be easier to debug this data with chainWithThisValidator.id. The set of validators is probably identifying the public keys, which are not very informative (for human eyes).

validators,
).join(',')}`,
)
}
}

Expand Down