Conversation
OfflineEvaluatorScalus imported `scalus` at the top level, and core-cst had no `scalus` dependency of its own - it resolved only by hoisting from @meshsdk/core. Scalus 1.x is ESM-only, so a top-level import cannot work in the CommonJS build. The dependency is now declared where it is used, and Scalus loads through a dynamic import() inside evaluateTx, which survives the CJS output. The call site uses the top-level `evalPlutusScripts`; the `Scalus` namespace object that used to carry it is a 0.x shape kept for backwards compatibility, and is deprecated. The evaluator now defaults to protocol major version 11, the version mainnet runs, instead of 10. Pass 10 explicitly to reproduce pre-van-Rossem budgets. The figure the test pins does not move with the protocol version: cost models are supplied explicitly and the script uses no version-gated builtin, so PV1 through PV99 return the same budget. Redeemer tags are mapped through a table keyed on Scalus's own tag union rather than `string`, so a tag added upstream is a compile error here instead of a runtime throw. The previous `.toUpperCase()` silently produced "VOTING" and "PROPOSING", which are not valid RedeemerTagType values.
@meshsdk/scalus-emulator was written against Scalus 0.17 and pinned ^0.17.0, so it never saw the 1.x line. Scalus 1.2 makes the JavaScript emulator a self-sufficient provider backend: it answers protocol parameters, evaluates its own transactions, serves indexed UTxO queries and returns decoded UTxOs. The provider is rebuilt on that surface, which removes the CBOR decoding, protocol-parameter table and evaluation plumbing it used to carry. Redeemer tags are keyed on Scalus's tag union for the same reason as in core-cst.
The suites exercise the workspace sources. They would not catch a package that is broken only once published: a missing dependency, an export map that does not resolve, or an ESM-only bundle failing under require(). scripts/test-scalus-packages.mjs packs and installs the two packages and drives them the way a consumer would, in Node and in headless Chrome, and CI runs it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves
OfflineEvaluatorScalusand@meshsdk/scalus-emulatorfrom Scalus 0.17 to 1.2.1.Emulator
Scalus 1.2's JS emulator is a full provider backend, so the Mesh package drops its own CBOR decoding, protocol-parameter table and eval plumbing (
src/index.ts: -301/+184):evaluateTxwith PV11 cost models, per-redeemer budgetsgetUtxos(filter)-address,paymentCredential+paymentCredentialType(key/script),unit,txHash,outRefs,minLovelace,limit. Filtering runs in the ledger; returns decoded UTxOs, not CBORsubmitTxthrough the real ledger rules;SubmitResultcarrieserrorRuleandlogsgetProtocolParameters,getDatum,getDelegation,getStakeDistribution,getStakeReward,getTransactionStatussetSlot,setTime,tick,snapshotPure JS, no wasm. 2.82 MB raw, 627 KB gzipped. For comparison
whisky-evaluatoris 6.4 MB raw / 1.55 MB gzipped.Emulator tests 20 -> 24: script spend, mint, validity intervals, collateral, metadata, queries by hash and by asset.
Evaluator
import()insideevaluateTx, so the ESM and CJS builds work off one path (Scalus 1.x is ESM)scalusdeclared in core-cst where it's imported; dropped from@meshsdk/core, which doesn't import itVoting/Proposingmap toVOTE/PROPOSE; a new upstream tag is a compile errorevalPlutusScripts; theScalusnamespace is deprecatedTests
test:scalus-packagespacks and installs both packages and drives them as a consumer would, so publish-only breakage is caught. All wired intobuild.yml.The Scalus test needs its own jest config: the default run is CJS, ts-jest rewrites
import()torequire(), and an ESM-only package can't load that way.Node
No
engineschanges. Scalus 1.2.0 required>=20; I measured that it wasn't needed and released 1.2.1 with>=18.