Repository navigation
fix(rest): don't terminate on blocks with undecodable ProTx payloads - #8099
PastaPastaPasta merged 1 commit into
Conversation
Pre-merge checks:
|
|
✅ Final review complete — no blockers (commit 9560439) |
Unsupported provider transaction versions can deserialize without network information. Omit their optional decoded payload objects instead of letting JSON rendering throw through the REST block handler, and retain the raw payload bytes. Co-Authored-By: GPT 6.1 Sol <noreply@openai.com>
f1aa98d to
9560439
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
At head 9560439, the rendering guards correctly prevent unsupported ProRegTx and ProUpServTx payloads from reaching null-netInfo checks, while preserving raw payload output and leaving validation unchanged. No correctness blockers were found; the only retained finding is a missing release note for the REST crash fix and changed malformed-payload output. This was a static review: current CI reports successful build, test, lint, formatting and cppcheck jobs, with only the automated review pending.
💬 1 nitpick(s)
Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — The diff is a small, contained rendering guard in TxToUniv with focused regression tests and does not change validation, deserialization, or consensus rules. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 93% left, weekly 85% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort medium); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `src/core_write.cpp`:
- [NITPICK] src/core_write.cpp:291-297: Document the REST crash fix and malformed-payload output
Add doc/release-notes-8099.md describing the REST node-termination fix and the corresponding RPC/REST output behavior: unsupported ProRegTx and ProUpServTx payloads retain extraPayload but omit the decoded proRegTx or proUpServTx object. This is a significant user-visible bug fix, and doc/developer-notes.md explicitly calls for release notes for significant fixes and API-visible changes. No release-note entry for this change is present.
…able ProTx payloads 9560439 fix: skip undecoded provider payloads in transaction JSON (pasta) Pull request description: ## Issue being fixed or feature implemented A ProRegTx or ProUpServTx with an unsupported payload version deserializes only its version field and leaves `netInfo` null. `TxToUniv` still treats the payload as decodable and calls `ToJson()`, which hits a `CHECK_NONFATAL` on the null `netInfo`. Over RPC that becomes an internal-bug error, but in `GET /rest/block/<hash>.json` the `NonFatalCheckError` escapes the HTTP worker and `std::terminate`s the node. Such a block can be stored without ever being connected (it is rejected with `bad-protx-version` at connect time), so a REST client could stop a node with `-rest` enabled. ## What was done? `TxToUniv` omits the decoded `proRegTx` / `proUpServTx` object when `netInfo` is unset, the same as it already does for payloads that fail to deserialize. The raw `extraPayload` stays in the output. Rendering of supported versions and all validation are unchanged. No HTTP-wide exception handling was added; the fix is at the rendering step, which covers RPC and REST alike. ## How Has This Been Tested? `interface_rest.py` stores a rejected block with both payload types at versions 0 and 65535 and checks that REST `/block` and `/block/notxdetails`, `getblock`, `decoderawtransaction` and `getrawtransaction` return the transactions with their raw payload and without the decoded object, with and without `-deprecatedrpc=service`, and that the node stays up. On `develop` the REST block request kills the node (`RemoteDisconnected`); with this change it passed three times. `rpc_deprecated.py`, which previously expected the internal-bug error for these payloads, now checks the same successful rendering. `feature_protx_version.py`, `rpc_netinfo.py` and the `evo_netinfo`, `evo_sharedmn`, `evo_dip3_activation`, `evo_simplifiedmns` unit tests pass. ## Breaking Changes None. ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 64c4e1b41ef0006ba07a4bd8dfa972a50165f41a8a1d48454fa9e247f98a2568132459e9aabac98d68bd88cfcc121f4ca683ac3064759ea1e4e04b1068666e4f (cherry picked from commit 6f5e9cf)
78ad074 Merge #8131: fix: wait for a matching superblock trigger before voting NO on the others (merge-script) 6faa5ce Merge #8097: fix: keep governance triggers across a restart on test networks (pasta) 2757e83 Merge #8130: fix: process a node's own DKG messages ahead of queued peer messages (merge-script) cbbee0e Merge #8135: perf: keep verified DKG contributions cached through the commit phase (merge-script) 29a3cdd Merge #8099: fix(rest): don't terminate on blocks with undecodable ProTx payloads (merge-script) 275a142 Merge #8100: fix: don't abort in governance when a reorg changes masternode internal ids (merge-script) d00c4e6 Merge #8104: fix: keep final commitments mineable when their block is rejected (merge-script) b051d3a Merge #8080: test(qt): stop address book tests from answering the shared masternode wizard's prompt (merge-script) ec9e944 Merge #8094: fix(net): stop busy-looping while a peer's send buffer is full (merge-script) 033dae3 Merge #8052: fix(qt): reserve the same shared masternode contribution again after a release (merge-script) 65603d5 Merge #8088: fix: fetch miniupnpc sources from miniupnp.free.fr (merge-script) Pull request description: ## Issue being fixed or feature implemented Backports for v24.0.1, on top of `v24.0.x` at 938fba5 (v24.0.0). v24.0.0 is running on mainnet ahead of the V24 hard fork, and a handful of fixes that landed on develop since the release should not wait for 24.1: a `test_dash-qt` failure that blocks distribution packagers (#8075), a broken dependency download, a peer-triggerable busy loop, a way for a quorum commitment to be lost for a whole DKG cycle, and a node abort after a reorg. It also carries #8131, which changes when masternodes vote NO on superblock triggers. Inside a superblock's maturity window a masternode votes NO on every trigger that doesn't match its candidate and never revisits that vote. If the approved set changes while triggers are being created, masternodes can end up having voted NO on the trigger that matches their final candidate, and the superblock can go unpaid. With #8131 a masternode waits for a trigger matching its own candidate before it votes NO on the others (until 3 blocks before the superblock), and clears the per-cycle "voted YES" marker by height so an unfunded cycle doesn't carry over into the next one. This was a separate PR (#8132) until #8131 merged on develop; it is folded in here so the release branch gets one backport PR. It also carries the fixes for the `llmq_400_85` DKG rounds that have been failing on mainnet, which is what the stalled v24 activation is waiting on: #8135, which stops DKG members from reloading every verification vector at commit time, the reason slow members have been missing the commit phase of `llmq_400_85` rounds, and #8130, which makes a member relay its own DKG messages before it works through queued peer messages. ## What was done? ### Picked All eleven are picked from their develop merge commits with `git cherry-pick -m1 -x`. Each pick changes the same lines as its develop counterpart except where noted. - #8088 fix: fetch miniupnpc sources from miniupnp.free.fr - #8052 fix(qt): reserve the same shared masternode contribution again after a release - #8094 fix(net): stop busy-looping while a peer's send buffer is full - #8080 test(qt): stop address book tests from answering the shared masternode wizard's prompt (fixes #8075) - #8104 fix: keep final commitments mineable when their block is rejected, with the adaptation below - #8100 fix: don't abort in governance when a reorg changes masternode internal ids, with the adaptation below - #8099 fix(rest): don't terminate on blocks with undecodable ProTx payloads - #8135 perf: keep verified DKG contributions cached through the commit phase, with the adaptation below - #8130 fix: process a node's own DKG messages ahead of queued peer messages - #8097 fix: keep governance triggers across a restart on test networks, source change only (see below) - #8131 fix: wait for a matching superblock trigger before voting NO on the others ### Adaptations - **#8104:** `v24.0.x` doesn't have #7936 (parse each quorum commitment payload once per block). `src/llmq/blockprocessor.cpp` keeps the `v24.0.x` `GetCommitmentsFromBlock` and adds the new `RemoveMineableCommitmentsForBlock()` unchanged; in `blockprocessor.h` its lock annotation drops `!m_commitment_payload_mutex`, a mutex that only exists with #7936. `Chainstate` has no `m_special_tx` member on `v24.0.x`, so the two new calls in `validation.cpp` go through `m_chain_helper->special_tx`, like the neighbouring special-transaction calls. The `specialtxman.*` hunks are identical to the develop merge. - **#8135:** in `CDKGSessionManager::CleanupCache`, `v24.0.x` still has a hand-written erase loop that develop had already replaced with `std::erase_if`; the pick takes the new `std::erase_if` form. The benchmark added in `src/bench/bls_dkg.cpp` is left out: it conflicts with the `v24.0.x` version of that file and isn't needed on the release branch. The rest of the source change is identical. - **#8097:** only the source change is picked (two lines in `src/governance/governance.cpp`). It is needed for #8131's test: without it a masternode restarted inside the maturity window drops its stored triggers on regtest, testnet and devnets and then rejects the superblock, which is what the restart case of that test does. Mainnet is not affected by that bug, because the expiry check involved is skipped there. #8097's own `feature_governance.py` step is left out because it restarts the pruned node added with #7860, which `v24.0.x` doesn't have. - **#8131:** no conflicts; `src/governance/signing.cpp` on `v24.0.x` is identical to develop before the change. - **#8100:** the test fixture in `src/test/governance_vote_processing_tests.cpp` keeps `CBaseChainParams::REGTEST`, since `v24.0.x` predates `ChainType`. The source change is identical. ### Not picked - #8129 (re-sign a pending EHF signal on every block): an earlier revision of this PR carried it. It is still under discussion on develop, and v24.0.1 goes ahead without it: the EHF signal is attempted again when a newly formed quorum is selected for it, which the DKG fixes here are meant to make possible. - #8101 (reject InstantSend locks with a noncanonical version or cycle hash): an earlier revision of this PR carried it. It scores a peer 100 for relaying a lock with a non-current version, but nodes without the change accept and relay such a lock, so in a mixed network an upgraded node would discourage honest peers that are still on v24.0.0. It needs to stop scoring that case before it ships anywhere. - #8095 and its follow-up #8121 (block templates while the best ChainLock is above the tip): with both, a node refuses to build a template in that window, which is what v24.0.0 already does with a less helpful error. An earlier revision of this PR carried #8095 alone; it was dropped once #8121 merged. - #8102 (quorum scan cache): written on top of the #7956 refactor; it needs a hand-port to two functions on `v24.0.x`. - #8116 and #7815 (CoinJoin coordinator): long-standing, mixing only; #8116's test depends on #7815. - #8085, #8096, #8098, #8103, and the features, refactors, Bitcoin Core backports, CI and test-only changes merged since the branch point. ## How Has This Been Tested? macOS arm64, depends build with `--enable-debug --enable-werror`, no GUI. The current head is 78ad074. On the current head: - `dashd` and `test_dash` build cleanly. - Unit suites `governance*`, `llmq*`, `dkg*`, `evo*` and `versionbits*` pass, on the relic-based BLS library this branch uses. - `feature_governance_trigger_voting.py`, `feature_governance.py`, `feature_governance_cl.py`, `feature_governance_objects.py`, `feature_llmq_dkgerrors.py`, `feature_mnehf.py` and `interface_rest.py` pass. On earlier revisions of this branch. The current head has the same content as those revisions for the picks concerned; since then #8129 was dropped (one line in `src/llmq/ehf_signals.cpp` plus its test changes), the #8097 and #8131 picks were added, and the later picks were redone from their develop merge commits without changing the tree: - `feature_llmq_signing.py` (both variants), `feature_llmq_chainlocks.py` and `feature_llmq_rotation.py` pass (on the revision without #8097 and #8131). - Without the #8097 source change, `feature_governance_trigger_voting.py` fails in its restart case: the restarted masternode rejects the superblock with `bad-cb-amount`. - Unit suites `bls*` pass. On a revision that also carried #8095 and #8101, `coinjoin*`, `net_tests`, `miner_tests` and `validation*` passed as well. - The full functional suite (`test_runner.py -j16`), on the revision that still carried #8129 and not yet #8097 and #8131: 307 passed, 17 skipped, 1 failed. The skipped ones are the usual environment-dependent tests (`*_bind*`, `interface_usdt_*`, `interface_zmq*`, previous-release compatibility and `feature_unsupported_utxo_db.py`). The run includes `feature_llmq_dkgerrors.py` with #8104's new scenario and `interface_rest.py` with #8099's. - The failure was `feature_llmq_signing.py`, in its first `mine_quorum`, waiting for every member to have received all contributions. The node logs show one masternode relaying its contribution about 0.2 s before its connections to the other members had been authenticated, so no peer received it. That happens before anything #8135 or #8130 changes, and it is load-dependent: running four copies of the test in both variants at `-j8`, three times, 2 of 24 runs fail on that revision and 2 of 24 fail on the same branch without the two DKG commits, with the same assertion. - A full functional run with the #8097 and #8131 changes on top of an older revision of this branch: 310 passed, 17 skipped, none failed. #8131 describes its scenarios and how each was shown to fail without the change. The GUI picks (#8052, #8080) were not built or run locally; CI covers them. The first push of this branch did not compile (`m_special_tx`, see Adaptations); review caught it and it was fixed before any of the above was run. ## Breaking Changes None. Behaviour change for masternodes (#8131): a NO vote on a non-matching trigger may be cast later than before, when the masternode's own candidate has no trigger yet, and at the latest 3 blocks before the superblock. ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 8ce635d02dd2b9b285aa6a1630d329ffeb9dcb99947a7a758c80ed17a2dbeb7496162a7f3052e872f46d481c6e6391ce866fd296d3ef1fa8edb1dc2d2c5f275e
038306f chore: prepare v24.0.1 release (pasta) Pull request description: ## Issue being fixed or feature implemented Prepares the **v24.0.1** point release on top of the v24.0.1 backports (#8128), following the v23.1.10 prep (#7983). v24.0.1 carries the fix for what has held up `v24` activation on mainnet (`LLMQ_400_85` DKG rounds failing at the commit step, so no new quorum is selected to sign the EHF signal), plus a small set of other fixes. ## What was done? - `configure.ac`: `_CLIENT_VERSION_BUILD` 0 → 1 (`_CLIENT_VERSION_IS_RELEASE` stays `true`, no RC). - `doc/release-notes.md`: v24.0.1 notes covering #8135, #8130 and #8104 (v24 activation), #8131 and #8097 (governance), #8100, #8094, #8099 and #8052 (other fixes), and #8088 and #8080 (build and tests). Upgrade and downgrade notes point to the v24.0.0 notes for everything that applies when coming from v23. - Archived the v24.0.0 notes to `doc/release-notes/dash/release-notes-24.0.0.md` (verbatim copy), added v24.0.0 to "Older releases", and pointed the change log link at `v24.0.0...v24.0.1`. - `contrib/flatpak/org.dash.dash-core.metainfo.xml`: `24.0.1` release entry dated 2026-11-12. The date needs changing if the tag is cut on another day. - `doc/man/*.1`: version string bump only; no CLI option changed since v24.0.0. ## How Has This Been Tested? Release mechanics only; no code changes. - Built the branch (macOS arm64, wallet, no GUI); `dashd -version` and `dash-cli -version` report `v24.0.1`. - Regenerated the `dash-cli`, `dash-tx`, `dash-wallet` and `dash-util` man pages with `contrib/devtools/gen-manpages.py` from that build: byte-identical to this commit. `dashd.1` differs from the regenerated one in a single line, the `lock` debug category that only an `--enable-debug` build lists, so the committed page matches a release build. `dash-qt.1` got the same version-only bump and wasn't regenerated (no GUI build). - The archived 24.0.0 notes are byte-identical to the previous `doc/release-notes.md`. - The notes were checked against the merged diffs and kept to effects. ## Breaking Changes None in this PR. The behaviour changes that ship in the fixes are described in the notes: masternodes cast some NO-FUNDING trigger votes later than before. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: 1553e82ef0da95830bf0edada0354820da75d72645faec37663694dc790f816fe597f220abee7bad0485be4d41596d26d27f0d2bfc44a05510d71346f5a3204c
Brings the v24.0.1 release into develop. upstream/master is at the signed v24.0.1 tag (137d999), so this merges master itself. Every code change in v24.0.0..v24.0.1 is a cherry-pick -m1 -x of a develop merge commit (#8088, #8052, #8094, #8080, #8104, #8100, #8099, #8135, #8130, #8097, #8131), and each source commit is already on develop. Git reports conflicts in configure.ac, src/validation.cpp, src/llmq/blockprocessor.{cpp,h} and src/test/governance_vote_processing_tests.cpp because v24.0.x carries adapted copies of those changes. All of them resolve to develop's side, which keeps develop's code and configure.ac (24.1.0). Taken from v24.0.1: - doc/release-notes.md: the v24.0.1 release notes; the v24.0.0 notes are archived in doc/release-notes/dash/ - the version string in the man pages (no option changed) - the v24.0.1 flatpak release entry Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
038306f chore: prepare v24.0.1 release (pasta) 78ad074 Merge #8131: fix: wait for a matching superblock trigger before voting NO on the others (merge-script) 6faa5ce Merge #8097: fix: keep governance triggers across a restart on test networks (pasta) 2757e83 Merge #8130: fix: process a node's own DKG messages ahead of queued peer messages (merge-script) cbbee0e Merge #8135: perf: keep verified DKG contributions cached through the commit phase (merge-script) 29a3cdd Merge #8099: fix(rest): don't terminate on blocks with undecodable ProTx payloads (merge-script) 275a142 Merge #8100: fix: don't abort in governance when a reorg changes masternode internal ids (merge-script) d00c4e6 Merge #8104: fix: keep final commitments mineable when their block is rejected (merge-script) b051d3a Merge #8080: test(qt): stop address book tests from answering the shared masternode wizard's prompt (merge-script) ec9e944 Merge #8094: fix(net): stop busy-looping while a peer's send buffer is full (merge-script) 033dae3 Merge #8052: fix(qt): reserve the same shared masternode contribution again after a release (merge-script) 65603d5 Merge #8088: fix: fetch miniupnpc sources from miniupnp.free.fr (merge-script) Pull request description: ## Issue being fixed or feature implemented Merges the v24.0.1 release back into develop, as the release process asks once `master` is fast-forwarded. `master`, `v24.0.x` and the signed `v24.0.1` tag all point to the same commit (137d999). ## What was done? One merge commit of `master` into develop. Every code change in `v24.0.0..v24.0.1` is a `cherry-pick -m1 -x` of a develop merge commit (#8088, #8052, #8094, #8080, #8104, #8100, #8099, #8135, #8130, #8097, #8131), and every source commit is already on develop. The two merge commits on `v24.0.x` (#8128, #8133) add nothing beyond their second parents. Git reports conflicts in `configure.ac`, `src/validation.cpp`, `src/llmq/blockprocessor.{cpp,h}` and `src/test/governance_vote_processing_tests.cpp`, because `v24.0.x` carries adapted copies of those changes. All of them resolve to develop's side, which keeps develop's code and version (`configure.ac` stays at 24.1.0, `CLIENT_VERSION_IS_RELEASE` false). Taken from v24.0.1: - `doc/release-notes.md`: the v24.0.1 release notes. The v24.0.0 notes move to `doc/release-notes/dash/release-notes-24.0.0.md`, unchanged from develop's current `doc/release-notes.md`. - The version string in the man pages (no option changed since v24.0.0). - The v24.0.1 entry in the flatpak release history. None of develop's individual `doc/release-notes-*.md` files cover changes in v24.0.1, so all of them stay. ## How Has This Been Tested? - `git diff develop` on this branch touches only the 9 doc and flatpak files above; `src/`, `test/` and `configure.ac` are byte-identical to develop, so nothing was rebuilt. - Checked that the `-x` source of every non-merge commit in `v24.0.0..master` is an ancestor of develop. ## Breaking Changes None. Develop's code is unchanged. ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: d7021c283bd5fedce891e1317f08d1389b7538755fa63964aeba43a77dba7e1752c96add49d2a18d04ad6406b004bd7a42cce1637e46816a722a8d4dda480904
Issue being fixed or feature implemented
A ProRegTx or ProUpServTx with an unsupported payload version deserializes only its version field and leaves
netInfonull.TxToUnivstill treats the payload as decodable and callsToJson(), which hits aCHECK_NONFATALon the nullnetInfo. Over RPC that becomes an internal-bug error, but inGET /rest/block/<hash>.jsontheNonFatalCheckErrorescapes the HTTP worker andstd::terminates the node. Such a block can be stored without ever being connected (it is rejected withbad-protx-versionat connect time), so a REST client could stop a node with-restenabled.What was done?
TxToUnivomits the decodedproRegTx/proUpServTxobject whennetInfois unset, the same as it already does for payloads that fail to deserialize. The rawextraPayloadstays in the output. Rendering of supported versions and all validation are unchanged. No HTTP-wide exception handling was added; the fix is at the rendering step, which covers RPC and REST alike.How Has This Been Tested?
interface_rest.pystores a rejected block with both payload types at versions 0 and 65535 and checks that REST/blockand/block/notxdetails,getblock,decoderawtransactionandgetrawtransactionreturn the transactions with their raw payload and without the decoded object, with and without-deprecatedrpc=service, and that the node stays up. Ondevelopthe REST block request kills the node (RemoteDisconnected); with this change it passed three times.rpc_deprecated.py, which previously expected the internal-bug error for these payloads, now checks the same successful rendering.feature_protx_version.py,rpc_netinfo.pyand theevo_netinfo,evo_sharedmn,evo_dip3_activation,evo_simplifiedmnsunit tests pass.Breaking Changes
None.
Checklist:
🤖 Generated with Claude Code