Skip to content

backport: Merge bitcoin#26642, 27344, gui#726, 27465, 26207, 27468#7390

Open
vijaydasmp wants to merge 5 commits into
dashpay:developfrom
vijaydasmp:July_2026_5
Open

backport: Merge bitcoin#26642, 27344, gui#726, 27465, 26207, 27468#7390
vijaydasmp wants to merge 5 commits into
dashpay:developfrom
vijaydasmp:July_2026_5

Conversation

@vijaydasmp

Copy link
Copy Markdown

bitcoin back ports

fanquake added 2 commits June 28, 2026 19:34
…related fixes

03ec5b6 clang-tidy: Exclude `performance-*` checks rather including them (Hennadii Stepanov)
2400437 clang-tidy: Add `performance-type-promotion-in-math-fn` check (Hennadii Stepanov)
7e975e6 clang-tidy: Add `performance-inefficient-vector-operation` check (Hennadii Stepanov)
516b75f clang-tidy: Add `performance-faster-string-find` check (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  martinus:
    ACK 03ec5b6
  TheCharlatan:
    re-ACK [03ec5b6](bitcoin@03ec5b6)

Tree-SHA512: 2dfa52f9131da88826f32583bfd534a56a998477db9804b7333c0e7ac0b6b36141009755c7163b9f95d0ecbf5c2cb63f8a69ce4b114bb83423faed21b50cec67
faf8dc4 fuzz: Remove legacy int parse fuzz tests (MarcoFalke)

Pull request description:

  The fuzz tests checked that the result of the new function was equal to the legacy function. (Side note: The checks were incomplete, as evident by the follow-up fix in commit b5c9bb5).

  Given that they haven't found any issues in years (beside missing the above issue, that they couldn't catch), it seems time to remove them.

  They may come in handy in the rare case that someone would want to modify `LocaleIndependentAtoi()` or `Parse*Int*()`, however that seems unlikely. Also, appropriate checks can be added then.

ACKs for top commit:
  fanquake:
    ACK faf8dc4
  dergoegge:
    ACK faf8dc4

Tree-SHA512: 4ec88b9fa8ba49a923b0604016f0f471b3c9b9e0ba6c5c3dc4e20503c6994789921e7221d9ec467a2a37a73f21a70ba51ba3370ed5ad311dee989e218290b29a
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

⚠️ Potential Merge Conflicts Detected

This PR has potential conflicts with the following open PRs:

Please coordinate with the authors of these PRs to avoid merge conflicts.

@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#26642, 27344 backport: Merge bitcoin#26642, 27344, gui#726, 27465, 26207, 27468 Jun 28, 2026
fanquake and others added 3 commits June 29, 2026 13:11
f24f4fa Update developer-notes.md (Riahiamirreza)

Pull request description:

ACKs for top commit:
  fanquake:
    ACK f24f4fa

Tree-SHA512: 10301170dff6f2f7b47a229ba99f4a4f4953c361be24996b6dc70343ad118879cd90ebb54d78cd31c852f577fb17f9726582fdd02ed5b6fd7b71566942e8b408
…ams for mempool/contents

1ff5d61 doc: add mempool/contents rest verbose and mempool_sequence args (Andrew Toth)
52a31dc tests: mempool/contents verbose and mempool_sequence query params tests (Andrew Toth)
a518fff rest: add verbose and mempool_sequence query params for mempool/contents (Andrew Toth)

Pull request description:

  The verbose mempool json response can get very large. This adds an option to return the non-verbose response of just the txids. It is identical to the rpc response so the diff here is minimal. This also adds the mempool_sequence parameter for rpc consistency. Verbose defaults to true to remain backwards compatible.

  It uses query parameters to be compatible with the efforts in bitcoin#25752.

ACKs for top commit:
  achow101:
    ACK 1ff5d61
  stickies-v:
    re-ACK [1ff5d61](bitcoin@1ff5d61)
  pablomartin4btc:
    tested ACK 1ff5d61.

Tree-SHA512: 1bf08a7ffde2e7db14dc746e421feedf17d84c4b3f1141e79e36feb6014811dfde80e1d8dbc476c15ff705de2d3c967b3081dcd80536d76b7edf888f1a92e9d1
11422cc bugfix: rest: avoid segfault for invalid URI (pablomartin4btc)

Pull request description:

  Minimal fix to get it promptly into 25.0 release (suggested by  [stickies-v](bitcoin#27253 (review)) and supported by [vasild](bitcoin#27253 (review))  )

  Please check bitcoin#27253 for reviewers comments and acks regarding this PR and read the commit comment message body for more details about the fix.

ACKs for top commit:
  achow101:
    ACK 11422cc
  stickies-v:
    re-ACK 11422cc

Tree-SHA512: 5af6b53fb266a12b463f960910556d5e97bc88b3c2a4f437ffa343886b38749e1eb058cf7bc64d62e82e1acf6232a186bddacd8f3b4500c87bf9e550a0153386
@vijaydasmp vijaydasmp marked this pull request as ready for review July 4, 2026 18:25
@thepastaclaw

thepastaclaw commented Jul 4, 2026

Copy link
Copy Markdown

✅ Review complete (commit 0e96447)

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR adds verbose and mempool_sequence query parameters to the REST mempool contents endpoint with validation, wraps count parameter parsing in try/catch across REST handlers, makes httpserver.cpp throw on failed URI parsing (with matching unit/functional tests), removes a legacy numeric-parsing compatibility layer from the string fuzz target, and applies numerous std::vector::reserve() preallocation additions across production and test code, plus minor literal-to-character search changes and documentation/config wording updates.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant RestHandler as rest_mempool
  participant MempoolToJSON

  Client->>RestHandler: GET /rest/mempool/contents.json?verbose&mempool_sequence
  RestHandler->>RestHandler: parse/validate query params
  alt invalid or conflicting params
    RestHandler-->>Client: HTTP_BAD_REQUEST
  else valid params
    RestHandler->>MempoolToJSON: verbose, mempool_sequence
    MempoolToJSON-->>RestHandler: JSON result
    RestHandler-->>Client: JSON response
  end
Loading
sequenceDiagram
  participant Client
  participant HTTPServer as httpserver.cpp
  participant evhttp_uri_parse

  Client->>HTTPServer: request with invalid URI
  HTTPServer->>evhttp_uri_parse: parse(uri)
  evhttp_uri_parse-->>HTTPServer: nullptr
  HTTPServer-->>Client: throw std::runtime_error / HTTP 400
Loading

Suggested reviewers: thepastaclaw, knst, PastaPastaPasta

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is related to the changeset, but it is too generic to convey meaningful detail. Replace it with a brief summary of the backported fixes, such as REST changes, lint updates, and fuzz test cleanup.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects that this is a backport merge of specific Bitcoin PRs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/rest.cpp (1)

656-679: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate boolean-parsing boilerplate for verbose/mempool_sequence.

The two query-parameter blocks (fetch → validate "true"/"false" → 400 on error) are structurally identical aside from the parameter name and default. Extracting a small helper (e.g. ParseBoolQueryParam(req, name, default) -> std::optional<bool-or-error>) would remove duplication and make future boolean query params easier to add.

♻️ Example helper sketch
+static util::Result<bool> GetBoolQueryParam(HTTPRequest* req, const std::string& name, bool default_value)
+{
+    std::string raw;
+    try {
+        raw = req->GetQueryParameter(name).value_or(default_value ? "true" : "false");
+    } catch (const std::runtime_error& e) {
+        return util::Error{Untranslated(e.what())};
+    }
+    if (raw != "true" && raw != "false") {
+        return util::Error{Untranslated(strprintf("The \"%s\" query parameter must be either \"true\" or \"false\".", name))};
+    }
+    return raw == "true";
+}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/rest.cpp` around lines 656 - 679, The `verbose` and `mempool_sequence`
query-parameter handling in `src/rest.cpp` duplicates the same
fetch/validate/400-error flow twice. Refactor this into a small reusable helper
near the request parsing logic used by `MempoolToJSON`, so both parameters are
parsed through one path that accepts the parameter name and default, validates
only "true"/"false", and returns the boolean value or error consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/rest.cpp`:
- Around line 656-679: The `verbose` and `mempool_sequence` query-parameter
handling in `src/rest.cpp` duplicates the same fetch/validate/400-error flow
twice. Refactor this into a small reusable helper near the request parsing logic
used by `MempoolToJSON`, so both parameters are parsed through one path that
accepts the parameter name and default, validates only "true"/"false", and
returns the boolean value or error consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 120e3388-19ce-4e35-8597-bf0c5d9aabb8

📥 Commits

Reviewing files that changed from the base of the PR and between 4af395d and 0e96447.

📒 Files selected for processing (31)
  • ci/dash/lint-tidy.sh
  • doc/REST-interface.md
  • doc/developer-notes.md
  • src/.clang-tidy
  • src/bench/lockedpool.cpp
  • src/bitcoin-cli.cpp
  • src/bitcoin-util.cpp
  • src/httpserver.cpp
  • src/node/interfaces.cpp
  • src/qt/trafficgraphwidget.cpp
  • src/rest.cpp
  • src/rpc/server.cpp
  • src/rpc/util.cpp
  • src/test/allocator_tests.cpp
  • src/test/fuzz/string.cpp
  • src/test/fuzz/tx_pool.cpp
  • src/test/getarg_tests.cpp
  • src/test/httpserver_tests.cpp
  • src/test/policyestimator_tests.cpp
  • src/test/scheduler_tests.cpp
  • src/test/script_p2sh_tests.cpp
  • src/test/util/net.cpp
  • src/test/util_threadnames_tests.cpp
  • src/test/validation_block_tests.cpp
  • src/util/bip32.cpp
  • src/wallet/bdb.cpp
  • src/wallet/rpc/backup.cpp
  • src/wallet/scriptpubkeyman.cpp
  • src/zmq/zmqpublishnotifier.cpp
  • test/functional/interface_rest.py
  • test/lint/lint-locale-dependence.py
💤 Files with no reviewable changes (1)
  • test/lint/lint-locale-dependence.py

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

I verified the two parsed Codex findings against the checked-out PR. The REST docs still carry Bitcoin Core's "25.0 and up" release note even though this Dash tree is versioned as 23.1.5, so that is a real in-scope documentation issue. The GUI provenance claim does not hold: the trafficgraphwidget change is part of the listed upstream bitcoin#26642 commit, while bitcoin-core/gui#726 is a different AddressPurpose change.

💬 1 nitpick(s)

Source: reviewers: gpt-5.5 (general, dash-core-commit-history); failed lanes: opus/claude-sonnet-5 (general, dash-core-commit-history, backport-reviewer), gpt-5.5 (backport-reviewer); verifier: gpt-5.5.

Comment thread doc/REST-interface.md
Refer to the `getrawmempool` RPC help for details. Defaults to setting
`verbose=true` and `mempool_sequence=false`.

*Query parameters for `verbose` and `mempool_sequence` available in 25.0 and up.*

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Nitpick: Remove Bitcoin Core release number from Dash REST docs

This note was copied from the Bitcoin Core backport and says the new verbose and mempool_sequence query parameters are available in 25.0 and up. This is Dash Core documentation, and this PR is based on a Dash tree reporting version 23.1.5 in configure.ac, so the Bitcoin Core release number is misleading for Dash users trying to determine which Dash release contains /rest/mempool/contents.json?verbose=...&mempool_sequence=.... Adapt the sentence to the Dash release that will ship this backport, or remove the version-specific sentence.

source: ['codex']

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.

4 participants