Skip to content

Conversation

@jonatack
Copy link
Member

@jonatack jonatack commented Sep 23, 2020

This PR:

@practicalswift
Copy link
Contributor

Concept ACK

Thanks for improving -netinfo! :)

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 23, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, 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.

@jonatack jonatack force-pushed the getpeerinfo-GetNetClass branch from 2aa2a8f to a3c7f1d Compare September 23, 2020 16:23
@jonatack jonatack force-pushed the getpeerinfo-GetNetClass branch 2 times, most recently from 44c4c54 to 9631174 Compare September 24, 2020 13:32
@jonatack jonatack changed the title net, rpc, cli: expose CNetAddr::GetNetClass in getpeerinfo, use in -netinfo net, rpc, cli: expose GetNetClass()/ConnectedViaTor() in getpeerinfo, use in -netinfo Sep 24, 2020
@hebasto
Copy link
Member

hebasto commented Sep 24, 2020

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

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
...

@jonatack
Copy link
Member Author

Rebased. If merged for 0.21 will add a release note manually in the wiki.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 13, 2020
…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
@jonatack jonatack force-pushed the getpeerinfo-GetNetClass branch from 88070ea to 6c08a4b Compare October 14, 2020 09:13
@laanwj
Copy link
Member

laanwj commented Oct 14, 2020

Rebased. If merged for 0.21 will add a release note manually in the wiki.

+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

@laanwj laanwj added this to the 0.21.0 milestone Oct 14, 2020
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

Tested 6c08a4b6e755efa40f021ff4e7ec0d69379cc773 on Linux Mint 20 (x86_64). LGTM.

@jonatack jonatack force-pushed the getpeerinfo-GetNetClass branch from 6c08a4b to b62d8a4 Compare October 14, 2020 13:29
@jonatack
Copy link
Member Author

jonatack commented Oct 14, 2020

Thanks for the feedback! Updated. (Edit: repushed to wrap array initialization in extra braces for one compiler on travis that needed appeasing.)

@jonatack jonatack force-pushed the getpeerinfo-GetNetClass branch from b62d8a4 to 43606b6 Compare October 14, 2020 13:57
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...`
@jonatack jonatack force-pushed the getpeerinfo-GetNetClass branch from 43606b6 to 6272604 Compare October 14, 2020 14:33
@laanwj
Copy link
Member

laanwj commented Oct 15, 2020

ACK 6272604

@laanwj laanwj merged commit 0d22482 into bitcoin:master Oct 15, 2020
@jonatack jonatack deleted the getpeerinfo-GetNetClass branch October 15, 2020 16:18
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 16, 2020
…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
@jonatack
Copy link
Member Author

jonatack commented Nov 2, 2020

Rebased. If merged for 0.21 will add a release note manually in the wiki.

Done, manually added a release note in the wiki for getpeerinfo#network.

Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2021
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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2021
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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2021
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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2021
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
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2021
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants