Skip to content

Conversation

@jonatack
Copy link
Member

@jonatack jonatack commented Jan 7, 2021

A few updates, some per IRC discussion today at http://www.erisian.com.au/bitcoin-core-dev/log-2021-01-07.html#l-87 with respect to -netinfo:


How to test manually: 🔬 🧪 📈

  1. check out and build this branch locally; if you need help, don't hesitate to refer to https://jonatack.github.io/articles/how-to-review-pull-requests-in-bitcoin-core#pull-down-the-code-locally or https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests
  2. while it is compiling, look at the code changes
  3. stop signet (if it is running) with ./src/bitcoin-cli -signet stop
  4. once the build is completed, run ./src/bitcoin-cli -signet -netinfo help
  5. the help should be printed even though the signet server is not running
  6. near the top you should see the new warning, "This human-readable interface will change regularly and is not intended to be a stable API" as well as a bit more description about the integer argument values.
  7. start signet with ./src/bitcoind -signet
  8. test the improved invalid argument error message if you run ./src/bitcoin-cli -signet -netinfo 256 or ./src/bitcoin-cli -signet -netinfo a (valid values are from 0 to 255)
  9. leave review feedback or ACK <commit hash> -- done 🍻

@jonatack jonatack mentioned this pull request Jan 7, 2021
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 7, 2021

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

Conflicts

No conflicts as of last run.

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Concept ACK

Verified that the help shows now without bitcoind running and that bitcoin-cli -netinfo 5 throws an error. 🆗

Being still a git noob, but can anyone guide me on why the move detection with ignoring whitespace in the second commit doesn't work? I tried git show --color-moved-ws=ignore-all-space HEAD^ but no luck, still the whole diff of the helptext is shown. I ask as this could maybe also helpful for other reviewers.

@jonatack
Copy link
Member Author

jonatack commented Jan 7, 2021

@theStack thanks for having a look. Here is what I used to diff the second commit.

~/.gitconfig

[diff]
  # Detect copies as well as renames
  renames = copies
	colorMoved = dimmed-zebra
	colorMovedWs = allow-indentation-change

command line result

Screenshot from 2021-01-08 00-40-43
Screenshot from 2021-01-08 00-40-34

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

@jonatack: Thanks, that gave me the missing clue: --color-moved-ws alone doesn't do much, it has to be combined with --color-moved (I should have RTFM(anpage) 😬). Applying that permanently by putting into .gitconfig is of course an interesting approach, will try.

ACK d05b4d57fde74eea71d033f1d0e5435380ad4708 🦘

@jonatack
Copy link
Member Author

jonatack commented Feb 2, 2021

This has one ACK by @theStack a month ago (thanks!) Anyone else feel like reviewing?

Edit: added step-by-step manual testing info in the PR description.

@theStack
Copy link
Contributor

theStack commented Feb 2, 2021

@jonatack: Maybe restarting the CI also helps (the AppVeyor build seems to hang since the beginning)? I could imagine some reviewers only put PRs on their candidate list after they see the green check marks.

@jonatack jonatack closed this Feb 2, 2021
@jonatack jonatack reopened this Feb 2, 2021
@jonatack
Copy link
Member Author

jonatack commented Feb 2, 2021

@theStack thanks, good idea 🌻

@jonatack
Copy link
Member Author

jonatack commented Feb 2, 2021

Oh, stopping/restarting doesn't seem to work. I guess I have to rebase.

@jonatack
Copy link
Member Author

jonatack commented Feb 2, 2021

Rebased for appveyor.

@jonatack jonatack force-pushed the netinfo-help-follow-ups branch from d05b4d5 to 1c40378 Compare February 2, 2021 14:12
Copy link

@michaelfolkson michaelfolkson left a comment

Choose a reason for hiding this comment

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

ACK d05b4d57fde74eea71d033f1d0e5435380ad4708

Followed instructions to test in PR description. Those instructions could maybe be improved by instructing the restart of the Signet chain before the "test that an invalid integer argument raises" step. But very easy to follow, thanks

@jonatack
Copy link
Member Author

jonatack commented Feb 2, 2021

Followed instructions to test in PR description. Those instructions could maybe be improved by instructing the restart of the Signet chain before the "test that an invalid integer argument raises" step. But very easy to follow, thanks

Thanks! -- updated the instructions.

@jonatack jonatack force-pushed the netinfo-help-follow-ups branch from 1c40378 to d05b4d5 Compare February 2, 2021 15:54
@jonatack
Copy link
Member Author

jonatack commented Feb 2, 2021

Re-pushed at d05b4d57fde74ee to not invalidate the 2 ACKs (thanks!)

@jonatack
Copy link
Member Author

jonatack commented Feb 5, 2021

Rebased following the merge of #20764 🍰

@michaelfolkson
Copy link

Re-ACK 965d9fc09872887314df34e1309604bcc79ff0fc

Followed testing instructions and skimmed over code.

Copy link
Member

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

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

Besides one take-it-or-leave it nit, this is great.

Built branch, tested help with and without bitcoind running. Attempted to call -netinfo with values from 0 through 5 and got expected results including the error. Read the help message and I will definitely not rely on this dashboard's output for any kind of stable application!

Tested on both signet and mainnet, including adding onion peers. Love the dsiplay!

Bitcoin Core v21.99.0-965d9fc09872 - 70016/Satoshi:21.99.0/

<->   type   net  mping   ping send recv  txn  blk  hb age id address                                                        version
out manual onion                 30   29                 0 19 kpgvmscirrdqpekbqjsvw5teanhatztpp2gl6eee4zkowvwfxwenqaid.onion
out   full  ipv4                 43   43                 0 18 188.37.24.190:8333
out   full  ipv4     60  35648   52   48         0       4  3 73.0.216.24:8333                                               70016/Satoshi:0.21.0/
out  block  ipv4     92     92   63    2         0       2 15 52.214.5.250:8333                                              70015/Satoshi:0.20.1/
out   full  ipv4    142   9772   53   50         0       4  0 87.206.227.194:8333                                            70016/Satoshi:0.21.0/
out   full  ipv4    191    191   63   20         0       2 12 54.168.144.78:8333                                             70015/Satoshi:0.18.1(Omni:0.8.0)/
out   full  ipv4    275    275  131    4                 4  1 180.181.159.200:8333                                           70015/Satoshi:0.19.0.1/
out   full  ipv4    321   6821   63   56         0       3  8 103.29.69.57:8333                                              70015/Satoshi:0.18.0(bitcore)/
out manual onion    618    618   65   26         1       3  4 rp7k2go3s5lyj3fnj6zn62ktarlrsft2ohlsxkyd7v3e3idqyptvread.onion 70016/Satoshi:21.99.0(Medea)/
out   full onion    618    618   60   26         0       2 13 d5uy3u2hkczvmzis.onion:8333                                    70015/Satoshi:0.20.1/
                     ms     ms  sec  sec  min  min     min

        ipv4    ipv6   onion   total   block  manual
in         0       0       0       0
out        7       0       3      10       1       2
total      7       0       3      10

Local addresses: n/a

ACK 965d9fc09872887314df34e1309604bcc79ff0fc

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK 965d9fc09872887314df34e1309604bcc79ff0fc
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmAlnvoACgkQ5+KYS2KJ
yTp6kw//afOJ89VzlHAafYMlwR58qHYiyziMnIeJQnIJULMibA7EEQg480dNyNUu
LiZFb6sPSnFaw8nlbEy08XxcTfmwJ4CvqP/DOp29N8iNIXKarPLrHfonOaOTmbAY
snTp/UC6frdB0U532CBeY3UgNEjXdQg6XmKMFDevkVm0Gv8eehskEeMPnsDh7+L4
7I3gs88ROZRuK5iDv08R3UD8U90JKpHFnJ4oVaI1xZGekvuG0rJYF1TzhqiTdGVH
NwCUfy1jqTQvTEAAabeh5oMGVSxxGlVj8Vfd9wPyHuk6nFUZ7J/rgeIajitD7rhQ
JX3xvW5rLcky+lFXcEZm9tRh2/znZGg286ImP+E1TWACmbePV1pX5kH5x9Uy0rMP
qguCksUh1xAnuXxt265nOaX9KiK1CW70hVynxvAc0UDWph+k5hElZpq8S5vLgqFF
qFz22B3GhaQAJ3k8oi1pEIVRJOaWyhhf1Keq+tvwbIuxf7SIOP+lWIctNQ4LkaCK
85P78/EIraEgBRtDuFxV6ljBa0xk1xaX+CbxFLsdT4fZew8kWnXlzoBMx0uhk4Dx
7Z6fY7XJuwr83O8gPER22LP0DRw+GFIyvSeGJTx2lPkKuHsgumxOSlUGa3WWgNiE
C2FBqoGD8ya5Ty2Aio5cH/h/W0aMWFDToPvk/+8lrHzfDh7wclw=
=LaQW
-----END PGP SIGNATURE-----

pinheadmz's public key is on keybase

@jonatack jonatack force-pushed the netinfo-help-follow-ups branch from 965d9fc to 41a5ca6 Compare February 11, 2021 22:59
@jonatack
Copy link
Member Author

Thank you @theStack, @michaelfolkson, and @pinheadmz for the ACKs. Only change in latest push is to improve the error message per suggestion by @pinheadmz:

$ ./src/bitcoin-cli -netinfo foo
error: invalid -netinfo argument: foo
For more information, run: bitcoin-cli -netinfo help      <-- added this line

git diff 965d9fc 41a5ca6

diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp
index 43d3dc7da5..1c21856457 100644
--- a/src/bitcoin-cli.cpp
+++ b/src/bitcoin-cli.cpp
@@ -376,7 +376,7 @@ public:
             if (ParseUInt8(args.at(0), &n) && n < 5) {
                 m_details_level = n;
             } else {
-                throw std::runtime_error(strprintf("invalid -netinfo argument: %s", args.at(0)));
+                throw std::runtime_error(strprintf("invalid -netinfo argument: %s\nFor more information, run: bitcoin-cli -netinfo help", args.at(0)));
             }
         }
         UniValue result(UniValue::VARR);

@pinheadmz
Copy link
Member

Confirmed diff is minimal, LGTM

ACK 41a5ca6a0341d132456408aa6271667e0a74e289

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK 41a5ca6a0341d132456408aa6271667e0a74e289
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmAlzrYACgkQ5+KYS2KJ
yTr5gw/+KxPNflTAOaMuG2MNcmRsWFfznO93T8WXHyB7nO0ejCil7DuPViVDVmK1
nARGht0n9qXs+gQKwGphnWu6GxTuLL+lHfbEXUH63hgMgZYl9xWipL/cVLywtu2g
AUwJI7S0lOHV7H/cxzmWmlT12h1Jr1qGIwLUoib48LrcAw1bgJ3r1llRYRsEJ1fu
heZHgXvpB45Y/ZSChyzAe3w1ABD/ylsrkubilas7WYiFAkL7qRBOBw77HiFcUqjh
z12HkoSbzsW30u5ddDhGg9smeUBzZzI6frJfn4FiFIQP+UukR+BZmqhKtixcpHfY
7kvA5q2YISxkcdmdth6SjEsWUcinfi4Q1AnKkvZ7BNwH+g4OKRZlq4DbHYzMzTGv
GtGJvo66BR05dysjuf1fXVLuoxmksQaYKN3G71QwvkI3yvgUw4SU4hBZwZwcoZqe
g5CncCcLpG8uCWN9VARG6JB0sMh8/n+ASC1MjJZwhwXEGxemdAnLwwPHuBM0005X
G86K/5eVoxMbJEGUlsQkwCoN35MMZ6jogAgsaDC7tRUoOaPPreoKIu1CLfVF8GlO
ioRQ9aF7A2amfSQBxBMieSxnOjuQisBO1CJavTl88nF5nRwC7Eqz2xckvk7GCeh+
0f63HqOZuXXIpV900twIBQv27ckZM0zdCHgOAJAh4TK1ncpqGzU=
=hGOF
-----END PGP SIGNATURE-----

pinheadmz's public key is on keybase

@jonatack jonatack force-pushed the netinfo-help-follow-ups branch from 41a5ca6 to 7d3343f Compare February 17, 2021 14:10
@jonatack
Copy link
Member Author

Rebased and updated following the merge of #21192. This had tested ACK by @theStack, @michaelfolkson, and @pinheadmz (thanks!)

@michaelfolkson
Copy link

Re-ACK 7d3343f

@pinheadmz
Copy link
Member

Built and tested locally, ran -netinfo with and without server, tried different arguments as integers and invalid arguments (strings) everything returned as expected.

RE-ACK 7d3343f

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK 7d3343fb8e775527e6afc2b183a62ad76e62347e
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmAtQkUACgkQ5+KYS2KJ
yTpxlA//eUHLA/V4il2vPwrA5rBvwkL97kT6I4MHSoJYF4kx+27tZORPQ/1l/1OO
ybzrZoazhY2XRZ3vrc+AOEyI1l6d+DPElczCvdE4in3Q6fPogLd0/Dg+EBiyuUPO
9yAVIOcGTemSQz7Xvf7lQvpFqrrcHc+Jami/PTLYf8UjnaVfK5cHSyyu+WyJzG9H
P4iuFYm1Q5dnbTRzRHCQEuyzG2iO0OVHmx5ryEorgT+BbZKREk1pwD4BEDceH/CH
LpahEC4OQPT+GUhK7mto3OPzY+O8A7ZA2A8mcZXDXgMBr+TignOwIg9Zd7IvvGWl
dYkmyBpz18JAxQF4SFFoYkdAQI7cvkcnRnsdokAndv1h8G1VFq1FiGLG/UJL1hZJ
dRcA8Zptfr7AuXfO/HJukVKr+jZZUtDgeeXvutdJ5p9bLzqPIaU/vCgBg3fEUZiG
pRcXqEjgN4hI3/3uYSEBbYzprdUzR83vuoQLZ1+wsXbSSCkkqblewQRcA3OF3sl1
rhQSZvOupy99w6kQBmrIs0prELQX2fDqcD0rl+iI1VyZwH/o6d6cGDxWUrRiPHCR
phwu2IFjnQ67XoonAEGoQ26SKyzzPO/k/B/Nt6nojna3ZiQ/EYd4scdlTbcM69mG
/CY9ueyK/8yUla0iELYByBUXLLLRP3OO+KbGL4Yghs0f/LVu2e8=
=uXWM
-----END PGP SIGNATURE-----

pinheadmz's public key is on keybase

@laanwj laanwj merged commit cabe637 into bitcoin:master Mar 3, 2021
@jonatack jonatack deleted the netinfo-help-follow-ups branch March 3, 2021 14:41
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 3, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants