banscore
field in the getpeerinfo
RPC, updates the help, adds a test, and updates the release notes. Related to #19464.
banscore
field in the getpeerinfo
RPC, updates the help, adds a test, and updates the release notes. Related to #19464.
0@@ -0,0 +1,6 @@
1+Updated RPCs
2+------------
3+
4+- `getpeerinfo` no longer returns the `banscore` field unless the configuration
5+ option `-deprecatedrpc=banscore` is used. The `banscore` field will be fully
6+ removed in the next release. (#19469)
0 removed in the next major release. (#19469)
@laanwj & @amitiuttarwar: it would seem you’ve both ACK’d the wrong commit hash here?
Locally I’m seeing:
0
1bitcoin git:(master) git fetch upstream pull/19469/head:19469
2remote: Enumerating objects: 8, done.
3remote: Counting objects: 100% (8/8), done.
4remote: Total 15 (delta 8), reused 8 (delta 8), pack-reused 7
5Unpacking objects: 100% (15/15), 5.72 KiB | 234.00 KiB/s, done.
6From https://github.com/bitcoin/bitcoin
7 * [new ref] refs/pull/19469/head -> 19469
8bitcoin git:(master) git checkout 19469
9Switched to branch '19469'
10bitcoin git:(19469) git log
11...
12commit 41d55d30579358c805036201664ad6a1c1d48681 (HEAD -> 19469)
13Author: Jon Atack <jon@atack.com>
14Date: Wed Jul 8 12:54:28 2020 +0200
15
16 doc: getpeerinfo banscore deprecation release note
17
18commit dd54e3796e633cfdf6954af306afd26eadc25116
19Author: Jon Atack <jon@atack.com>
20Date: Wed Jul 8 12:33:14 2020 +0200
21
22 test: getpeerinfo banscore deprecation test
23
24commit 8c7647b3fbbab03ea84071cf3cd2d0d2bf8be255
25Author: Jon Atack <jon@atack.com>
26Date: Wed Jul 8 13:00:58 2020 +0200
27
28 rpc: deprecate banscore field in rpc getpeerinfo
Regardless, these changes are straightforward and I’m happy to go ahead and merge this.
Also cc @jnewbery & @sipa. I know you both expressed a desire for the removal of -banscore
.
This feels a little premature. I think it’s not helped by a confusing collision in terminology:
-banscore
is a configuration option that we might better call “configurable discouragement threshold”. That’s what sipa and I were referring to in #19219. It should be removed because we have no good advice for users on how to set it.banscore
in getpeerinfo
returns the peer’s current nMisbehavior
score. Longer term, it’d be good to replace nMisbehavior with prioritizing/scheduling peer work based on how much resource the peer is using (see https://bitcoincore.reviews/19109.html#l-99 and http://www.erisian.com.au/bitcoin-core-dev/log-2020-07-09.html#l-134).Until we’ve actually removed the nMisbehavior functionality, it seems useful to be able to check a peer’s nMisbehavior score.
* `-banscore` ... should be removed because we have no good advice for users on how to set it.
Indeed, the first PR in this series, #19464, is a very small change that does just that. Presumably that PR, or another version, will be merged before the next release. I’m happy to work on internal peer prioritisation changes after that first step if people aren’t already doing it.
The confusion around the naming of the banscore field in getpeerinfo was not addressed because it should be removed. In #19219 (review), I suggested it be renamed.
This PR gives users until at least v0.22 to no longer depend on it (if any were). I reckon it will no longer be used internally before that, but in the worst case if this PR does turn out to be premature, it can be reverted before the next release.