Repository navigation
feat(u32): add embedded constant OR - #146
Conversation
|
Review: changes required before merge. The checked byte boundary misses three original input limbs. With four witness items encoding numeric 1, replacing any bottom-based position 0, 1, or 2 by the nonminimal encoding [0x01, 0x00] still succeeds under the local Tapscript Consensus profile after consuming the four outputs and appending OP_TRUE. Position 3 is rejected. Validate each original byte before arithmetic normalizes it; move or stage the validated limb before repeating the check. Add malformed-encoding regressions at every position under a profile that permits nonminimal numeric encodings globally. Evidence: Reviewed commit: |
2ee1cfc to
4f1e704
Compare
|
Updated in commit The fix validates each original hostile limb before table setup, including nonminimal Validation passed:
|
|
Review of The validator now rotates through all four original limbs, addressing the earlier top-limb-only check. Preserve malformed/nonminimal inputs at every position and the OR result/order regressions. Rebase and rerun the focused OR and named metric checks plus KB validation. Current integration conflicts: Validation scope: source/diff and existing CI review; no new full-repository or field-arithmetic test run was requested. |
|
Addressed in
Validation: 3 focused library tests passed, the named metric passed, KB validation passed (102 records / 257 configurations), and formatting and whitespace checks passed. The unchanged metric fixture measures 776 policy-produced fragment bytes, 13 serialized data-witness bytes, four data items, zero hints, a 272-item combined-stack peak, and 548 static non-push opcodes. It discards outputs; separate correctness tests compare the OR result. Current runs use compiler |
Adds checked OR between a four-byte runtime u32 word and a public embedded mask. The fragment validates every original limb for byte range and canonical ScriptNum encoding, uses and removes the shared Boolean table, and returns four result limbs in their original order.
The
0x89abcdefmask configuration measures 776 policy-produced script bytes, 13 serialized data-witness bytes across four items, zero hints, a 272-item combined-stack peak, and 548 static non-push opcodes. This fragment-with-memory boundary includes table setup and cleanup. Data-witness bytes exclude Taproot transaction framing. Evidence is locally-reproduced and deployment remains unclassified.The integrated tree preserves current main's catalog records, module exports, existing OR APIs, and active metric tests. Tests exercise runtime result/order correctness, raw malformed inputs at every position, successful controls, the historical no-rotation mutant, and surrounding-state preservation.
Validation passed: three focused library tests, the named metric check, KB validation (102 records / 257 configurations), formatting, and whitespace checks. Historical source inspection is backed by a faithful locally executed mutant; no Bitcoin Core or relay-policy validation is claimed.