Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make a runtime introspection tool for investigating all sorts of runtime related details #6485

Closed
nagisa opened this issue Mar 23, 2022 · 2 comments
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc

Comments

@nagisa
Copy link
Collaborator

nagisa commented Mar 23, 2022

Today the runtime is an entirely opaque box to the users of the runtime. Users call a run function and things will supposedly happen.

This API leaves very little space to actually get any information back from the VM, which makes investigating issues with the runtime an extremely menial ordeal.

I would like to have a CLI tool which would allow for people working on the contract runtime to invoke and introspect the runtime in any number of different ways that may make sense for a given problem.

For example, as I was working on #8954 I wanted to:

  • Invoke an arbitrary function within an arbitrary wat/wasm file and a specified VM (or multiple of them), see the output, etc.;
  • View the input wasm and wat;
  • View the prepared wasm and wat at every step of the preparation pipeline;
  • View the assembly code for a given wasm contract and/or function;
    • For VMs that have other IRs, ability to output those IRs would be dope;
  • Run the contract with a instruction-count-precise profiler or a debugger;
    • even better there's somehow some proper debuginfo that these tools can discover e.g. functions, locals, etc;
    • failing that, output information that would allow manually cross-correlating;
    • instruction heatmaps, ability to straightforwardly emulate a execution of a given function, etc...
  • Reproducible memory offsets (no ASLR), especially for the VM mmaps.

In the future we may want to add commands that would allow to exercise e.g. the various contract caches, host functions, etc. as well, especially outside of WASM contract context.


This should be a tool that's easy to extend as future use-cases come up.

@nagisa nagisa added the A-contract-runtime Area: contract compilation and execution, virtual machines, etc label Mar 23, 2022
@stale
Copy link

stale bot commented Jun 22, 2022

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months.
It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.

@nagisa
Copy link
Collaborator Author

nagisa commented Jan 17, 2025

Superseded by #12755.

@nagisa nagisa closed this as completed Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contract-runtime Area: contract compilation and execution, virtual machines, etc
Projects
None yet
Development

No branches or pull requests

2 participants