rpc: deprecate banscore field in getpeerinfo (#19469)
gui, doc, doc: no longer display “Ban Score” in GUI Peers window + test/doc fixups (#19512)
DrahtBot added the label
GUI
on Jul 8, 2020
DrahtBot added the label
P2P
on Jul 8, 2020
DrahtBot added the label
RPC/REST/ZMQ
on Jul 8, 2020
DrahtBot added the label
Tests
on Jul 8, 2020
DrahtBot added the label
Validation
on Jul 8, 2020
fanquake removed the label
GUI
on Jul 8, 2020
fanquake removed the label
Tests
on Jul 8, 2020
fanquake removed the label
Validation
on Jul 8, 2020
DrahtBot
commented at 11:28 am on July 8, 2020:
member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
#14053 (Add address-based index (attempt 4?) by marcinja)
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 marked this as ready for review
on Jul 8, 2020
MarcoFalke removed the label
RPC/REST/ZMQ
on Jul 8, 2020
MarcoFalke added the label
Settings
on Jul 8, 2020
MarcoFalke removed the label
P2P
on Jul 8, 2020
MarcoFalke added the label
P2P
on Jul 8, 2020
fanquake referenced this in commit
a4eb6a51a7
on Jul 10, 2020
in
doc/release-notes-19464.md:7
in
f926882076outdated
0@@ -0,0 +1,7 @@
1+Updated settings
2+----------------
3+
4+- The `-banscore` configuration option, which modified the default threshold for
5+ disconnecting and discouraging misbehaving peers, has been removed as part of
6+ changes in this release to the handling of misbehaving peers. Refer to the
7+ section, "Changes regarding misbehaving peers", for details. (#19464)
The tests had to be updated for the config removal.
jonatack
commented at 9:40 am on July 11, 2020:
member
If not, the following two commits should be squashed into it. Or maybe just squash all commit? man_shrugging
Review-only ACK
Thanks for ACKing. I took the time to made atomic commits for different actions, step by step, as seen in other contributors’ changesets and as described in CONTRIBUTING.md and in the wikipedia link it contains.
0In general, [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)
1and diffs should be easy to read. For this reason, do not mix any formatting
2fixes or code moves with actual code changes.
MarcoFalke
commented at 9:52 am on July 11, 2020:
member
Yes, I agree with this and it has been my standard practice. But AFAIK it’s not what is requested in this project’s documentation, and maybe not the most-observed practice in this project – I had to unlearn my practices to adapt to it.
MarcoFalke
commented at 10:13 am on July 11, 2020:
member
But AFAIK it’s not what is requested in this project’s documentation
Ok, then our documentation is wrong and should be fixed.
jonatack
commented at 10:15 am on July 11, 2020:
member
I’ll make the commits hygienic.
MarcoFalke added this to the milestone 0.21.0
on Jul 11, 2020
net: rename DEFAULT_BANSCORE_THRESHOLD to DISCOURAGEMENT_THRESHOLD
and move it from validation to net processing.
06059b0c2a
jonatack force-pushed
on Jul 11, 2020
jonatack referenced this in commit
93a7b7d9a3
on Jul 13, 2020
in
doc/release-notes.md:106
in
06059b0c2a
98@@ -99,6 +99,11 @@ Build System
99 Updated settings
100 ----------------
101102+- The `-banscore` configuration option, which modified the default threshold for
103+ disconnecting and discouraging misbehaving peers, has been removed as part of
104+ changes in this release to the handling of misbehaving peers. Refer to the
105+ section, "Changes regarding misbehaving peers", for details. (#19464)
106+
22@@ -23,6 +23,8 @@ static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
23 static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
24 static const bool DEFAULT_PEERBLOOMFILTERS = false;
25 static const bool DEFAULT_PEERBLOCKFILTERS = false;
26+/** Threshold for marking a node to be discouraged, e.g. disconnected and added to the discouragement filter. */
27+static const int DISCOURAGEMENT_THRESHOLD{100};
What unit would you suggest? It’s just a score (see Misbehaving in net_processing.cpp), and expected to be removed (see the links in the PR description).
vasild
commented at 12:36 pm on July 13, 2020:
member
Should doc/man/bitcoin-qt.1 and doc/man/bitcoind.1 be updated in this PR (they contain references to -banscore)?
If this PR gets merged now, it means that Bitcoin Core 0.21 will not recognize the -banscore command line option, is this the intention?
jonatack
commented at 2:35 pm on July 13, 2020:
member
Should doc/man/bitcoin-qt.1 and doc/man/bitcoind.1 be updated in this PR (they contain references to -banscore)?
AFAIK the manpages are auto-generated; we don’t edit them in PRs.
If this PR gets merged now, it means that Bitcoin Core 0.21 will not recognize the -banscore command line option, is this the intention?
Correct. See the links in the PR description for intention and reasoning behind the removal.
AFAIK there isn’t a deprecation process here like for the RPC API, so either it’s removed as proposed here, or we add a deprecation warning in the help (which everyone will ignore until the option is removed) for a release or two. Presumably this discouragement scoring will disappear anyway by 0.21 or 0.22 which means the -banscore option won’t do anything.
in
doc/release-notes.md:105
in
06059b0c2a
98@@ -99,6 +99,11 @@ Build System
99 Updated settings
100 ----------------
101102+- The `-banscore` configuration option, which modified the default threshold for
103+ disconnecting and discouraging misbehaving peers, has been removed as part of
104+ changes in this release to the handling of misbehaving peers. Refer to the
105+ section, "Changes regarding misbehaving peers", for details. (#19464)
MarcoFalke
commented at 5:28 pm on July 13, 2020:
member
Ideally everything would go in one swish (including state->nMisbehavior), but that can’t happen because it is still needed for RPC. This is a necessary first step.
vasild
commented at 6:16 pm on July 13, 2020:
member
ACK06059b0c
in
test/functional/p2p_leak.py:73
in
06059b0c2a
69@@ -70,7 +70,7 @@ class CNodeNoVersionBan(CLazyNode):
70 # NOTE: implementation-specific check here. Remove if bitcoind ban behavior changes
71 def on_open(self):
72 super().on_open()
73- for i in range(banscore):
74+ for _ in range(DISCOURAGEMENT_THRESHOLD):
Because we can no longer use -banscore to change the default threshold (see removed line in test: self.extra_args = [['-banscore=' + str(banscore)]]), so we have to use DISCOURAGEMENT_THRESHOLD here for the number of veracks sans version to send.
Note to self: the words “ban” in this functional test should be updated to “discourage”.
in
src/test/denialofservice_tests.cpp:290
in
06059b0c2a
See the two removed -banscore lines of this test, particularly the first one: gArgs.ForceSetArg("-banscore", "111"); // because 11 is my favorite number.
practicalswift
commented at 9:48 pm on July 13, 2020:
contributor
Concept ACK: giving users knobs without a recommendation about how/when to use them is not friendly :)
MarcoFalke merged this
on Jul 14, 2020
MarcoFalke closed this
on Jul 14, 2020
MarcoFalke
commented at 6:19 am on July 14, 2020:
member
Oh, I see this section won’t end up in the 0.21 release notes, so might want to clarify at some point
jonatack deleted the branch
on Jul 14, 2020
jnewbery
commented at 8:39 am on July 14, 2020:
member
post-merge ACK.
The test BOOST_AUTO_TEST_CASE(DoS_banscore) should be removed entirely. It only existed to test manually testing the -banscore config. Nothing else in the test is untested by the previous DoS_banning test.
jonatack
commented at 12:17 pm on July 14, 2020:
member
post-merge ACK.
The test BOOST_AUTO_TEST_CASE(DoS_banscore) should be removed entirely. It only existed to test manually testing the -banscore config. Nothing else in the test is untested by the previous DoS_banning test.
Good point @jnewbery. Added the removal to the test change commit in #19512.
sidhujag referenced this in commit
b8fc13afe4
on Jul 14, 2020
laanwj referenced this in commit
21209c9cce
on Jul 15, 2020
sidhujag referenced this in commit
9de76c71bf
on Jul 16, 2020
deadalnix referenced this in commit
91502b3998
on Jan 6, 2021
deadalnix referenced this in commit
59fd163cc4
on Jan 6, 2021
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2025-05-08 09:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me