endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
804 stars 71 forks source link

bundle label for debugging etc.? #915

Open dckc opened 2 years ago

dckc commented 2 years ago

When doing forensics / debugging on slog data, with nestedEvaluate, we had this handy kludge for getting a name from a bundle:

EPRE = re.compile(r'const entrypoint = "([^"]+)"')

-- https://github.com/Agoric/agoric-sdk/blob/master/packages/SwingSet/misc-tools/vat-map.py#L26

Any suggestions on how to do likewise with endo base 64 zip archives?

see also a Zoe metadata idea https://github.com/Agoric/agoric-sdk/issues/3871#issuecomment-943738826

cc @warner

kriskowal commented 2 years ago

In addition to @agoric/hash-bundle, we might need @agoric/name-bundle to finish the set. The logic of getBundleName would be to decode base 64, read the zip, extract the compartment-map.json and effect something like jq .entry | [.compartment, .module] | join '/'