-
Notifications
You must be signed in to change notification settings - Fork 276
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
Add copy IP/Netmask action for banned peer #384
Conversation
Concept ACK.
But on the screenshot a menu item is called "Copy Address". Which variant is correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
Looking good, one note: https://github.com/bitcoin-core/gui/pull/384/files#r673396366
@ShaMan239 And warm welcome as a new contributor 🎆 |
Thank You very much @hebasto |
Updated from c56e082 -> d518d67 (pr384.01 -> pr384.02)
Sorry, this is now addressed. |
Concept ACK. I think "Copy address" should be added to connected peers list's context menu too, both for consistency and usefulness. |
Concept ACK I will be curious to see how "Copy subnet" translates. I lean toward simply "Copy". It would be great to link a key command to the action as well - such as <control> + c maybe? |
That's a valid concern. Maybe we can add additional context to the translator comment stating that the subnet is a combination of its |
If the translator comment will be touched, please, end it with a full stop / period. Disclaimer: I'm a translator to Ukrainian :) |
7c21de2
to
32b4a54
Compare
updated from 7c21de2 -> 32b4a54 (pr384.02 -> pr384.03) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 32b4a54
Tested on macOS 11.3. Banned a peer, then was able to successfully copy the Peer's subnet by using the new Copy subnet
context menu action.
The new translator comment looks good to me. I think the additional context behind it's meaning and a possible alternative will help with any translator confusion.
tACK 32b4a54 Tested on macOS 10.15.7 |
Tested 32b4a54 I tried to build the PR on Although I had two doubts about the functionality and the use-case mentioned for the added feature.
In case I understood the use-case wrongly, would appreciate it if you'd correct me. Happy Coding! |
Thank you for addressing these doubts. Let me try to answer them one by one:
|
Hello @ShaMan239 Appreciate you clearing my doubts and concerns 🙌🏻
I'd like to suggest something maybe you could add to make the use-case mentioned even better.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "Copy address" should be added to connected peers list's context menu too, both for consistency and usefulness.
Yes, I guess it is an improvement in terms of accessibility (that is why I concept ACKed this pr).
OTOH, such changes open a door for prs that suggest to add a "Copy some_another_fancy_column_content" into the context menus. It could ends with ugly bloated menus.
I don't think the use cases discussed above are a good practice for the following reasons:
- for an attacker it is easy and cheap to switch to another IP address in another subnet, and it seems unfeasible to track attacker manually
- aggressive banning (I believe it is the case when we use
setban
RPC call) increases the risk of splitting the network
src/qt/rpcconsole.cpp
Outdated
/*: Context menu action to copy the subnet of a banned peer. | ||
Subnet is the combination of a peer's IP address and it's Netmask. | ||
Depending on the language, the translation of 'IP address' can be subbed in for subnet. */ | ||
banTableContextMenu->addAction(tr("&Copy subnet"), [this] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "XXX" in "Copy XXX" menu action match a header title of the column?
I think that in the scope of this PR it should. While the combination of IP and Netmask is called subnet in other parts of the code, the column header here is 'IP/Netmask For now lets keep the same name as in the header. If there is valid motivation to rename this header to For now lets rename this action to |
src/qt/rpcconsole.cpp
Outdated
@@ -706,6 +706,14 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_ | |||
|
|||
// create ban table context menu | |||
banTableContextMenu = new QMenu(this); | |||
/*: Context menu action to copy the IP/Netmask of a banned peer. | |||
IP/Netmask is the combination of a peer's IP address and it's Netmask. | |||
For IP Address see: https://en.wikipedia.org/wiki/Subnetwork |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is similar to what was done in #332, see: https://github.com/bitcoin-core/gui/pull/332/files#diff-fe41db46679f280131a7b0a04d39383dd4d0ab623cec8de8ddc74f79b163dabfR285
But, is this an appropriate link for more information on IP Address
? What about: https://en.wikipedia.org/wiki/IP_address
tACK a52f72f tested on Ubuntu 20.04 and macOS 12. PR works as intended. Translator comments look good to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ec43933
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK ec43933
nice work! 🥃
This adds a copy IP/Netmask context menu action for peers in the banned peer table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re-ACK ab1461d, tested on Linux Mint 20.2 (Qt 5.12.8).
re-ACK ab1461d Only change since last review is update to translator comment and update to the commit message. |
ab1461d qt: Add copy IP/Netmask action for banned peer (Shashwat) Pull request description: This PR adds a Copy IP/Netmask context menu action to the Banned Peers Table. This feature is helpful if a node using GUI might want to alert its peer about a particular malicious user. So it can copy that user’s IP/Netmask and broadcast it to its peers so they can ban it instantly using the setban command in the console. | Master | PR | | ----------- | ----------- | | ![Screenshot_from_2021-07-21_00-01-331](https://user-images.githubusercontent.com/23396902/126377808-bd23bb19-3f47-4f1b-8371-39baa9747bbe.png) | ![Screenshot from 2021-08-20 20-13-28(1)(1)](https://user-images.githubusercontent.com/85434418/130251441-a8d0f816-a2e9-4e63-a22d-94885c5cec98.png) | ACKs for top commit: jarolrod: re-ACK ab1461d hebasto: re-ACK ab1461d, tested on Linux Mint 20.2 (Qt 5.12.8). Tree-SHA512: a528f089bd4cb5b51fec987550d21c2587459ad80f854b55850bc62c776c21f3fa31052a17e2b0e9e9d0b3468799c8070ed306543730fb7b324f283847151e17
This PR adds a Copy IP/Netmask context menu action to the Banned Peers Table.
This feature is helpful if a node using GUI might want to alert its peer about a particular malicious user. So it can copy that user’s IP/Netmask and broadcast it to its peers so they can ban it instantly using the setban command in the console.