8000 RPC: getpeerinfo: Deprecate "whitelisted" field (replaced by "permissions") by luke-jr · Pull Request #19770 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RPC: getpeerinfo: Deprecate "whitelisted" field (replaced by "permissions") #19770

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

Merged
merged 2 commits into from
Oct 15, 2020

Conversation

luke-jr
Copy link
Member
@luke-jr luke-jr commented Aug 20, 2020

If we were going to continue support for "whitelisted", we should have probably made it true if any permission flag was set, rather than only if "default permissions" were used.

This corrects the description, and deprecates it.

@DrahtBot
Copy link
Contributor
DrahtBot commented Aug 20, 2020

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

Conflicts

No conflicts as of last run.

@luke-jr luke-jr force-pushed the deprecate_whitelisted branch 3 times, most recently from eb4606a to 6396aa3 Compare August 20, 2020 21:18
@maflcko
Copy link
Member
maflcko commented Aug 21, 2020

ACK 6396aa3

@jonatack
Copy link
Member

Concept ACK

@laanwj
Copy link
Member
laanwj commented Aug 23, 2020

Does this need a release notes mention?
Concept ACK

@laanwj
Copy link
Member
laanwj commented Aug 24, 2020

Travis gives the following new Python lint error:

test/functional/p2p_permissions.py:166:35: E701 multiple statements on one line (colon)

Edit: oh already reported.

@luke-jr luke-jr force-pushed the deprecate_whitelisted branch from 6396aa3 to 531198b Compare August 24, 2020 14:32
@luke-jr
Copy link
Member Author
luke-jr commented Aug 24, 2020

Changes done

@maflcko
Copy link
Member
maflcko commented Aug 27, 2020

cr ACK 531198b

No opinion on the linter, I am fine with either alternative.

@maflcko maflcko added this to the 0.21.0 milestone Aug 27, 2020
@laanwj
Copy link
Member
laanwj commented Aug 27, 2020

To be honest I think it's pretty un-python-y to have multiple statements on one line. I've never seen it before at all.

@maflcko
Copy link
Member
maflcko commented Aug 27, 2020

Heh, I've also never seen it before. Though, it shouldn't cause any bugs, so if it makes @luke-jr happy and travis is green, then I won't complain 😅

@practicalswift
Copy link
Contributor

NACK on the unrelated test/lint/lint-python.sh change.

The PR author's personal style preference is not a good reason to deviate from the well-established idiomatic style which the Python community has settled on and even formalised via PEP-8. Doing so would just open up for future bikeshedding where we currently run no such risk.

The language's style guide (PEP-8, https://www.python.org/dev/peps/pep-0008/) couldn't be more clear on this:

Compound statements (multiple statements on the same line) are generally discouraged

@StopAndDecrypt
Copy link
StopAndDecrypt commented Sep 6, 2020

Edit: I've redirected my concerns here.

@localcryptosMichael
Copy link

@StopAndDecrypt, this PR seems to have nothing to do with race, political correctness, feelings, or anything else you wrote.

@gmaxwell
Copy link
Contributor
gmaxwell commented Sep 6, 2020

The change to permissions isn't a terminology change its an important change in functionality which has been slowly progressing for years.

One of the original motivations for the whitelisting support was selectively bypassing banning/disconnection logic instead of doing so for everything localhost so you could be sure your own stuff didn't get banned without losing your protections towards Tor peers.

But then armory was kind of broken and depended on its host node relaying its transactions no matter what and whitelisting (even by the time it was originally merged) gained the property of force relaying everything that the whitelisted peer sent. But actually made whitelist mostly unusable for the original purpose, because if you whitelisted ordinary nodes the whitelisting node would start spamming the crap out of other peers with redundant broadcasts. (it would even cause you to relay invalid transactions for a while and get yourself banned by other peers if any were sent to you from a whitelisted peer)

And so the tension has continued throughout all of whitelist's life: people keep wanting to defeat some protection or limiter selectively for particular trusted peers or test harnessses, but then binning that same behaviour change in with all other whitelisted behaviour changes breaks your ability to use whitelisting for some other purpose where that particular behaviour change is highly undesirable. The only solution is to replace whitelisting with granular properties which can be applied on a connection-by-connection basis.

@luke-jr luke-jr force-pushed the deprecate_whitelisted branch from 531198b to 9887153 Compare September 12, 2020 17:42
@luke-jr
Copy link
Member Author
luke-jr commented Sep 12, 2020

Don't like the precedent for arbitrary style rules overriding readability, but regardless..

Both changes made.

@maflcko
Copy link
Member
maflcko commented Sep 20, 2020

re-ACK 9887153

@jnewbery
Copy link
Contributor

utACK 9887153 but needs rebase

@maflcko
Copy link
Member
maflcko commented Oct 14, 2020

@luke-jr Would be good to get this into the next release. I am happy to pick up and rebase, if you don't get around to it

@luke-jr
Copy link
Member Author
luke-jr commented Oct 14, 2020

Rebased

@@ -59,7 +59,7 @@ def run_test(self):

self.log.info('Check that txs from peers with relay-permission are not rejected and relayed to others')
self.log.info("Restarting node 0 with relay permission and blocksonly")
self.restart_node(0, ["-persistmempool=0", "-whitelist=relay@127.0.0.1", "-blocksonly"])
self.restart_node(0, ["-persistmempool=0", "-whitelist=relay@127.0.0.1", "-blocksonly", '-deprecatedrpc=whitelisted'])
Copy link
Member

Choose a reason for hiding this comment

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

This change doesn't seem to be needed, e.g. the test doesn't fail without it unless you also assert on the whitelist field (in which case, use double quotes like the other args in this line).

Copy link
Member

Choose a reason for hiding this comment

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

The whitelist field has been asserted on before the rebase, so this is probably an unsolved silent conflict

@laanwj
Copy link
Member
laanwj commented Oct 15, 2020

ACK 5b57dc5
(apart from @jonatack nit)

@maflcko
Copy link
Member
maflcko commented Oct 15, 2020

The test can be adjusted after feature freeze

@maflcko maflcko merged commit 560dea9 into bitcoin:master Oct 15, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 16, 2020
…(replaced by "permissions")

5b57dc5 RPC: getpeerinfo: Wrap long help line for bytesrecv_per_msg (Luke Dashjr)
d681a28 RPC: getpeerinfo: Deprecate "whitelisted" field (replaced by "permissions") (Luke Dashjr)

Pull request description:

  If we were going to continue support for "whitelisted", we should have probably made it true if any permission flag was set, rather than only if "default permissions" were used.

  This corrects the description, and deprecates it.

ACKs for top commit:
  laanwj:
    ACK 5b57dc5

Tree-SHA512: a2e2137f8be8110357c1b2fef2c923fa8c7c4a49b0b2b3a2d78aedf12f8ed5cc7e140018a21b37e6ec7770ed4007542aeef7ad4558973901b107e8e0f81d6003
@amitiuttarwar
Copy link
Contributor

I didn't see a release note for this change, so I added some to the wiki

The getpeerinfo RPC no longer returns the whitelisted field by default. This field will be fully removed in the next major release. It can be accessed with the configuration option -deprecatedrpc=getpeerinfo_whitelisted. However, it is recommended to instead use the permissions field to understand if specific privileges have been granted to the peer. (#19770)

please let me know (or edit the wiki) if I've miscommunicated anything

Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 24, 2021
…ions")

Summary:
> If we were going to continue support for "whitelisted", we should have probably made it true if any permission flag was set, rather than only if "default permissions" were used.
>
> This corrects the description, and deprecates it.

This is a backport of [[bitcoin/bitcoin#19770 | core#19770]]

Release notes are from  https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

0