Skip to content

Conversation

RandyMcMillan
Copy link
Contributor

No description provided.

@DrahtBot
Copy link
Contributor

DrahtBot commented Sep 24, 2025

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

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@RandyMcMillan
Copy link
Contributor Author

display an elided signet challenge

Screenshot 2025-09-23 at 6 51 46 PM

@hebasto
Copy link
Member

hebasto commented Sep 25, 2025

cc @Sjors

std::string challenge_end = challengeString.substr(challengeString.length() - 8);

ui->networkName->setText(
tr("Signet: (%1...%2)").arg(
Copy link
Member

Choose a reason for hiding this comment

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

Might be a better way to elide the middle so that a copy/paste gets the full string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Testing a proper Qt interface for better formatting now.

return str;
}

std::string ChallengeToStdString(const std::vector<uint8_t>& v)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move ChallengeToStdString to src/util/strencodings.cpp for later availability in main window.

return QWidget::eventFilter(obj, event);
}

std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)

@RandyMcMillan
Copy link
Contributor Author

added "trivial challenge" support per signet implementation.

Screenshot 2025-09-25 at 4 47 29 PM

@RandyMcMillan
Copy link
Contributor Author

handle long challenges with proper elision and text flow.

Screenshot 2025-09-25 at 4 24 29 PM

@RandyMcMillan
Copy link
Contributor Author

common length challenges elide and flow correctly.
Screenshot 2025-09-25 at 4 25 50 PM

Copy link
Contributor

@pablomartin4btc pablomartin4btc left a comment

Choose a reason for hiding this comment

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

It would be good to put the label "challenge:" in both the info tab and the title, and also differentiate between the default challenge and the custom one (specified by -signetchallenge=). With this in mind perhaps when there's no custom challenge specified we don't update the window title but only the info tab ("Name: Signet (challenge: 512103ad...e6c452ae, default)" or something like that).

For the conversion you can use HexStr() instead of ChallengeToStdString().

@RandyMcMillan
Copy link
Contributor Author

It would be good to put the label "challenge:" in both the info tab and the title, and also differentiate between the default challenge and the custom one (specified by -signet_challenge). With this in mind perhaps when there's no custom challenge specified we don't update the window title but only the info tab ("Name: Signet (challenge: 512103ad...e6c452ae, default)" or something like that).

For the conversion you can use HexStr() instead of ChallengeToStdString().

i was thinking a long the same lines.

I will test against bitcoin/bitcoin#29838

and make a decision - trying to avoid a conflict. :)

@RandyMcMillan
Copy link
Contributor Author

also trying to treat the challenge as a fingerprint - avoiding clutter in the title but the rcpconsole formatting ought to look ok.

@RandyMcMillan RandyMcMillan force-pushed the pr/1919/916101/674094/b4aa9f5f7b1/eb918d0c31d-rpcconsole-signet-challenge branch from d166b3b to 5f06fbb Compare September 25, 2025 23:32
@RandyMcMillan
Copy link
Contributor Author

RandyMcMillan commented Sep 25, 2025

fixed typo and commit scope
add Network Name with Challenge on new line per @pablomartin4btc feed back
Challenge Copy&Paste-able from gui per @luke-jr feed back
Detect Default signet_challenge and display "Default"
Removed parenthesis in rpcconsole panel, keep in title

@RandyMcMillan
Copy link
Contributor Author

tooltip displays challenge (even if obfuscated in rpcconsole)
Screenshot 2025-09-25 at 7 25 34 PM

@RandyMcMillan
Copy link
Contributor Author

when default signet_challenge detected:
Screenshot 2025-09-25 at 7 23 29 PM

@RandyMcMillan
Copy link
Contributor Author

when common length signet_challenge:

Screenshot 2025-09-25 at 7 22 52 PM

return QWidget::eventFilter(obj, event);
}

std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

squash later

virtual bool eventFilter(QObject* obj, QEvent *event) override;
void keyPressEvent(QKeyEvent *) override;
void changeEvent(QEvent* e) override;
std::string challengeToString(const std::vector<uint8_t>& v);
Copy link
Contributor Author

@RandyMcMillan RandyMcMillan Sep 25, 2025

Choose a reason for hiding this comment

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

squash later

const char fontSizeSettingsKey[] = "consoleFontSize";

const std::string DEFAULT_CHALLENGE_STRING =
"512103AD5E0EDAD18CB1F0FC0D28A3D4F1F3E445640337489ABB10404F2D1E086BE430210359EF5021964FE22D6F8E05B2463C9540CE96883FE3B278760F048F5189F2E6C452AE";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

maybe a global constant?

}

// Provide the full challenge when Copy&Paste
QMimeData* createMimeDataFromSelection() const {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the full challenge should be copy and pasted - please test
cc: @luke-jr @pablomartin4btc

@RandyMcMillan RandyMcMillan force-pushed the pr/1919/916101/674094/b4aa9f5f7b1/eb918d0c31d-rpcconsole-signet-challenge branch 2 times, most recently from f358239 to f4bc05a Compare September 26, 2025 16:11
@RandyMcMillan
Copy link
Contributor Author

RandyMcMillan commented Sep 26, 2025

use HexStr() per pablomartin4btc suggestion
use lower case DEFAULT_CHALLENGE_STRING for comparison

@RandyMcMillan RandyMcMillan force-pushed the pr/1919/916101/674094/b4aa9f5f7b1/eb918d0c31d-rpcconsole-signet-challenge branch 2 times, most recently from 7d81eb3 to f9e77ca Compare September 27, 2025 19:38
@RandyMcMillan RandyMcMillan force-pushed the pr/1919/916101/674094/b4aa9f5f7b1/eb918d0c31d-rpcconsole-signet-challenge branch from c5b9f67 to 0496ce5 Compare September 28, 2025 16:06
@RandyMcMillan
Copy link
Contributor Author

RandyMcMillan commented Sep 28, 2025

rebase on top of gui/master

temporarily cherry-pick PR bitcoin/bitcoin#33480 to fix an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants