net, rpc, cli: expose peer network in getpeerinfo; simplify/improve -netinfo#20002
net, rpc, cli: expose peer network in getpeerinfo; simplify/improve -netinfo#20002laanwj merged 5 commits intobitcoin:masterfrom
Conversation
|
Concept ACK Thanks for improving |
24e9121 to
b037113
Compare
b037113 to
2aa2a8f
Compare
|
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. |
2aa2a8f to
a3c7f1d
Compare
44c4c54 to
9631174
Compare
|
Concept ACK. |
2c9e6bb to
5604a61
Compare
hebasto
left a comment
There was a problem hiding this comment.
Tested 5604a61435c5dfdeed41db5eca489b353dee0b99 on Linux Mint 20 (x86_64):
$ src/bitcoin-cli -netinfo 4
Bitcoin Core v0.20.99.0-5604a6143 - 70016/Satoshi:0.20.99/
Peer connections sorted by direction and min ping
<-> relay net mping ping send recv txn blk uptime id address version
in full onion 178 1081 11 76 229 171 127.0.0.1:37328 70015/bitnodes.io:0.1/
in block onion 241 558 29 29 265 157 127.0.0.1:34910 70015/Satoshi:0.20.1/
in block onion 245 399 110 110 289 144 127.0.0.1:33322 70015/Satoshi:0.20.1/
in full onion 359 430 10 1 1 37 44 268 127.0.0.1:49482 70015/Satoshi:0.19.1/
out full onion 251 450 1 3 0 468 78 jqsx6ag4hujpapxq.onion:8333 70015/Satoshi:0.20.0/
out full onion 261 352 1 1 0 12 625 6 tuwj7ju4s25345pg.onion:8333 70015/Satoshi:0.19.0.1/
out block onion 280 528 58 58 624 625 9 kzrnyo7fadxihvgb.onion:8333 70015/Satoshi:0.20.0/
out full onion 329 474 2 5 0 623 625 7 2mmxouhv6nebowkq.onion:8333 70015/Satoshi:0.18.1/
out full onion 372 622 3 3 1 623 625 4 q467hmvzy5kfvoed.onion:8333 70015/Satoshi:0.20.1/
out full onion 380 546 2 11 0 624 625 8 ee5skvb3ktbposl3.onion:8333 70015/Satoshi:0.20.0/
out full onion 392 623 0 6 0 624 626 2 6xiqqr4fxnstd5fo.onion:8333 70015/Satoshi:0.20.1/
out full onion 421 556 2 7 0 267 625 5 ohrieqovuxe6y4gl.onion:8333 70015/Satoshi:0.20.0/
out block onion 465 578 112 111 246 162 a53vtdm7uiet5vdl.onion:8333 70015/Satoshi:0.19.1/
out full onion 1717 1717 5 0 0 1 290 mbciulcc3wuksb3f.onion:8333 70015/Satoshi:0.20.0/
ms ms sec sec min min min
ipv4 ipv6 onion total block-relay
in 0 0 4 4 2
out 0 0 10 10 2
total 0 0 14 14 4
...
|
Rebased. If merged for 0.21 will add a release note manually in the wiki. |
…unction 3984b78 test: Add tests for CNode::ConnectedThroughNetwork (Hennadii Stepanov) 49fba9c net: Add CNode::ConnectedThroughNetwork member function (Hennadii Stepanov) d4dde24 net: Add CNode::m_inbound_onion data member (Hennadii Stepanov) Pull request description: This PR: - adds `CNode::ConnectedThroughNetwork` member function - is based on bitcoin#19991, and only last two commits belong to it - is required for bitcoin-core/gui#86 and bitcoin#20002 ACKs for top commit: jonatack: re-ACK 3984b78 per `git diff 3989fcf 3984b78` laanwj: Code review ACK 3984b78 Tree-SHA512: 23a9c8bca8dca75113b5505fe443b294f2d42d03c98c7e34919da12d8396beb8d0ada3a58ae16e3da04b7044395f72cf9c216625afc078256cd6c897ac42bf3d
88070ea to
6c08a4b
Compare
+1 in getting this into 0.21, it's a low risk change and is kind of the culmination of work that's been going on for the entire release cycle |
hebasto
left a comment
There was a problem hiding this comment.
Tested 6c08a4b6e755efa40f021ff4e7ec0d69379cc773 on Linux Mint 20 (x86_64). LGTM.
6c08a4b to
b62d8a4
Compare
|
Thanks for the feedback! Updated. (Edit: repushed to wrap array initialization in extra braces for one compiler on travis that needed appeasing.) |
b62d8a4 to
43606b6
Compare
After this commit, a new network may be added by changing 4 lines:
- increment the value of `m_networks_size`
- add the network name to `m_networks`
- add the network name to this line: `result += " ipv4 ipv6 onion total block-relay\n";`
- add "counts.at(i).at(<m_networks pos>)" to this line: `result += strprintf("%-5s %5i %5i %5i %5i %5i\n...`
43606b6 to
6272604
Compare
|
ACK 6272604 |
…o; simplify/improve -netinfo 6272604 refactor: enable -netinfo to add future networks (i2p, cjdns) (Jon Atack) 82fd402 refactor: promote some -netinfo localvars to class members (Jon Atack) 5133fab cli: simplify -netinfo using getpeerinfo network field (Jon Atack) 4938a10 rpc, test: expose CNodeStats network in RPC getpeerinfo (Jon Atack) 6df7882 net: add peer network to CNodeStats (Jon Atack) Pull request description: This PR: - builds on bitcoin#19991 and bitcoin#19998 - exposes peer networks via a new getpeerinfo `network` field ("ipv4", "ipv6", or "onion"), and adds functional tests - updates -netinfo to use getpeerinfo `network` rather than detecting the peer networks client-side - refactors -netinfo to easily add future networks ACKs for top commit: laanwj: ACK 6272604 Tree-SHA512: 28883487585135ceaaf84ce09131f2336e3193407f2e3df0960e3f4ac340f500ab94ffecb9d06a4c49bc05e3cca4f914ea4379860bea0bd5df2f834f74616015
Done, manually added a release note in the wiki for getpeerinfo#network. |
Summary: This is a backport of [[bitcoin/bitcoin#20002 | core#20002]] [1/5] bitcoin/bitcoin@6df7882 Test Plan: `ninja` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10502
Summary: This is a backport of [[bitcoin/bitcoin#20002 | core#20002]] [2/5] bitcoin/bitcoin@4938a10 Depends on D10502 Test Plan: `ninja check-functional` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10503
Summary: This is a backport of [[bitcoin/bitcoin#20002 | core#20002]] [3/5] bitcoin/bitcoin@5133fab Depends on D10503 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10504
Summary: This is a backport of [[bitcoin/bitcoin#20002 | core#20002]] [4/5] bitcoin/bitcoin@82fd402 Depends on D10504 Test Plan: `ninja all check-all` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10505
Summary:
After this commit, a new network may be added by changing 4 lines:
- increment the value of `m_networks_size`
- add the network name to `m_networks`
- add the network name to this line: `result += " ipv4 ipv6 onion total block-relay\n";`
- add "counts.at(i).at(<m_networks pos>)" to this line: `result += strprintf("%-5s %5i %5i %5i %5i %5i\n...`
This is a backport of [[bitcoin/bitcoin#20002 | core#20002]] [5/5]
bitcoin/bitcoin@6272604
Depends on D10505
Test Plan: `ninja all check-all`
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10506
This PR:
networkfield ("ipv4", "ipv6", or "onion"), and adds functional testsnetworkrather than detecting the peer networks client-side