Skip to content

Un-color the scammers warning when using testnet. - #387

Closed
katesalazar wants to merge 4 commits into
bitcoin-core:masterfrom
katesalazar:20210728
Closed

katesalazar wants to merge 4 commits into
bitcoin-core:masterfrom
katesalazar:20210728

Conversation

@katesalazar

Copy link
Copy Markdown

If scammers are active, telling users to type commands in the console, stealing their testnet wallet contents, maybe someone can send them some more testnet coins.

Comment thread src/qt/rpcconsole.cpp Resolved
Comment thread src/qt/rpcconsole.cpp Outdated
"%7WARNING: Scammers have been active, telling users to type"
" commands here, stealing their wallet contents. Do not use this console"
" without fully understanding the ramifications of a command.%8")
.arg(gArgs.GetChainName() == CBaseChainParams::TESTNET ? "<span>" : "<span class=\"secwarning\">",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wonder if it would make sense to the secwarning style to NetworkStyle instead of hardcoding a comparison to testnet here. The idea of that class is to make network-specific style data-driven.

This comment was marked as off-topic.

DISCLAIMER: ATTOW THIS ISN'T LEAK CHECKED.

laanwj wrote:

    I think this should be %1 not %7 (and %2 instead of %8 below) now
    that it is split to a separate message?

Yes, I forgot to change that.

laanwj also wrote:

    Wonder if it would make sense to move the secwarning style to
    NetworkStyle instead of hardcoding a comparison to testnet here.
    The idea of that class is to make network-specific style
    data-driven.

IDK / it could be / no strong opinion.
@katesalazar

Copy link
Copy Markdown
Author

Leak bugs, set draft.

@katesalazar

Copy link
Copy Markdown
Author

I'm developing this using a powerful Apple machine, but I'm not familiar with leak debugging on macOS.

I can use Memcheck, but I don't have any decent hardware running Linux.

Would be too much to ask for, to abuse CI as a leak debugger?

@luke-jr luke-jr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Concept NACK. Testnet is for testing. It should be as close to mainnet use as possible. There's no reason to treat it specially here. Even worse, the code for doing it is excessively complex.

@katesalazar

Copy link
Copy Markdown
Author

I can't prove it introduces leak bugs, unset draft.

@katesalazar

Copy link
Copy Markdown
Author

Before merging, if that were the case, 268c302 should be collapsed to 0c85f16 and 0c85f16 should be reworded. Set draft.

@katesalazar

Copy link
Copy Markdown
Author

luke-jr wrote:

Concept NACK. Testnet is for testing. It should be as close to mainnet
use as possible. There's no reason to treat it specially here. Even
worse, the code for doing it is excessively complex.

You make an excellent point in general; but specifically about
complexity, I can't speak for every desktop environment, but today in my
end I'm seeing that red[0] and specially #006060[1]
are much better suited for contrast in Plasma Breeze than in Plasma
Breeze Dark.

Of course maybe Plasma Breeze Dark is broken, IDK, but if so, maybe it
even will be dismantled before it gets ever fixed, but the point here
is... because of recent tendency in user interfaces and specially
increasing demand (or offer?) of dark/light preferences support, you can
stop it today, but it's possible that you might be inevitably going to
have a bit of complexity increase here in the end, in order to support
more precise color schemes.

o/

[0]: https://github.com/bitcoin/bitcoin/blob/da1c0c64fd094880712d1c4167ad9eb3bb6ffcc6/src/qt/rpcconsole.cpp#L849

[1]: https://github.com/bitcoin/bitcoin/blob/da1c0c64fd094880712d1c4167ad9eb3bb6ffcc6/src/qt/rpcconsole.cpp#L848

@achow101

achow101 commented Aug 4, 2021

Copy link
Copy Markdown
Member

NACK

This change is not well motivated. I see no reason to add extra complexity for a color change that has no real effect on users.

If the problem is that the colors don't work in certain environments, then a more general change to the color scheme (and perhaps making it more flexible) would be more appropriate than a targeted change to this one specific line of text.

@luke-jr

luke-jr commented Aug 4, 2021

Copy link
Copy Markdown
Contributor

There's definitely work to be done on supporting user themes/palettes, but this isn't the right approach. (Might I suggest reviving and troubleshooting bitcoin/bitcoin#8889 as a good place to start? ;)

@hebasto hebasto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NACK for the reasons mentioned above by @luke-jr and @achow101.

Comment thread src/qt/rpcconsole.cpp
Comment on lines -856 to -858
/*: RPC console welcome message.
Placeholders %7 and %8 are style tags for the warning content, and
they are not space separated from the rest of the text intentionally. */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is this removed?

This comment was marked as off-topic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is useless comment, as 'welcome message' is already the name of the string, and 'RPC console' is already the name of the class.

This is a translator comment dedicated to provide a context to translators on Transifex.com.

This comment was marked as off-topic.

@hebasto

hebasto commented Aug 7, 2021

Copy link
Copy Markdown
Member

This PR looks pretty controversial: 1 Concept NACK, 2 NACKs.

Going to close it.

@hebasto hebasto added the Design label Aug 7, 2021
@jarolrod

Copy link
Copy Markdown
Contributor

I am concept NACK on this, not worth added complexity or effort

@hebasto

hebasto commented Aug 10, 2021

Copy link
Copy Markdown
Member

Closing for now.

@hebasto hebasto closed this Aug 10, 2021
@laanwj

laanwj commented Aug 10, 2021

Copy link
Copy Markdown
Member

I like the general idea of making the network style contribute part of the style sheet as way of accomplishing this. I think this is much better than the initial implementation, which, though simple, hardcoded the network matching in an ad hoc way.

Whether the change itself is worth it I don't know. Highlighting the scam warning on testnet doesn't really hurt.

@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants