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? |
jarolrod
left a comment
There was a problem hiding this comment.
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) |
jarolrod
left a comment
There was a problem hiding this comment.
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.
|
hebasto
left a comment
There was a problem hiding this comment.
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
setbanRPC call) increases the risk of splitting the network
| /*: 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.
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 |
| 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.
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 |
This adds a copy IP/Netmask context menu action for peers in the banned peer table
|
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 | | ----------- | ----------- | |  |  | 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.