Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpc: deprecate banscore field in getpeerinfo #19469

Merged
merged 3 commits into from
Jul 10, 2020

Conversation

jonatack
Copy link
Contributor

@jonatack jonatack commented Jul 8, 2020

Per #19219 (comment) and #19219 (comment), this PR deprecates returning the banscore field in the getpeerinfo RPC, updates the help, adds a test, and updates the release notes. Related to #19464.

@maflcko maflcko added this to the 0.21.0 milestone Jul 8, 2020
Copy link
Member

@maflcko maflcko left a comment

Choose a reason for hiding this comment

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

reviewed on GitHub ACK 454a873

doc/release-notes-19469.md Outdated Show resolved Hide resolved
@jonatack jonatack force-pushed the deprecate-getpeerinfo-banscore branch from 454a873 to 41d55d3 Compare July 8, 2020 13:11
@laanwj
Copy link
Member

laanwj commented Jul 9, 2020

Code review ACK 8c7647b

@amitiuttarwar
Copy link
Contributor

ACK 8c7647b

@fanquake
Copy link
Member

@laanwj & @amitiuttarwar: it would seem you've both ACK'd the wrong commit hash here?

Locally I'm seeing:

bitcoin git:(master) git fetch upstream pull/19469/head:19469 
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Total 15 (delta 8), reused 8 (delta 8), pack-reused 7
Unpacking objects: 100% (15/15), 5.72 KiB | 234.00 KiB/s, done.
From https://github.com/bitcoin/bitcoin
 * [new ref]             refs/pull/19469/head -> 19469
bitcoin git:(master) git checkout 19469                      
Switched to branch '19469'
bitcoin git:(19469) git log
...
commit 41d55d30579358c805036201664ad6a1c1d48681 (HEAD -> 19469)
Author: Jon Atack <jon@atack.com>
Date:   Wed Jul 8 12:54:28 2020 +0200

    doc: getpeerinfo banscore deprecation release note

commit dd54e3796e633cfdf6954af306afd26eadc25116
Author: Jon Atack <jon@atack.com>
Date:   Wed Jul 8 12:33:14 2020 +0200

    test: getpeerinfo banscore deprecation test

commit 8c7647b3fbbab03ea84071cf3cd2d0d2bf8be255
Author: Jon Atack <jon@atack.com>
Date:   Wed Jul 8 13:00:58 2020 +0200

    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.

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

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

ACK 41d55d3

@fanquake fanquake merged commit a4eb6a5 into bitcoin:master Jul 10, 2020
@jonatack jonatack deleted the deprecate-getpeerinfo-banscore branch July 10, 2020 07:40
@jnewbery
Copy link
Contributor

This feels a little premature. I think it's not helped by a confusing collision in terminology:

Until we've actually removed the nMisbehavior functionality, it seems useful to be able to check a peer's nMisbehavior score.

@jonatack
Copy link
Contributor Author

jonatack commented Jul 10, 2020

* `-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 (comment), 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.

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 10, 2020
41d55d3 doc: getpeerinfo banscore deprecation release note (Jon Atack)
dd54e37 test: getpeerinfo banscore deprecation test (Jon Atack)
8c7647b rpc: deprecate banscore field in rpc getpeerinfo (Jon Atack)

Pull request description:

  Per bitcoin#19219 (comment) and bitcoin#19219 (comment), this PR deprecates returning the `banscore` field in the `getpeerinfo` RPC, updates the help, adds a test, and updates the release notes. Related to bitcoin#19464.

ACKs for top commit:
  fanquake:
    ACK 41d55d3

Tree-SHA512: 8eca08332581e2fe191a2aafff6ba89ce39413f0491ed0de8b86577739f0ec430b1a8fbff2914b0f3138a229563dfcc1981c0cf5b7dd6061b5c48680a28423bc
maflcko pushed a commit that referenced this pull request Jul 14, 2020
06059b0 net: rename DEFAULT_BANSCORE_THRESHOLD to DISCOURAGEMENT_THRESHOLD (Jon Atack)
1d4024b net: remove -banscore configuration option (Jon Atack)

Pull request description:

  per #19219 (comment), #19219 (comment) and #19219 (comment). Edit: now split into 3 straightforward PRs:
  - net: remove -banscore configuration option (this PR)
  - rpc: deprecate banscore field in getpeerinfo (#19469, *merged*)
  - gui: no longer display banscores (TBA in the gui repo)

ACKs for top commit:
  MarcoFalke:
    review ACK 06059b0 📙
  vasild:
    ACK 06059b0

Tree-SHA512: 03fad249986e0896697033fbb8ba2cbfaae7d7603b1fb2a38b3d41db697630d238623f4d732b9098c82af249ce5a1767dd432b7ca0fec10544e23d24fbd57c50
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 14, 2020
06059b0 net: rename DEFAULT_BANSCORE_THRESHOLD to DISCOURAGEMENT_THRESHOLD (Jon Atack)
1d4024b net: remove -banscore configuration option (Jon Atack)

Pull request description:

  per bitcoin#19219 (comment), bitcoin#19219 (comment) and bitcoin#19219 (comment). Edit: now split into 3 straightforward PRs:
  - net: remove -banscore configuration option (this PR)
  - rpc: deprecate banscore field in getpeerinfo (bitcoin#19469, *merged*)
  - gui: no longer display banscores (TBA in the gui repo)

ACKs for top commit:
  MarcoFalke:
    review ACK 06059b0 📙
  vasild:
    ACK 06059b0

Tree-SHA512: 03fad249986e0896697033fbb8ba2cbfaae7d7603b1fb2a38b3d41db697630d238623f4d732b9098c82af249ce5a1767dd432b7ca0fec10544e23d24fbd57c50
@jnewbery
Copy link
Contributor

Just realised I never responded to @jonatack's last comment. I don't think this should be reverted.

@jonatack
Copy link
Contributor Author

Thanks @jnewbery. At the next p2p meeting, one topic to discuss could be if someone is working on replacing nMisbehavior with prioritizing/scheduling peer work based on how much resource the peer is using.

@jnewbery
Copy link
Contributor

Sure. @troygiorshev is soon to open a PR that adds tracking for some peer metrics, which would be the start of that work.

deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 6, 2021
Summary:
41d55d30579358c805036201664ad6a1c1d48681 doc: getpeerinfo banscore deprecation release note (Jon Atack)
dd54e3796e633cfdf6954af306afd26eadc25116 test: getpeerinfo banscore deprecation test (Jon Atack)
8c7647b3fbbab03ea84071cf3cd2d0d2bf8be255 rpc: deprecate banscore field in rpc getpeerinfo (Jon Atack)

Pull request description:

  Per bitcoin/bitcoin#19219 (comment) and bitcoin/bitcoin#19219 (comment), this PR deprecates returning the `banscore` field in the `getpeerinfo` RPC, updates the help, adds a test, and updates the release notes. Related to #19464.

---

Backport of Core [[bitcoin/bitcoin#19469 | PR19469]]

Test Plan:
  ninja all check
  test_runner rpc_getpeerinfo_banscore_deprecation

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D8798
@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.

None yet

6 participants