Repository navigation
Conversation
The Scripts tab of a transaction can now re-run every script with julc: the transaction is rebuilt
from Yaci Store data and each redeemer runs with the cost model and protocol version of its epoch.
Results show julc's budget next to the declared one ("Reproduced exactly", or reproduced with the
builder's margin), traces, the failure and last builtins, and the exact ScriptContext.
- replay/build.ts: MockTransaction per redeemer in ledger order (inputs, values, mint, withdrawals,
votes), slot -> POSIX time (Shelley constants for public networks, /genesis for devnets),
epoch cost models and tx limits; explains runs it can't rebuild (Byron addresses, proposals,
unsupported certificates) and adds notes on known gaps.
- replay/fix-context.ts: workarounds until julc builds ledger-exact contexts (julc#244): asset
values in ledger order, the complete redeemer map (withdraw-zero validators), datums given by
hash, and V1 list shapes. Corrected contexts are run again with the VM; each result says what
changed.
- cbor.ts: Plutus data encoder (Plutus-library style), round-trip tested.
- load.ts: fetches the rest only on click; certificates and votes only when a script needs them;
falls back to the latest parameters when an epoch's are missing.
Mainnet checks: 40 recent transactions, 108 runs, all passed (80 exact, 5 with builder margin).
2023 Plutus V1 history: 8 of 17 runs pass; julc's V1 fixes after pre18 should improve this.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Initial automated review · Aster Hi @satran004, thanks for the PR! 🙏 This is an automatic first check by an AI reviewer. It does not replace maintainer review and may be wrong. Reviewed commit: Issues found:
Not tested: Static review only; I did not run svelte-check, Vitest, Playwright, or browser/devnet replays. No CI checks were reported for this head at review time. |
This branch has not been deployed
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.
Stacked on #206 (Script Lab foundation), which is stacked on #204. Part of #207: PR 2 of the Script Lab series.
What users get
A transaction's Scripts tab gets a Re-run in your browser button. It re-executes every script of the transaction with julc, using the cost model and protocol version of the epoch it ran in, and compares the result with the budget declared on chain.
Each script card shows:
The panel also shows a summary (e.g. "3 reproduced exactly"). For transactions that failed phase 2 on chain, it says so up front.
Like decoding, nothing loads until the user clicks, or opts in with the shared "Run Script Lab automatically" setting.
How it works
replay/build.ts(pure, unit-tested on recorded Mainnet fixtures) rebuilds a julcMockTransactionper redeemer from Yaci Store data:/genesisfor devnetsInputs: the epoch's
cost_models_rawand tx limits.Purpose names are normalised (spend/spending, proposing, …).
Runs it can't rebuild are explained: Byron addresses, proposal scripts, unsupported certificate kinds.
replay/fix-context.tsworks around julc 0.1.0-pre18 context gaps, all now in WASM API asks from Yaci Viewer Script Lab: full redeemer set, tx-CBOR evaluation, profiling julc#244:txInfoRedeemers→ every run's own entry is collected and the complete map is put back, in ledger order. This fixes withdraw-zero validators.txInfoData.Corrected contexts are re-run with
vm.evaluate, and every result says what was corrected.cbor.ts: a Plutus-data encoder (Plutus-library style), round-trip tested.replay/load.tsfetches only on click:Results on Mainnet (playground store, headless Chrome)
The earlier spike, before the workarounds, had 3 of 16 recent runs failing.
Known limits
Tests
npm run check: 0 errors, 0 warnings.script-lab.spec.ts: both tests pass against a production build in Chrome. The new test re-runs a transaction and opens the ScriptContext.🤖 Generated with Claude Code