Skip to content

v1.1.6 — upgrade before block 115,000

Choose a tag to compare

@Blocklechain Blocklechain released this 02 Dec 16:51
· 23 commits to main since this release

If you run a node, upgrade before block 115,000. This is a consensus change at a fixed height, and a node still on 1.1.5 or older will reject the blocks the rest of the network accepts from that point on.

The Kaspa lane could not produce a block

The lane opened at 111,111. The first real submissions, at heights 111,137 and 111,141, were both refused:

merged-mining proof invalid: no BLK1 commitment in the kaspa coinbase payload,
or it appears more than once

The gate passed, the header parsed, the coinbase parsed. What failed was finding the commitment, and it would have failed for every Kaspa block ever mined.

find_block_commitment ran from_utf8 across the whole coinbase payload and gave up if it failed. The reasoning was that the payload arrives inside a protobuf string and so must be valid UTF-8 — but only the trailing extra data is that string. Kaspa builds the payload around it as binary:

bytes field
8 blue score (LE)
8 subsidy (LE)
2 script version (LE)
1 script length
~34 payout script — P2PK is 0x20 ‖ 32-byte pubkey ‖ 0xAC
rest extra data (the UTF-8 part)

0xAC is not valid UTF-8 on its own, so the decode failed before the search ever started. Every genuine proof was rejected and the lane was unmineable from the moment it activated.

The tag and its 64 hex characters are ASCII, so from 115,000 they are searched in the bytes. The rules that matter are unchanged: the tag may appear anywhere, it must appear exactly once, and the 64 characters after it must be hex.

Diagnosed by the same node operator who found the v1.1.4 checkpoint bug and the quadratic sync, down to the byte offsets.

Why the tests did not catch it

Every test fed the function an ASCII-only payload, so the from_utf8 never failed. One of them went further and asserted the broken behaviour as a requirement — commitment_rejects_non_utf8_truncated_and_non_hex, pinning "non-UTF-8 must be refused", which is exactly the rule that made the lane impossible.

The layout was never in doubt, either. A test two screens below subtracts COINBASE_HEADER = 19 and SCRIPT = 34 from the 204-byte payload limit to prove the commitment fits — so the same file documented the binary prefix while the parser assumed the whole payload was text.

The replacement builds a payload with the real binary header and a 0xAC-terminated payout script, asserts the fixture is not valid UTF-8 first, and checks that the pre-fix rule still rejects it. It was confirmed to fail before the fix and pass after.

The flag day

height
111,111 Kaspa lane activated (1.1.5)
115,000 commitment searched as bytes (this release)

This is a relaxation: it accepts proofs an unpatched node rejects, so a Kaspa-parented block before everyone has upgraded splits the chain — the same shape as the lane's own activation. Nothing below 115,000 is reinterpreted, because no Kaspa-parented block has ever been accepted by any node; the pre-fix rule is kept in the binary so those heights still have a definite answer.

Regtest and testnet have the fix from block 0.

Also in this release

serve_headers still rebuilt an array of every header hash in the chain — 110,000 entries, allocated and discarded — on every GetHeaders, while holding the state lock. v1.1.4 fixed this in serve_blocks and left its twin behind. Every syncing peer sends GetHeaders and the heartbeat re-sends it, so this was the other half of the sync stalls.

The header-hash index also now has the differential test it never had. It arrived in v1.1.4 behind nothing but a debug_assert, and three serving paths depend on it; if it ever resolved a hash the chain does not have, serve_headers would compute a fork point from it and send a syncing node headers from the wrong branch.

Upgrading

Replace the binary. No reindex, no resync, no datadir change.