You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mining IPC createNewBlock fails with bad-cb-length on low-height regtest chains #35126
I’m not sure whether this is expected after #32420, but I’m seeing Mining.createNewBlock over IPC fail on low-height regtest chains before the IPC client can receive a template and construct its own coinbase.
Observed behavior
On Bitcoin Core v31.0, when using the Mining IPC interface on regtest at low block heights, Mining.createNewBlock can throw:
For heights 1 through 16, the BIP34 height is encoded as a one-byte OP_1 through OP_16. That is below the consensus minimum coinbase scriptSig length of 2 bytes, so TestBlockValidity() rejects the internally assembled block with bad-cb-length.
RPC mining paths appear to avoid this by setting include_dummy_extranonce = true, but that option does not seem to be exposed in the IPC BlockCreateOptions schema.
Workaround
Pre-mine 16 regtest blocks before using the IPC Mining interface. Then the next template height is 17, the BIP34 height encoding is no longer one byte, and createNewBlock succeeds.
Activity
workaround for bitcoin core issue 35126
workaround for bitcoin core issue 35126
ViniciusCestarii commentedon Apr 20, 2026
Sjors added a comment on #32420 that explicitly acknowledges this regression:
#34860 hasn't been merged yet.
workaround for bitcoin core issue 35126
Sjors commentedon Apr 22, 2026
I updated the #34860 description to point out that it fixes this issue.
Your suggested workaround is correct, until then.
workaround for bitcoin core issue 35126
workaround for bitcoin core issue 35126
workaround for bitcoin core issue 35126
workaround for bitcoin core issue 35126
Merge bitcoin#34860: mining: always pad scriptSig at low heights, dro…