AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 33 Bitcoin

mining: fix -blockreservedweight shadows IPC option

Public commit record

What the developer wrote

Authored by Sjors Provoost

95/100 · Strong
mining: fix -blockreservedweight shadows IPC option

The -blockreservedweight startup option should only affect RPC code,
because IPC clients (currently) do not have a way to signal their intent
to use the node default (the BlockCreateOptions struct defaults
merely document a recommendation for client software).

Before this commit however, if the user set -blockreservedweight
then ApplyArgsManOptions would cause the block_reserved_weight
option passed by IPC clients to be ignored. Users who don't set
this value were not affected.

Fix this by making BlockCreateOptions::block_reserved_weight an
std::optional.

Internal interface users, such as the RPC call sites, don't set a
value so -blockreservedweight is used. Whereas IPC clients do set
a value which is no longer ignored.

Test coverage is added.

mining_basic.py already ensured -blockreservedweight is enforced by
mining RPC methods. This commit adds coverage for Mining interface IPC
clients. It also verifies that -blockreservedweight has no effect on
them.

Co-Authored-By: Russell Yanofsky <russ@yanofsky.org>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a bug where a command-line option meant only for RPC mining clients was accidentally also overriding settings for IPC (inter-process communication) mining clients. IPC clients now have their own reserved block weight respected, while RPC clients still follow the startup option. The change is a correctness fix in how mining block templates are built, not a remote exploit.

Recommended action

Treat as a normal bug-fix merge. No urgent security response required. Mining operators using IPC should verify their `BlockCreateOptions.blockReservedWeight` is set as intended; RPC users are unaffected.

Security signals we found

01

Configuration option scope bug: startup flag affected unintended interface

02

IPC client-supplied parameter was silently ignored

03

Potential for unexpected block template behavior for mining software using IPC

04

No input validation bypass or memory safety issue evident

Risk score

Why this scored 33/100

Our methodology →
Potential impact 8/30
Exploitability 4/25
Stealth signal 5/15
Affected reach 5/15
Confidence 7/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.