Skip to content

primitives: peel scriptnum and pack-ints (Q-56) - #639

Merged
reardencode merged 3 commits into
masterfrom
primitives/q56-peel
Sep 19, 2026
Merged

reardencode merged 3 commits into
masterfrom
primitives/q56-peel

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Takeover of q-56: Miri islands beyond primitives (scriptnum + compact) #623: move, do not copy. Shipped scriptnum (encode/decode/is_minimal, width 4 and 5) and CompactSize/ULEB live in rbitcoin-primitives.
  • Interpreter, store, and mempool call those fns directly (From maps crate errors). Signet walks CompactSize with read_compact_size_from and decodes the default challenge with primitives hex.
  • Store amount_exp / script-kind flags and interpreter check_minimal_push stay put (schema / R-10).
  • Always-on units plus cfg(miri) extra loops (non-minimal, width 5, 5/9-byte CompactSize, ULEB truncated/overflow). Nightly miri.yml stays primitives-only (Q-53).
  • Closes Q-56; R-10 no longer lists it as the open seam.

Hero-Gamer's copies were the right seam; production now calls those functions.

Test plan

  • cargo test -p rbitcoin-primitives --lib
  • interpreter scriptnum_minimal_encoding / CLTV negative-zero
  • store amount_exp_mantissa_strips_trailing_tens / pack_error_is_corrupt
  • mempool packed_roundtrip_serialize_equals_admitted_raw
  • signet compact_size_and_solution_parse_errors
  • cargo clippy --workspace --all-targets -- -D warnings

Made with Cursor

rearden-grok Bot and others added 2 commits September 19, 2026 08:07
Move encode/decode/is_minimal and CompactSize/ULEB into
rbitcoin-primitives. Interpreter, store, and mempool map errors;
signet CompactSize walks the same decoder. Local copies deleted.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Hero-Gamer <92864860+Hero-Gamer@users.noreply.github.com>
Miri stays primitives-only (Q-53). R-10 no longer lists Q-56 as the
open seam; Q-67 moves to rank 5.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Hero-Gamer <92864860+Hero-Gamer@users.noreply.github.com>
@rearden-grok
rearden-grok Bot force-pushed the primitives/q56-peel branch from a4511d3 to 51b5ec9 Compare September 19, 2026 15:07
Same-signature wrappers hid the move. Interpreter, store, and mempool
import primitives; From maps crate errors. Signet uses
read_compact_size_from and primitives hex_decode. Amount/flags and
check_minimal_push stay put.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Hero-Gamer <92864860+Hero-Gamer@users.noreply.github.com>
@reardencode
reardencode merged commit 24deb1a into master Sep 19, 2026
17 checks passed
@rearden-grok
rearden-grok Bot deleted the primitives/q56-peel branch September 19, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant