Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 207 forks source link

Thread cacheSourceMaps thru Zoe/SwingSet controller #8580

Open kriskowal opened 11 months ago

kriskowal commented 11 months ago

What is the Problem Being Solved?

Per https://github.com/Agoric/agoric-sdk/discussions/8539, our bundler supports scratching out a source map during development and importBundle can opt-into rehydrating the //#sourceMapURL to rendezvous with that source map. Because the feature is opt-in, it is not enabled in our usage in Zoe or SwingSet controller. Where we use importBundle, we should, when possible, inject computeSourceMapLocation.

Description of the Design

Security Considerations

Scaling Considerations

Test Plan

Manually, adding a debugger statement to a contract that runs in the chain should show the source as it appeared in the developer’s working copy when it was bundled in a debugger like VSCode.

Upgrade Considerations

mhofman commented 11 months ago

To capture my point of view already expressed in chat: I believe we should not modify intermediate runtime code to plumb any source map related information/power that are development environment specific, as that does not solve the problem of debugging production bundles, and is IMO a layering violation.