1 minor finding · 1 suggestion
Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive for their assessments.
Findings
[minor] · PR description no longer matches the cache encoding
The promised byte-preserving refactor is now an encoding change, so the PR record documents different behavior from the implementation.
Location: src/script/sigcache.cpp:35 (head).
Details and suggested fix
The description promises a shared typed helper, ECDSA/Schnorr input assertions, and unchanged serialized bytes. At head, ComputeEntryECDSA and ComputeEntrySchnorr remain separate expressions without assertions. Both prefixes lose their 31 zero padding bytes, and ECDSA keys and signature vectors now include CompactSize lengths. The header-based ECDSA boundary argument therefore no longer describes what the cache relies on. The cache is process-local and script validity remains unchanged, but this is not the advertised byte-equivalent clarification. Update the title and description to document native serialization, the shorter salted prefixes, the public nonce-taking constructor used by tests, and the hashing-cost tradeoff.
Optional improvements
[suggestion] · The shorter prefix adds a SHA256 compression for ordinary uncompressed-key entries
For 65-byte keys and 70-72-byte DER signatures, ECDSA cache entries now require four SHA256 compressions instead of three, including signature-cache hits.
Location: src/script/sigcache.cpp:25 (head).
Details and suggested fix
The constructor now leaves nonce || tag as 33 buffered bytes, so each copied hasher compresses the salt again. For a 65-byte uncompressed or hybrid key and a 70-72-byte DER signature, native serialization produces 202-204 bytes and needs four compressions including finalization. The base precomputed a complete salt block and needed three per entry. Entry computation precedes Get, so both signature-cache hits and misses pay the cost. Compressed-key ECDSA and Schnorr retain their previous counts. Full-script-cache hits bypass this path, and WITNESS_PUBKEYTYPE excludes these keys from segwit v0 when enabled. ECDSA verification dominates misses, and the end-to-end impact is unmeasured. Append 31 fixed zero bytes after each tag and update the layout comment and serialization test expectations. This restores three per-entry compressions for these inputs while preserving domain separation and CompactSize boundaries. The cache is process-local, so no persisted-entry compatibility prevents this change.
Earlier concerns
Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.
- [suggestion]: The new fuzz comparisons never query a populated cache (earlier report)