rpcconsole: display signet challenge #896

pull RandyMcMillan wants to merge 2 commits into bitcoin-core:master from bitcoincore-dev:pr/1919/916101/674094/b4aa9f5f7b1/eb918d0c31d-rpcconsole-signet-challenge changing 8 files +113 −14
  1. RandyMcMillan commented at 0:13 am on September 24, 2025: contributor
  2. DrahtBot commented at 0:13 am on September 24, 2025: contributor

    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.

  3. RandyMcMillan commented at 0:15 am on September 24, 2025: contributor

    display an elided signet challenge

  4. hebasto commented at 10:27 am on September 25, 2025: member
    cc @Sjors
  5. in src/qt/rpcconsole.cpp:744 in 6d15f90d04
    739+            std::string challengeString = challengeToString(vChallenge);
    740+            std::string challenge_start = challengeString.substr(0, 8);
    741+            std::string challenge_end = challengeString.substr(challengeString.length() - 8);
    742+
    743+            ui->networkName->setText(
    744+                tr("Signet: (%1...%2)").arg(
    


    luke-jr commented at 10:42 am on September 25, 2025:
    Might be a better way to elide the middle so that a copy/paste gets the full string?

    RandyMcMillan commented at 8:42 pm on September 25, 2025:
    Testing a proper Qt interface for better formatting now.
  6. in src/util/strencodings.cpp:386 in 357f7d423a outdated
    382@@ -383,6 +383,25 @@ std::string Capitalize(std::string str)
    383     return str;
    384 }
    385 
    386+std::string ChallengeToStdString(const std::vector<uint8_t>& v)
    


    RandyMcMillan commented at 8:49 pm on September 25, 2025:
    move ChallengeToStdString to src/util/strencodings.cpp for later availability in main window.
  7. in src/qt/rpcconsole.cpp:615 in a87484caef outdated
    611@@ -612,22 +612,6 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event)
    612     return QWidget::eventFilter(obj, event);
    613 }
    614 
    615-std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)
    


    RandyMcMillan commented at 8:50 pm on September 25, 2025:
    removed std::string RPCConsole::challengeToString(const std::vector<uint8_t>& v)

    RandyMcMillan commented at 11:46 pm on September 25, 2025:
    squash later
  8. RandyMcMillan commented at 8:51 pm on September 25, 2025: contributor

    added “trivial challenge” support per signet implementation.

  9. RandyMcMillan commented at 8:54 pm on September 25, 2025: contributor

    handle long challenges with proper elision and text flow.

  10. RandyMcMillan commented at 8:55 pm on September 25, 2025: contributor
    common length challenges elide and flow correctly.
  11. pablomartin4btc commented at 9:13 pm on September 25, 2025: contributor

    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().

  12. RandyMcMillan commented at 9:17 pm on September 25, 2025: contributor

    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 https://github.com/bitcoin/bitcoin/pull/29838

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

  13. RandyMcMillan commented at 9:21 pm on September 25, 2025: contributor
    also trying to treat the challenge as a fingerprint - avoiding clutter in the title but the rcpconsole formatting ought to look ok.
  14. RandyMcMillan force-pushed on Sep 25, 2025
  15. RandyMcMillan commented at 11:36 pm on September 25, 2025: contributor
    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
  16. RandyMcMillan commented at 11:37 pm on September 25, 2025: contributor
    tooltip displays challenge (even if obfuscated in rpcconsole)
  17. RandyMcMillan commented at 11:38 pm on September 25, 2025: contributor
    when default signet_challenge detected:
  18. RandyMcMillan commented at 11:39 pm on September 25, 2025: contributor

    when common length signet_challenge:

  19. in src/qt/rpcconsole.h:87 in cf15f7cc3c outdated
    83@@ -84,7 +84,6 @@ class RPCConsole: public QWidget
    84     virtual bool eventFilter(QObject* obj, QEvent *event) override;
    85     void keyPressEvent(QKeyEvent *) override;
    86     void changeEvent(QEvent* e) override;
    87-    std::string challengeToString(const std::vector<uint8_t>& v);
    


    RandyMcMillan commented at 11:46 pm on September 25, 2025:
    squash later
  20. in src/qt/rpcconsole.cpp:61 in 5f06fbbcb2 outdated
    56@@ -57,6 +57,9 @@ const int INITIAL_TRAFFIC_GRAPH_MINS = 30;
    57 const QSize FONT_RANGE(4, 40);
    58 const char fontSizeSettingsKey[] = "consoleFontSize";
    59 
    60+const std::string DEFAULT_CHALLENGE_STRING =
    61+    "512103AD5E0EDAD18CB1F0FC0D28A3D4F1F3E445640337489ABB10404F2D1E086BE430210359EF5021964FE22D6F8E05B2463C9540CE96883FE3B278760F048F5189F2E6C452AE";
    


    RandyMcMillan commented at 11:48 pm on September 25, 2025:
    maybe a global constant?
  21. in src/qt/rpcconsole.h:239 in 5f06fbbcb2 outdated
    234+        QLabel::resizeEvent(event);
    235+        recalculateElidedText();
    236+    }
    237+
    238+    // Provide the full challenge when Copy&Paste
    239+    QMimeData* createMimeDataFromSelection() const {
    


    RandyMcMillan commented at 11:56 pm on September 25, 2025:
    the full challenge should be copy and pasted - please test cc: @luke-jr @pablomartin4btc
  22. RandyMcMillan force-pushed on Sep 26, 2025
  23. RandyMcMillan force-pushed on Sep 26, 2025
  24. RandyMcMillan commented at 4:13 pm on September 26, 2025: contributor
    use HexStr() per pablomartin4btc suggestion use lower case DEFAULT_CHALLENGE_STRING for comparison
  25. RandyMcMillan force-pushed on Sep 26, 2025
  26. RandyMcMillan force-pushed on Sep 27, 2025
  27. ci: Turn centos config into alpine musl config a7646e12c4
  28. rpcconsole:display signet_challenge 0496ce5dbe
  29. RandyMcMillan force-pushed on Sep 28, 2025
  30. RandyMcMillan commented at 4:09 pm on September 28, 2025: contributor

    rebase on top of gui/master

    temporarily cherry-pick PR https://github.com/bitcoin/bitcoin/pull/33480 to fix an issue.

  31. DrahtBot added the label Needs rebase on Oct 15, 2025
  32. DrahtBot commented at 11:51 am on October 15, 2025: contributor
    🐙 This pull request conflicts with the target branch and needs rebase.

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-18 14:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me