Skip to content

WasmCalculator can only be created with FS accessΒ #72

@CPerezz

Description

@CPerezz

I ignore if this is done on purpose or not, but when trying to make Sonobe wasm-compat, one of the things I had to change is to receive bytes directly instead of paths to .r1cs and wasm files.
For the former, this was easy. But for the latter, it turns out to not be possible.

At some point, there's the need to create a WitnessCalculator. This, presents a problem. Which is that the only way for us to create this is to call the API functions this crate exposes as constructors. Which can be seen here.

As seen, all of them rely to pass a Path and read from fs. But this is not possible if we're in a browser env.
So what we would need (and is supported in wasmer already), is another constructor which calls wasmer/struct.Module.html#method.new underneath.

On this way, the WitnessCalculator can be generated from a wasm binary already read by JS previously.

I wonder if this is something that just hasn't been done because no-one needed it, or because there's something I'm missing which explains clearly why this isn't supported.

I'm happy to PR to add this feature :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions