rpc: Human readable network services#16787
Conversation
42fd0ca to
6e47bf2
Compare
|
Concept ACK, though to avoid clients having to do additional string parsing, i'd slightly prefer a list instead of one or leave out the |
|
I prefer @laanwj's version as well. |
6e47bf2 to
fcbbb7e
Compare
|
Updated to use a list instead of a |
fanquake
left a comment
There was a problem hiding this comment.
Concept ACK - looks like multiple developers have said that this would be a worthwhile inclusion. Thanks for writing release notes as well.
master (33f9750):
"services": "000000000000040d",
"relaytxes": true,This PR (0774c03056a1722fe15b8b0926bf040c8932c7c3):
src/bitcoin-cli getpeerinfo | grep -i 'services' -A 7
"services": "000000000000040d",
"servicesnames": [
"NETWORK",
"BLOOM",
"WITNESS",
"NETWORK_LIMITED"
],
"relaytxes": true,
--
"services": "000000000000000d",
"servicesnames": [
"NETWORK",
"BLOOM",
"WITNESS"
],
"relaytxes": true,
"lastsend": 1567474969,
--
"services": "000000000000040d",
"servicesnames": [
"NETWORK",
"BLOOM",
"WITNESS",
"NETWORK_LIMITED"
],
"relaytxes": true,|
Concept ACK -- nice usability improvement! |
0774c03 to
1e29f04
Compare
|
Rebased to point in the help that only known services are decoded, and to group the decoding into one function as suggested by @MarcoFalke |
|
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. |
|
Code review ACK 1e29f044dd3580f53d44b8293893c287100aa48d |
1e29f04 to
10adfa5
Compare
|
(Travis is failing for mysterious reasons but the build is passing on https://bitcoinbuilds.org/?build=1484 fwiw :-) ) |
mzumsande
left a comment
There was a problem hiding this comment.
ACK 10adfa5a769b0f47858bc77f2641c691e9b80c52. Reviewed code, ran tests and tried it out on mainnet - works as expected. Feel free to ignore nits if you don't change something else.
yeahh Travis is having infrastructure issues again (I think), restarted the failing jobs … |
10adfa5 to
66740f4
Compare
|
Rebased to fix the last doc nits (and hopefully make Travis happy). |
|
unsigned ACK 66740f4 |
promag
left a comment
There was a problem hiding this comment.
Should have tests for these new fields?
|
Works for me |
66740f4 doc: add a release note for the new field in 'getpeerinfo' and 'getnetworkinfo' (darosior) 6564f58 rpc/net: decode the services flags in a new entry (darosior) Pull request description: This is a reopen of #15511 (comment) since there have been concept ACKs from sdaftuar and Sjors. This adds a new entry to `getpeerinfo` and `getnetworkinfo` which decodes the network services flags. Here is a truncated output of `getpeerinfo`: ``` "services": "000000000000040d", "servicesnames": "NODE_NETWORK | NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED", "relaytxes": true, ``` And one of `getnetworkinfo`: ``` "localservices": "0000000000000409", "localservicesnames": "NODE_NETWORK | NODE_WITNESS | NODE_NETWORK_LIMITED", "localrelay": true, ``` Fixes #16780. ACKs for top commit: MarcoFalke: unsigned ACK 66740f4 laanwj: ACK 66740f4 Tree-SHA512: 0acc37134b283f56004a41243903d7790cb01591ddf0342489bd05f3a2c780563075373ba5fd55180fa15632e8968ffa11a979b8afece75a6a2e891342601440
Will do |
…tworkinfo` 1d524c6 tests: rename 'test_getnetworkinginfo' in 'test_getnetworkinfo' (darosior) 07a8f65 tests: add a test for the 'servicesnames' RPC field (darosior) Pull request description: As per #16787 (comment), fixes #16844. This adds a test for both commands in the first commit and renames the test for `getnetworkinfo` in the second commit. ACKs for top commit: laanwj: ACK 1d524c6 Tree-SHA512: 8267dce4d54356debab75014e6f9ba885b892da605ed32f26a5446c232992fcae761861bb678adbdb942815d4706f3768c70deee6afec68f219b23605475be01
Github-Pull: bitcoin#16787 Rebased-From: 6564f58
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
This is a backport of bitcoin/bitcoin/pull/16787
* Update travis.yml according to travis backend errors and warns Namely: - root: deprecated key sudo (The key `sudo` has no effect anymore.) - language: value minimal is an alias for shell, using shell - root: key matrix is an alias for jobs, using jobs * Reduce time threshold to force travis to save cache and abort * Add getchaintxstats RPC this is a port of core #9733 * [RPC] Add an uptime command that displays the amount of time that bitcoind has been running this is a port of Core #10400 * rpc/net: decode the services flags in a new entry This is a backport of bitcoin/bitcoin/pull/16787 Co-authored-by: Pieter Wuille <[email protected]> Co-authored-by: Ricardo Velhote <[email protected]> Co-authored-by: Darosior <[email protected]>
Summary: This adds human readable network services to the output of `getpeerinfo` and `getnetworkinfo` Backport of Core [[bitcoin/bitcoin#16787 | PR16787]] Test Plan: Run `src/bitcoin-cli getnetworkinfo` and check the `localservicesnames` field. More tests coming in PR16850 Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7948
This is a reopen of #15511 (comment) since there have been concept ACKs from sdaftuar and Sjors.
This adds a new entry to
getpeerinfoandgetnetworkinfowhich decodes the network services flags.Here is a truncated output of
getpeerinfo:And one of
getnetworkinfo:Fixes #16780.