Repository navigation
Description
Summary
The performance figures and a known-limitation bullet describe SHA-NI and CommonCrypto backends that qbit never uses.
Severity: medium. Found in the 2026-11-04 review of the v1.0.1 change set (all 1.x.x merges since v1.0.0 plus the open PRs that target it), against 1.x.x 21fee6ee8e; area: #268, #181.
Observed
Confidence: confirmed (proven from code and the CI policy; the backend is corroborated by timing). The size of the scalar verify delta on aarch64 is not measured here.
-
Location:
doc/release-notes-1.0.1.md:333-339and:516-520atreview/pr-181261d1b71eb(the subtree: import libbitcoinpqc v0.3.2 signer stack scrub #268 entry and the "depth of the libbitcoinpqc stack wipe" limitation). The mechanism issrc/libbitcoinpqc/sphincsplus/ref/opt_flags.h:108-109at21fee6ee8e(#if defined(SPX_PRODUCTION_BUILD) return SPX_SHA_BACKEND_SCALAR;), plussha2.cspx_sha256_select_hashblocks_impl/spx_sha512_select_hashblocks_impl, which return the_refscalar functions when the mode is SCALAR. qbit forcesSPX_PRODUCTION_BUILD=1(cmake/libbitcoinpqc.cmake:58,64-65), and CI enforces it (.github/workflows/core-checks.yml:172-180). The upstream doc agrees:src/libbitcoinpqc/docs/runtime-crypto-env.md:15-18says "Production mode pins SHA hashblock backend selection to the scalar implementation… cannot switch production builds to … x86 SHA-NI, or CommonCrypto". -
Scenario: an operator or packager reads the notes and concludes three things, all wrong for qbit:
- Nodes on SHA-NI x86 see no verification change, while ARM and older x86 see about 6.5%.
- Apple-silicon performance is unmeasured "because it hashes through CommonCrypto".
- macOS stack scrubbing is weaker because "the library hashes through CommonCrypto, whose SHA context it does not wipe".
In fact every qbit build, on every platform, verifies, signs and generates keys with the library's scalar SHA-256/512. The SHA-NI figure describes a code path qbit never runs. The CommonCrypto limitation and the PR release: prepare v1.0.1 #181 checklist item built on it ("macOS's CommonCrypto SHA context relies on the 16 KiB burn alone") are moot. On macOS the same scalar code and wipes run as on Linux; what is still unverified there is only the burn depth.
-
Evidence:
-
Code traced as above.
-
Timing measured on this host: 5 interleaved rounds pinned to one core on a shared, loaded machine (load average about 19–31). Medians:
Build verify keygen sign qbit's own build/lib/libbitcoinpqc.a2,504 µs 17.1 ms 229 ms standalone v0.3.2, production 2,501 µs 16.9 ms 224 ms standalone v0.3.0, production 2,548 µs 15.0 ms 202 ms v0.3.2 with test knobs, SPX_SHA_BACKEND=x86(SHA-NI)1,050 µs — — -
qbit's library therefore runs at scalar speed: about 2.4× slower than SHA-NI. That pin predates v1.0.1 (it is already in v0.3.0) and is not a regression.
-
On this x86-64 host, scalar verification shows no measurable v0.3.0 → v0.3.2 change (within ±3% noise), so I could not reproduce the notes' "6.5% slower on scalar" figure either.
-
Keygen came out about 13–15% slower and signing about 11–14% slower, consistent with the notes.
-
Impact
Operator guidance on the cost of consensus verification is wrong, and so is the scope of a known limitation Mainnet has defaultAssumeValid = uint256{} (src/kernel/chainparams.cpp:183), so every IBD verifies every PQC signature. Any verify regression therefore applies to every node, not only to "non-SHA-NI" ones.
Suggested fix
- Rewrite the subtree: import libbitcoinpqc v0.3.2 signer stack scrub #268 entry: "qbit's integrated build always uses the library's scalar SHA-256 (production mode), on every platform; verification is unchanged within measurement noise on x86-64 [and N% on aarch64, if measured with
bench_qbiton an aarch64 Guix binary]; key generation is about 11–15% slower and signing about 11–18% slower." - Delete the CommonCrypto sentences and the CommonCrypto clause of the macOS limitation. Keep "burn depth unverified on macOS, Windows and ARM".
- Optionally add a note that
-assumevalidhas no default on mainnet, so IBD verifies every signature.
Related: #181 (corrects text in its notes at 261d1b71eb).
Activity
doc: correct v1.0.1 notes and docs from the release review
doc: correct v1.0.1 notes and docs from the release review
doc: correct v1.0.1 notes and docs from the release review
doc: correct v1.0.1 notes and docs from the release review
release: prepare v1.0.1 (#181)
release: prepare v1.0.1 (#181)
kiwidream commentedon Nov 12, 2026
Fixed on
1.x.xby the v1.0.1 release notes in #181 (29c0ec9b6c):The optional
-assumevalidnote was not added.Closing by hand, because a merge into
1.x.xdoes not close issues automatically.