-
Notifications
You must be signed in to change notification settings - Fork 37.7k
p2p: log addrman consistency checks #22696
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
p2p: log addrman consistency checks #22696
Conversation
I used this logging while reviewing and testing #20233 and while running the checks over the past months. |
Code review ACK d3ae9ed. This mirrors the logging done in mempool when the consistency checks are run: Line 691 in 803ef70
Two potential enhancements for your consideration:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crACK d3ae9ed
Updated per @jnewbery's feedback (good ideas, thanks!)
|
d3ae9ed
to
4844b74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 4844b74
Nice update, LGTM 🧉
$ src/bitcoind -signet -checkaddrman=20 -debug=addrman
...
2021-08-13T11:22:11Z Addrman checks started: new 431, tried 16, total 447
2021-08-13T11:22:11Z Addrman checks completed successfully
...
Should the number of tried be logged before the number of new, to reflect the order of the checks and the LogPrint(BCLog::ADDRMAN, "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort(), source.ToString(), nTried, nNew); |
Code review ACK 4844b74
I don't think it matters. |
No strong opinions here, but in this case, I think reflecting the order of checks makes sense since we are logging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept and code-review ACK 4844b74 ♟️
Quickly tested on signet, as inspired by jonatack and Zero-1729:
$ ./src/bitcoind -signet -checkaddrman=10 -debug=addrman | grep "Addrman checks"
2021-08-13T13:14:23Z Addrman checks started: new 292, tried 18, total 310
2021-08-13T13:14:23Z Addrman checks completed successfully
2021-08-13T13:14:24Z Addrman checks started: new 292, tried 18, total 310
2021-08-13T13:14:24Z Addrman checks completed successfully
2021-08-13T13:14:24Z Addrman checks started: new 292, tried 18, total 310
2021-08-13T13:14:24Z Addrman checks completed successfully
2021-08-13T13:14:29Z Addrman checks started: new 292, tried 18, total 310
2021-08-13T13:14:29Z Addrman checks completed successfully
2021-08-13T13:14:34Z Addrman checks started: new 292, tried 18, total 310
2021-08-13T13:14:34Z Addrman checks completed successfully
...
4844b74 p2p: log addrman consistency checks (Jon Atack) Pull request description: This mini-patch picks up bitcoin#22479 to log addrman consistency checks in the `BCLOG::ADDRMAN` category when they are enabled with the `-checkaddrman=<n>` configuration option for values of n greater than 0. ``` $ ./src/bitcoind -signet -checkaddrman=20 -debug=addrman ... 2021-08-13T11:14:45Z Addrman checks started: new 3352, tried 89, total 3441 2021-08-13T11:14:45Z Addrman checks completed successfully ``` This allows people to - verify the checks are running - see when and how often they are being performed - see the number of new/tried/total addrman entries per check - see the start/end of the checks Thanks to John Newbery for ideas to improve this logging. ACKs for top commit: jnewbery: Code review ACK 4844b74 Zero-1729: tACK 4844b74 theStack: Concept and code-review ACK 4844b74 ♟️ Tree-SHA512: 10b51c480d52a753ea8a59dbdd1e2c4f49067e7f4afe59d58426a8fb438f52447fe3a6090fa52132bc382d876927fa338b229c906d85668086f7f8f5bd8ed38a
This mini-patch picks up #22479 to log addrman consistency checks in the
BCLOG::ADDRMAN
category when they are enabled with the-checkaddrman=<n>
configuration option for values of n greater than 0.This allows people to
Thanks to John Newbery for ideas to improve this logging.