netinfo: display addr_{processed, rate_limited, relay_enabled} and relaytxes data#22501
Conversation
|
It looks like a5cc9e28f9e125a62168dcbe0b3484d098e56c1f should be part of 1893c907eac1e52294add6e059f192eb13702829 & ad5ea77d5dde3fb40dd4701ea0b92e445e060ef0 rather than a separate commit. How is it determined when to add new information and/or verbosity levels? Given they are additive, it seems unsustainable to just keep adding new levels and more info. |
a5cc9e2 to
a52c94c
Compare
Done!
Right, the data provided by getpeerinfo seems to be the upper bound, and apart from the bytes sent/received objects, there are only a handful of remaining fields. My current thinking is to orient levels 1-4 to node operators, and to use level 5 for data more suited to dev/testing. Open to feedback, of course. |
|
Combined the help into the first two commits as suggested by @fanquake and changed the help as follows: diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index 4c3cc22dfc..5a0371e3de 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -592,7 +592,7 @@ public:
" 2 - Like 1 but with an address column\n"
" 3 - Like 1 but with a version column\n"
" 4 - Like 1 but with both address and version columns\n"
- " 5 - Like 4 but with additional statistics in the peers listing (addrl, addrp)\n"
+ " 5 - Like 4 but with additional data for development and testing purposes\n" |
klementtan
left a comment
There was a problem hiding this comment.
Code Review and tested ACK a52c94c
jarolrod
left a comment
There was a problem hiding this comment.
ACK a52c94c
Tested on macOS 11.3. Tested functionality and also tested each commit one by one rebased on current master.
Notes on commits:
- 3934384
- Code review ACK
- At this point the new
addrlandaddrpare available at any numbered detail level, as it should be at this point since we have not introduced a new level
- 22fa911
- tested that this commit makes the new fields available only at level 5, previously they were available at any level
- Couple of concerns, both are non-blockers for me
- Help message for new level: https://github.com/bitcoin/bitcoin/pull/22501/files#r674477509
- Combining the first two commits: https://github.com/bitcoin/bitcoin/pull/22501/files#r674477522
- f92bce8
- code review ack
- a52c94c
- code review ack
|
tACK a52c94c macOS 11.4 One nit: The data repaints if it detects a window resize - but if the user uses <Command> + R to "reload" the window - the data doesn't automatically repaint. Not a huge issue. Note the macOS 11 Terminal has repurposed <Command> + R for "Allow mouse reporting" but apps like iTerm still use <Command> + R for "Reset" One request: If the terminal listened for up arrows and down arrows to change data info resolution - that would be awesome. |
|
I'm really not convinced these numbers are sufficiently important to turn into a new field, unless the expectation is that many more things will be added to it. |
a52c94c to
936d8ff
Compare
|
Thanks for the feedback everyone. Droppied the middle two commits; punting on adding a new level until or if there's a clearer need. Diff: |
|
Concept ACK Thanks for improving this feature: |
vasild
left a comment
There was a problem hiding this comment.
ACK 936d8ff49beeac5e0c77a87618e021b09d55c7a1
There was a problem hiding this comment.
tACK 936d8ff49beeac5e0c77a87618e021b09d55c7a1
Tested on macOS v11.4
Minor code review nit: agree with @vasild regarding printing 0 instead of an empty string for addr_rate_limited. Below is the output with his code change suggestion:
|
Thanks @Zero-1729! A propos displaying zeroes, see #22501 (comment). |
|
tACK 936d8ff49beeac5e0c77a87618e021b09d55c7a1 |
936d8ff to
1df9552
Compare
|
Thanks @klementtan, @vasild, @Zero-1729 and @jarolrod for the ACKs! I've pushed an update for these reasons:
|
There was a problem hiding this comment.
re-tACK 1df9552
Tested on macOS v11.4
936d8ff -> 1df9552, clean update (still works as expected) 🧉
Updated docs look good:
Note: left a minor nit regarding
txn.
$ src/bitcoin-cli -netinfo help
...
txn Time since last novel transaction received from the peer and accepted into our mempool, in minutes
"." - the peer requested we not relay transactions to it (relaytxes is false)
blk Time since last novel block passing initial validity checks received from the peer, in minutes
hb High-bandwidth BIP152 compact block relay
"." (to) - we selected the peer as a high-bandwidth peer
"*" (from) - the peer selected us as a high-bandwidth peer
addrp Total number of addresses processed, excluding those dropped due to rate limiting
"." - we do not relay addresses to this peer (addr_relay_enabled is false)
addrl Total number of addresses dropped due to rate limiting
...Personally love the new column arrangement; processed addresses (addrp) before rate-limit-dropped ones (addrl), followed by age before id:
i.e. peers where getpeerinfo#relaytxes is false
i.e. peers where getpeerinfo#addr_relay_enabled is false
1df9552 to
218862a
Compare
|
Updated per #22501 (comment) review feedback by @Zero-1729 (thanks!)
|
|
re crAck and tAck 218862a |
|
Thanks for all the reviews! I updated the PR description with a current screenshot. One peer seems to be spamming addresses a bit: |
|
This has many ACKs, seems ready for merge? |
|
Code review and tested ACK 218862a |
|
Concept ACK |
…relay_enabled} and relaytxes data 218862a Display peers in -netinfo that we don't relay addresses to (Jon Atack) 3834e23 Display peers in -netinfo that request we not relay transactions (Jon Atack) 0a9ee3a Simplify a few conditionals in -netinfo (Jon Atack) 5eeea8e Add addr_processed and addr_rate_limited stats to -netinfo (Jon Atack) Pull request description: Update CLI -netinfo to display the getpeerinfo `addr_processed`, `addr_rate_limited`, `addr_relay_enabled` and `relaytxes` data with auto-adjusting column widths. ``` $ ./src/bitcoin-cli -netinfo help txn Time since last novel transaction received from the peer and accepted into our mempool, in minutes "*" - the peer requested we not relay transactions to it (relaytxes is false) addrp Total number of addresses processed, excluding those dropped due to rate limiting "." - we do not relay addresses to this peer (addr_relay_enabled is false) addrl Total number of addresses dropped due to rate limiting ```  ACKs for top commit: 0xB10C: Code review and tested ACK 218862a Zero-1729: re-tACK 218862a vasild: ACK 218862a jarolrod: tACK 218862a Tree-SHA512: bb9da4bdd71859b234f6e4c2c46257a57ef0d0e0b363d2b8fded128bcaa28132f64a0a4651c622e1de1e3b7c05c7587a4369e9e79799895884fda9745c63409d









Update CLI -netinfo to display the getpeerinfo
addr_processed,addr_rate_limited,addr_relay_enabledandrelaytxesdata with auto-adjusting column widths.