Conversation
debug() evaluates one scenario per input, and each scenario described every other input, source output and output by template scripts, which libauth compiled from CashAssembly for every scenario. Debugging now uses a template that gives those entries as the built transaction's bytecode, so each scenario only compiles its slot, and the compiler and VM are created once per debug run. The public getLibauthTemplate() output is unchanged, and error links are still built from it. Closes #469 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Pull request stats
Reviewable churn: 258 lines (net +166), version bumps and generated files excluded. |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (88.67%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## next #470 +/- ##
==========================================
+ Coverage 89.23% 89.27% +0.03%
==========================================
Files 61 61
Lines 5074 5099 +25
Branches 949 959 +10
==========================================
+ Hits 4528 4552 +24
Misses 421 421
- Partials 125 126 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch was successfully 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.
Closes #469.
Summary
debug()evaluates one scenario per input, and each scenario described every other input, source output and output by template scripts. libauth compiled all of those from CashAssembly in every scenario, so debugging was quadratic in the number of inputs. That cost also hitssend()on theMockNetworkProviderand thetoFailRequire*matchers.getLibauthTemplate()gets an internaluseTransactionBytecodeoption. With it, the entries a scenario does not evaluate are given as the built transaction's bytecode in hex, worked out once per template. Each scenario then compiles only its slot.debug()uses this template.getLibauthTemplate().Unchanged
TransactionBuilder.getLibauthTemplate()andgetBitauthUri(). The existing template fixtures pass untouched.send()already used. Building the link can therefore never replace the error it belongs to.Measurements
A trivial one-
requirecontract spent by N inputs,debug()on Node 24:nextnextOn the failing path most of the remaining time is the readable template and its compressed IDE link. These are inherently quadratic in size, so making them faster would mean making the link lazy on the error object.
Tests
Equivalence, for every single- and multi-contract template fixture: debugging gives the same results, or the same error, with either template, and only the slot is left to template scripts.
A 40-input transaction failing at input 33 reports input 33.
An independent review also compared both templates on a 16-input transaction mixing:
All outcomes were identical.
yarn testinpackages/cashscript: 243 passed. Lint and cspell are clean.🤖 Generated with Claude Code