Provider refusals
write_verifier: Provider declined the request because of a cybersecurity restriction. Experiments remain incomplete; static verification can continue.
1 major finding · 1 minor finding · 6 suggestions
Findings
[major] · A secondary payout can bypass witness-commitment validation
On SegWit-active regtest, a deliberately supplied secondary commitment-shaped payout can make generateblock connect an invalid block because the rewritten coinbase retains the template's cached witness-validation result.
Location: src/rpc/mining.cpp:510 (head).
Details and suggested fix
An authenticated caller can use an ordinary first payout and a second descriptor constructed as "raw(6a24aa21a9ed" + "00"*32 + ")", with transactions=[]. Template validation sets m_checked_witness_commitment, which the block copy retains. The output rewrite appends the real template commitment last, then RegenerateCommitments deletes that last match. GenerateCoinbaseCommitment finds the caller's remaining match and appends nothing. Neither mutation clears the cached flag, so final validation and submission skip the witness calculation, and activation connects the same cached block. With submit=false, the RPC instead returns hex that a fresh submitblock rejects with bad-witness-merkle-match. The base path validated its sole payout before mutation and could not introduce this secondary output. Reset fChecked, m_checked_witness_commitment and m_checked_merkle_root after replacing the coinbase, and always append a freshly computed commitment after the payout outputs. Add a regression that generates without submission and resubmits the hex. No current caller or test producing the commitment-shaped payout was found; this requires deliberate input.
[minor] · Large payout lists can exceed mempool template reservations
With default reservations and a near-full mempool, a large payout list can make generateblock fail validation instead of selecting fewer transactions.
Location: src/rpc/mining.cpp:459 (head).
Details and suggested fix
When transactions is omitted, the assembler selects mempool transactions using the generic 8,000-WU and 400-sigop-cost allowances. It sees only the first payout script. The RPC installs the complete list afterward without reselecting transactions. For example, 100 P2TR outputs alone require 17,200 WU, so sufficiently dense transaction selection can leave too little room and produce bad-blk-weight; enough legacy payout sigops can similarly produce bad-blk-sigops. The RPC returns an error rather than mining a smaller valid block. Compute the full payout list's weight and legacy sigop cost before selection, and enlarge block_reserved_weight and coinbase_output_max_additional_sigops to cover it and the remaining block overhead without reducing larger configured reservations. Add a near-full-mempool regression. This requires deliberate mempool filling on regtest. Raising -blockreservedweight avoids the weight case, and supplying a smaller explicit transaction list also works around the failure.
Optional improvements
[suggestion] · Custom amounts are base allocations, not fixed payouts
Object entries receive their stated amount plus a share of the remaining reward, so describing them as fixed payouts misstates the tested API.
Location: src/rpc/mining.cpp:344 (head).
Details and suggested fix
The loop adds reward_parted and any remainder satoshi to every entry, including entries with an explicit amount. The mixed-output test therefore pays 13.66666667 BTC to the output assigned 8 BTC. This does not express fixed payouts with the leftover going only to chosen remainder recipients; allocating the complete reward instead requires knowing the total, including selected fees in mempool mode. Preserve the tested additive behavior, but replace "fixed amount" and "fixed reward" with "base amount" in both help descriptions and the release note. State explicitly that object entries also receive an equal share of the remaining reward, including any collected fees.
[suggestion] · Fee collection now depends on an undocumented argument mode
Omitting transactions distributes the subsidy plus selected fees, while supplying the same transactions explicitly distributes only the subsidy, but the revised documentation does not explain this difference.
Location: src/rpc/mining.cpp:338 (head).
Details and suggested fix
An explicit transactions array disables mempool selection, so the assembler creates a subsidy-only coinbase before the RPC appends the supplied transactions. Their fees remain unclaimed. Omitting the argument enables assembly with nFees + GetBlockSubsidy, and that fee-inclusive amount is distributed. Consequently, explicit-list custom allocations above the subsidy are rejected as exceeding the total reward even when the supplied transactions pay enough fees to cover them. The old fee-underclaiming behavior is unchanged, but its help warning has been removed. Document both modes in the help and release note rather than restoring the old warning unconditionally.
[suggestion] · Multi-recipient tests use the same address for every output
The new address and descriptor assertions would still pass if every output paid the first recipient.
Location: test/functional/rpc_generate.py:54 (head).
Details and suggested fix
address, address2 and address3 all come from the same miniwallet.get_address(), which returns its unchanged stored address. The addr(...) cases wrap that same destination. Distinct per-output values do not rescue destination coverage: repeating the first script while retaining each output's amount would satisfy the assertions. Create distinct deterministic payout addresses, for example with separately tagged MiniWallet(node, tag_name="payout2") instances, while retaining the original wallet for funding. Assert that the addresses differ and keep the per-output destination and amount checks.
[suggestion] · Mempool-mode test does not check fee-inclusive payouts
The new mempool-mode test checks transaction inclusion but not the fee-inclusive coinbase total, so dropping the selected fees would leave its assertions passing.
Location: test/functional/rpc_generate.py:130 (head).
Details and suggested fix
This case mines ten fee-paying MiniWallet transactions to one address and asserts only that the block contains 11 transactions. Every multi-output reward assertion uses transactions=[], so none exercises fee distribution. Add a mempool-mode case with distinct recipients, record the selected transactions' fees, and assert that the payouts total the subsidy at the mined height plus those fees, with the expected quotient and remainder. Keep an explicit-list value assertion documenting its subsidy-only total. Generating with submit=False and resubmitting the hex would also exercise the rebuilt witness commitment on a freshly deserialized block.
[suggestion] · OpenRPC schema for output does not match the accepted forms
The hidden-method schema excludes valid bare strings and reward-object array entries while advertising a top-level object that the RPC rejects.
Location: src/rpc/mining.cpp:340 (head).
Details and suggested fix
output is declared as an array of strings with skip_type_check, which makes OpenRPCArgSchema emit oneOf: [array of strings, object]. The handler accepts a bare address or descriptor string, or an array containing strings and single-key amount objects, but rejects a top-level object. Schema-driven clients following this declaration would therefore reject valid requests and allow an unsupported form. Describe the actual union in the machine-readable schema and generated help. A type_str label alone only emits an x-bitcoin-type-override annotation for this union, so the schema generator may need extending. Since generateblock is hidden, this affects schema consumers that request hidden methods.
[suggestion] · Over-allocation test does not exercise the cumulative sum check
The tests would still pass if the reward guard checked each amount individually instead of their sum.
Location: test/functional/rpc_generate.py:230 (head).
Details and suggested fix
The rejection case supplies only {address: 51*COIN}, which exceeds the reward by itself. A guard comparing each entry against total_reward would reject it too, while accepting individually affordable entries whose sum is too large. With that hypothetical mutation, 13 BTC plus 13 BTC against a 25-BTC reward produces a negative equal share and two valid 12.5-BTC outputs. Add [{address: 13*COIN}, {address2: 13*COIN}] beside the existing 25-BTC fixtures and expect error -8 with "Sum of custom rewards exceeds the total block reward". Place it before parallel mining changes the subsidy, so neither entry exceeds the reward individually.