-
Notifications
You must be signed in to change notification settings - Fork 1
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
Supporting external PVMs #81
Comments
Example Rust version of this API can be found here: https://github.com/FluffyLabs/pvm-shell/blob/main/src/lib.rs#L54 I think we might consider changing it to something like:
We should also consider returning pointers to WASM memory for |
This is pretty cool! I would be interested in officially adding my PolkaVM to it. API-wise, maybe you could also take a look at my API for inspiration. Few notes:
|
Hey @koute! Thanks for the write-up. It would be great to support PolkaVM and all of the other possible use cases you've mentioned. Let me address some things specifically.
I've updated the interface code to encompass the different blob kinds. The API currently is well suited for wasm_bindgen-like output, I think it is going to become a bit more raw (i.e. passing pointers instead of |
In general the easiest thing here would most likely be to piggyback on PolkaVM's crates compiled to WASM (at very least until I can get the PolkaVM program blob format somewhat standardized like it is for WASM). The main two types of interest are So, the bare minimum to do to be able to load PolkaVM blobs would be something like this: #[wasm_bindgen]
pub fn polkavm_to_code_blob(raw_blob: Vec<u8>) -> Vec<u8> {
let parts = polkavm::ProgramParts::from_bytes(&raw_blob).unwrap();
return parts.code_and_jump_table.to_vec();
} This will give you a raw PVM code blob which you can already ingest. Now, to get debug info working you'd have to use Currently the debug info support is limited to being able to extract the locations of the code in the original sources, but I'm also planning to add support for getting backtraces and also for reading/writing to local variables, etc. (Basically I want to support full blown rich debugging experience.) |
It's now possible to load wasm-bindgen compatible WASM blob (either via URL pointing to the metadata JSON or via direct upload of WASM file) #94. We've also added PolkaVM to the dropdown list as one of the default choices: #99. I've extracted support for debug symbols to a separate issue #100 |
We would love to support other PVM implementations than typeberry.
If you'd like to be listed in the select box on the PVM disassembler page, please add a comment in this issue.
The idea is to compile the PVM to WASM (if possible) and expose a common interface that is yet to be fully defined (we are open for discussion).
The proposed interface for now is:
I imagine that the teams will provide an URL for the
JSON
file with metadata. That file will be fetched by the UI at start to decouple deployment process of PVM implementations and the UI.The text was updated successfully, but these errors were encountered: