Skip to content

v1.3.0

Choose a tag to compare

@nau nau released this 20 Oct 18:14
· 349 commits to master since this release

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.balanceTx settles 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, with EvaluationOptions records and a per-transaction budget.
  • Protocol version 12 (Dijkstra) support, including case on Data.Constr when targeting it.
  • scriptHash, dataHash, ExUnits.toJSON(), CIP-30 [input, output] UTxO decoders, and
    Utxo.withScriptRef for Lucid's Script shape.
  • PlutusScriptEvaluationError carries the redeemer, script hash, logs, and the failing script's
    arguments. FlatDecodingError is 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 Value from 1,295 assets in JavaScript drops from 337 ms to 3.6 ms.
  • scalus.js is 21% smaller minified: the IANA timezone database is no longer linked in.
  • Breaking: PlutusScriptEvaluator in EvaluateAndComputeCost mode 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;
    fromCbor still reads both.
  • Breaking: Language.PlutusV4 is a Dijkstra (PV12) language, as in Plutus
    ledgerLanguageIntroducedIn.
  • Script failures name the redeemer and script hash. Every other JavaScript evaluation failure is a
    native Error, and unreadable input is a TypeError.
  • Traces no longer carry a budget suffix; per-trace budgets are in ProfilingData.traces.

Deprecated

  • The Scalus namespace object, applyDataArgToScript, evaluateScript, evaluateScriptProfile,
    and evalPlutusScripts. Use uplc and evaluator; evalPlutusScripts becomes
    evaluator.evaluateTx.
  • CaseDataBranchError and TallyingBudgetSpenderLogger.getLogsWithBudget.

Removed

  • VanRossemNewBuiltinCosts. Its fallback was the defect: an incomplete cost model ran on reference
    costs instead of refusing to run.

Fixed

  • Matching on Data at protocol version 11 compiled to a case on a Data scrutinee, which a van
    Rossem node rejects. Tests and the Emulator passed while the script failed on chain. It now lowers
    through chooseData. 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 exactly 300_000_000 was replaced by Scalus's own reference value.
  • Data constructor indices and CEK constructor tags are unsigned 64-bit. Above 2^63,
    serialiseData produced a different hash than a node, and constr selected a live branch where a
    node answers MissingCaseBranch.
  • Scripts with out-of-scope variables are rejected before evaluation, as the ledger rejects them.
  • JavaScript exports survive destructuring: const { evalPlutusScripts } = Scalus no longer throws,
    which is how @lucid-evolution/scalus-uplc calls them.
  • JavaScript rejects a bigint past 64 bits instead of silently wrapping it, and reads a number
    where a bigint is declared when it is a safe integer.

Documentation