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

miner: add block_max_weight to BlockCreateOptions

Public commit record

What the developer wrote

Authored by Sjors Provoost

68/100 · Adequate
miner: add block_max_weight to BlockCreateOptions

This new optional replaces nBlockMaxWeight.

Use uint64_t for the block weight options to match BlockAssembler's
nBlockWeight accounting and the IPC schema's blockReservedWeight type.

A negative -blockmaxweight value is now parsed as 0 instead of an
overflowed signed value before validation rejects it.

The new block_max_weight option is not exposed to IPC clients.
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit refactors how Bitcoin Core's block builder (the miner) handles the maximum block weight setting. It replaces an older signed-size field with a new optional unsigned field and fixes a parsing quirk: a negative command-line value for -blockmaxweight is now treated as 0 before validation rejects it, instead of silently wrapping around to a huge positive number. The change is mostly a cleanup, but it removes a small overflow/underflow footgun in argument parsing.

Recommended action

No urgent action required. Treat as a hardening/refactoring change. Reviewers should verify that ClampOptions correctly handles the case where block_max_weight is less than block_reserved_weight and that downstream callers (including tests and RPC) set the new option appropriately. Fuzz test update is consistent with the refactor.

Security signals we found

01

Fixes signed-to-unsigned conversion/underflow in -blockmaxweight argument parsing

02

Replaces size_t with uint64_t for block weight accounting consistency

03

Adds optional block_max_weight to BlockCreateOptions, centralizing option handling

04

Does not expose new option to IPC clients, limiting remote attack surface

Risk score

Why this scored 27/100

Our methodology →
Potential impact 5/30
Exploitability 3/25
Stealth signal 4/15
Affected reach 4/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.