Repository navigation
@smartledger/scriptmin 0.1.1
Fixes
- Data envelopes are kept byte for byte. An
OP_0 OP_IF … OP_ENDIFblock never runs, so the optimizer could rewrite what is inside it and still pass its equivalence checks. That is where inscription envelopes (1Sat Ordinals, BSV-21 and similar) carry their data, and 0.1.0 could change it, for example turning a repeated field intoOP_OVER. Such blocks are now kept verbatim, and code around them is still optimized. Blocks containingOP_VERIF/OP_VERNOTIFare left to ordinary branch handling, because where they end depends on whether Chronicle rules apply. (#1) - No quadratic slowdown on very deep stacks. A constant
ROLL/PICKindex in the tens of thousands made stack scheduling quadratic: a 6-op script took 75 s. The scheduler now abandons schedules far larger than the code they would replace, and the script takes 3.8 s. The Miller loop, final exponentiation and other real module scripts optimize to the same bytes as before. (#2) - Wider fuzz test: every modelled opcode, unusual push encodings, boundary numbers, and computed
PICK/ROLLindices.
Install
npm install @smartledger/scriptmin @smartledger/bsv