-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Print peer counts for all reachable networks in -netinfo #23324
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
Print peer counts for all reachable networks in -netinfo #23324
Conversation
instead of only for networks we have peer connections to. Users reported the previous behavior caused confusion, as no column was printed when a network was reachable but no peers were connected. Users expected a column to be printed with 0 peers. This commit aligns behavior with that expectation.
Concept ACK |
Concept ACK Thanks for this! I think this behaviour makes it much clearer and more consistent for all networks. |
Concept ACK Nice work! Could include before/after examples in the OP to make it even nicer? :) |
Added! |
Tested ACK 96f469f
Thank you @jonatack ! |
utACK 96f469f I had similar confusion when reviewing an i2p PR: #22250 (comment) |
Code review and lightly tested ACK 96f469f |
Concept ACK. |
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.
ACK 96f469f, tested by comparing the output of watch src/bitcoin-cli -netinfo
with the Peer tab of the Node window in the GUI 🐅
Also verified with -noonion
command-line option:
$ src/bitcoin-cli -netinfo
Bitcoin Core client v22.99.0-96f469f91bc0 - server 70016/Satoshi:22.99.0/
ipv4 ipv6 total block
in 0 0 0
out 6 0 6 2
total 6 0 6
Local addresses: n/a
UPDATE: with -onlynet=ipv4
command-line option:
$ src/bitcoin-cli -netinfo
Bitcoin Core client v22.99.0-96f469f91bc0 - server 70016/Satoshi:22.99.0/
ipv4 onion total block manual
in 0 0 0
out 2 1 3 2 1
total 2 1 3
Local addresses
d6jwdcoo2l3gbjps6asgg4nhp2gn5oao3wj333o43ssqnjaliehytfad.onion port 8333 score 4
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
ACK 96f469f. |
…-netinfo 96f469f netinfo: print peer counts for all reachable networks (Jon Atack) Pull request description: instead of only for networks we have peer connections to. Users reported the previous behavior caused confusion, as no column was printed when a network was reachable but no peers were connected. Users expected a column to be printed with 0 peers. This commit aligns behavior with that expectation. In addition, the ipv4, ipv6, and onion columns were always printed whether or not they were reachable. With this change, only the reachable ones will be returned. Example with CJDNS reachable but no CJDNS peers (built on bitcoin#23077 and bitcoin#23175): before ``` ipv4 ipv6 onion i2p total block manual in 0 0 12 5 17 out 8 1 6 4 19 2 8 total 8 1 18 9 36 ``` after ``` ipv4 ipv6 onion i2p cjdns total block manual in 0 0 12 5 0 17 out 8 1 6 4 0 19 2 8 total 8 1 18 9 0 36 ``` There is one additional space between the in/out/total row headers and the network counts. ACKs for top commit: jsarenik: Tested ACK 96f469f prayank23: utACK bitcoin@96f469f laanwj: Code review and lightly tested ACK 96f469f naumenkogs: ACK 96f469f. hebasto: ACK 96f469f, tested by comparing the output of `watch src/bitcoin-cli -netinfo` with the Peer tab of the Node window in the GUI 🐅 Tree-SHA512: 3489f40148a2bd0afc9eef1e1577d44150c1fccec8dbf2a675bc23aa9343bfcae6c4039f5b96e54730668c83f40bc932fb6808f5540e86ff7249fde8dc0fff67
7b65287 cli: hoist networks class data members to a constant (Jon Atack) 5bd40a3 cli: add cjdns network to -addrinfo and -netinfo (Jon Atack) Pull request description: Follow-up to #23077 and #23324. ``` $ ./src/bitcoin-cli -addrinfo { "addresses_known": { "ipv4": 47782, "ipv6": 10307, "onion": 8030, "i2p": 41, "cjdns": 1, "total": 66161 } } $ ./src/bitcoin-cli -netinfo Bitcoin Core client v22.99.0-deb6223d4c55 - server 70016/Satoshi:22.99.0(jon)/ ipv4 ipv6 onion i2p cjdns total block manual in 0 5 12 5 1 23 out 2 2 9 5 2 20 2 10 total 2 7 21 10 3 43 ``` ``` $ ./src/bitcoin-cli -netinfo 1 ```  ACKs for top commit: laanwj: Code review ACK 7b65287 Tree-SHA512: 9c740d394d9842d38a1c01a824271b25277baac11ed090f0430daa15b580c2bf3d114ac6b8254b19d6aaee57cbe1ca6a414996e6994e0bf4a577bed771382eca
7b65287 cli: hoist networks class data members to a constant (Jon Atack) 5bd40a3 cli: add cjdns network to -addrinfo and -netinfo (Jon Atack) Pull request description: Follow-up to bitcoin#23077 and bitcoin#23324. ``` $ ./src/bitcoin-cli -addrinfo { "addresses_known": { "ipv4": 47782, "ipv6": 10307, "onion": 8030, "i2p": 41, "cjdns": 1, "total": 66161 } } $ ./src/bitcoin-cli -netinfo Bitcoin Core client v22.99.0-deb6223d4c55 - server 70016/Satoshi:22.99.0(jon)/ ipv4 ipv6 onion i2p cjdns total block manual in 0 5 12 5 1 23 out 2 2 9 5 2 20 2 10 total 2 7 21 10 3 43 ``` ``` $ ./src/bitcoin-cli -netinfo 1 ```  ACKs for top commit: laanwj: Code review ACK 7b65287 Tree-SHA512: 9c740d394d9842d38a1c01a824271b25277baac11ed090f0430daa15b580c2bf3d114ac6b8254b19d6aaee57cbe1ca6a414996e6994e0bf4a577bed771382eca
… and devs a4da16f Improve -netinfo help based on feedback from users and devs (Jon Atack) Pull request description: Clarify which networks are displayed by the peer counts table (*reachable* networks; follow-up to #23324) in response to questions received over the past months, and a few other improvements. ACKs for top commit: laanwj: Code review ACK a4da16f w0xlt: ACK a4da16f kristapsk: utACK a4da16f Tree-SHA512: e6522c08421aa7f10d50723156d0a8fc5ec82cad2f0bd931bbec603077fcd4921c6505ef743d57386fba81c95dcfc77df75abf3378319886368e4ae33f9a6d73
instead of only for networks we have peer connections to.
Users reported the previous behavior caused confusion, as no column was printed when a network was reachable but no peers were connected. Users expected a column to be printed with 0 peers. This commit aligns behavior with that expectation.
In addition, the ipv4, ipv6, and onion columns were always printed whether or not they were reachable. With this change, only the reachable ones will be returned.
Example with CJDNS reachable but no CJDNS peers (built on #23077 and #23175):
before
after
There is one additional space between the in/out/total row headers and the network counts.