Repository navigation
Conversation
Every debug frame of an imported function or constant carried the full text of its declaring file, so an artifact embedded that file once per distinct definition it used. The text now lives once in `debug.sources`, keyed by the frames' `sourceFile`. Readers resolve a frame's text through `getDebugFrameSource`, which still accepts the per-frame `source` of artifacts from earlier 0.14.0-next pre-releases. Since frames now share one entry per `sourceFile`, two different files must never get the same name. The short package path could collide with a local file or another installed copy of the package, so any name held by more than one imported file is replaced by each file's path relative to the contract, repeated until no name is shared. Names that don't clash are unchanged. TS artifacts quote object keys that are not identifiers, since the `debug.sources` keys are file names. Closes #449 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #450 +/- ##
==========================================
+ Coverage 88.63% 89.22% +0.58%
==========================================
Files 61 61
Lines 4980 5002 +22
Branches 922 929 +7
==========================================
+ Hits 4414 4463 +49
+ Misses 436 420 -16
+ Partials 130 119 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
|
We're replacing this PR with another implementation today. |
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.
Opened on behalf of Mathieu G. (mr-zwets) by Claude Opus 5.5.
Closes #449
Why this matters
Every debug frame of an imported function or constant carried the full text of its declaring file, so an artifact embedded that file once per distinct definition it used. On ParyonUSD V2 (31 contracts, shared
constants.cash/identifiers.cash), compiling with this branch takes the artifacts from 814 KB to 558 KB (-31%, the largest from 77 KB to 41 KB), with identical bytecode.What changes
sourceFile, and the artifact keeps each imported file's text once indebug.sources: { [sourceFile]: string }. Omitted when nothing is imported.sourceFilewas not unique per file. The disk resolver names a package file by the path after the lastnode_modules/, so a local./pkg/math.cashand the packagepkg/math.cash, or two nested copies of one package, got the same name. Names are now assigned once the import graph is collected: any name held by more than one file is replaced by each file's path relative to the contract, repeated until no name is shared (a replacement can meet another file's short name when the contract itself sits innode_modules). Names that don't clash are unchanged.getDebugFrameSource(sources, frame)export of@cashscript/utilsis used by the SDK's frame resolution and the BitAuth IDE rendering. It still accepts the per-framesourcewritten by 0.14.0-next.1 to next.5, so those artifacts keep debugging correctly.DebugFrame.sourcestays in the type, marked deprecated; happy to drop it instead if you'd rather not carry it into 0.14.0.debug.sourceskeys are file names. No existing artifact output changes.compiler/artifacts.md) and a release-notes line.Tests
debug.sourceswithout imports; distinct names for the local/package clash and for a contract insidenode_modules(newclash/fixtures); diamond fixture and provenance assertions updated.getDebugFrameSourceand TS key quoting.yarn build,yarn lint,yarn spellcheckandyarn testpass.