Replies: 7 comments 2 replies
-
In test-automaticRefund.js changing to const bundle = await bundleSource(automaticRefundRoot, {
cacheSourceMaps: true,
}); causes type error
|
Beta Was this translation helpful? Give feedback.
-
Doesn't seem to work for me. I made the changes shown in the following diff
did a And then ran in vscode under the debugger. I see the debugger stopped in the right-hand pane below: |
Beta Was this translation helpful? Give feedback.
-
Those diffs now at #8541 |
Beta Was this translation helpful? Give feedback.
-
Probably a completely separate problem, but just in case. When I run in the debugger to get to the Any idea why? |
Beta Was this translation helpful? Give feedback.
-
Another possibly related mystery. Without cacheSourceMaps in the GiMiX project I see which I would only expect to see if |
Beta Was this translation helpful? Give feedback.
-
Not sure why For helping VS code find the sources referenced by the source maps, it may need some config help. Some pointers: |
Beta Was this translation helpful? Give feedback.
-
I’ve filed a task to thread a relevant option thru to I also observed over @dckc’s shoulder that I need to add to the front-matter of this discussion instructions on how to thread the bundle source option thru |
Beta Was this translation helpful? Give feedback.
-
Update: 2023-12-04 source maps are not currently threaded through Zoe so debugging a bundled contract, even under Node.js, will not work end to end.
As security conscious engineers, we are inclined to handle source maps with care. One does not simply trust a source map as an attacker can craft a source map that hides their attack. One should not scrutinize a contract through the lens of a source map. However, if you’re debugging your own contract, a source map can hide some of the mechanisms behind our virtualization of modules in Hardened JavaScript. While we continue to make these mechanisms less invasive for the sake of auditors, you can reap the benefits of a better developer experience by enabling local source map debugging.
We facilitate source maps in contracts by keeping a content-addressed source map cache in your home directory. The bundler and importer must both be configured to recognize this cache in your tests.
Bundling
If you’re using the
bundle-source
CLI from@endo/bundle-source
, the source map cache is on by default.If you’re using
bundleSource
directly from@endo/bundle-source
, thecacheSourceMaps
option must be enabled explicitly.If you’re using
makeNodeBundleCache
from@endo/bundle-source/cache.js
:Importing
If you’re using
importBundle
directly from@endo/import-bundle
thread thecomputeSourceMapLocation
power from@endo/import-bundle/source-map-node.js
:Beta Was this translation helpful? Give feedback.
All reactions