Repository navigation
v1.3.0
Release Notes
Scalus 1.3 balances transactions from JavaScript, evaluates scripts two to three times faster from
CBOR, and corrects Plutus cost-model and 64-bit tag handling.
Added
balancer.balanceTxsettles a transaction's execution units, fee, and change together in
JavaScript. Coin selection and change placement stay with the caller. Experimental.- A CBOR-first JavaScript API:
uplc.applyParamsToScript,evaluator.evaluateScript, and
evaluator.evaluateTx, withEvaluationOptionsrecords and a per-transaction budget. - Protocol version 12 (Dijkstra) support, including
caseonData.Constrwhen targeting it. scriptHash,dataHash,ExUnits.toJSON(), CIP-30[input, output]UTxO decoders, and
Utxo.withScriptReffor Lucid'sScriptshape.PlutusScriptEvaluationErrorcarries the redeemer, script hash, logs, and the failing script's
arguments.FlatDecodingErroris public and is the only error flat decoding raises.
Changed
- Evaluating scripts decoded from CBOR is 2.5–3.1x faster on the JVM and 30–50% faster in
scalus.js. De Bruijn conversion is 3.5–3.8x faster on larger programs. - Building a
Valuefrom 1,295 assets in JavaScript drops from 337 ms to 3.6 ms. scalus.jsis 21% smaller minified: the IANA timezone database is no longer linked in.- Breaking:
PlutusScriptEvaluatorinEvaluateAndComputeCostmode enforces the transaction's
maxTxExecutionUnits, so an over-budget transaction fails at build time, not on submission. - Breaking: a cost parameter the supplied model does not reach is
Long.MaxValue, as in Plutus,
so an incomplete model cannot run. Supply the full model for your protocol version. - Breaking:
Utxo.toCbor()writes CIP-30[input, output]instead of a one-entry map;
fromCborstill reads both. - Breaking:
Language.PlutusV4is a Dijkstra (PV12) language, as in Plutus
ledgerLanguageIntroducedIn. - Script failures name the redeemer and script hash. Every other JavaScript evaluation failure is a
nativeError, and unreadable input is aTypeError. - Traces no longer carry a budget suffix; per-trace budgets are in
ProfilingData.traces.
Deprecated
- The
Scalusnamespace object,applyDataArgToScript,evaluateScript,evaluateScriptProfile,
andevalPlutusScripts. Useuplcandevaluator;evalPlutusScriptsbecomes
evaluator.evaluateTx. CaseDataBranchErrorandTallyingBudgetSpenderLogger.getLogsWithBudget.
Removed
VanRossemNewBuiltinCosts. Its fallback was the defect: an incomplete cost model ran on reference
costs instead of refusing to run.
Fixed
- Matching on
Dataat protocol version 11 compiled to acaseon aDatascrutinee, which a van
Rossem node rejects. Tests and the Emulator passed while the script failed on chain. It now lowers
throughchooseData. Affected script hashes change. - PV11 cost models were read by count, so half of a 332-parameter model was dropped, and a
governance-set cost of exactly300_000_000was replaced by Scalus's own reference value. Dataconstructor indices and CEK constructor tags are unsigned 64-bit. Above 2^63,
serialiseDataproduced a different hash than a node, andconstrselected a live branch where a
node answersMissingCaseBranch.- Scripts with out-of-scope variables are rejected before evaluation, as the ledger rejects them.
- JavaScript exports survive destructuring:
const { evalPlutusScripts } = Scalusno longer throws,
which is how@lucid-evolution/scalus-uplccalls them. - JavaScript rejects a
bigintpast 64 bits instead of silently wrapping it, and reads anumber
where abigintis declared when it is a safe integer.
Documentation
- Documentation: https://scalus.org/docs
- Getting started: https://scalus.org/docs/get-started