Open m-kus opened 2 months ago
I would postpone this one until we gain better understanding how the proving pipeline will look like. Saving Sierra to Casm compilation time does not look like a worthwhile goal.
- Pre-processes program arguments (converts JSON to
T = Felt | Array<T>
)- Optionally also queries data from RPC
Both should be facilitated by a script that will drive the client, rather in Python than in Rust.
In general, cairo1-run
should suffice, it can work with sierra output and generate all the artifacts necessary for proving. The only problem is that it's not packaged (and you cannot use cargo install either), we'd need to clone, build, and run cairo-vm
locally which is not very convenient.
Just to note, custom runner is a very small program, e.g. see https://github.com/HerodotusDev/integrity/blob/main/runner/src/main.rs
I prefer not to go custom route until it is strictly necessary. What would be simplest way to get cairo1-run available via cargo install? Clone the vm repo and publish it under the custom name?
Maybe we can ask Lambda to add it to the [bin] section in Cargo.toml (which is probably the easiest option) or build binaries in CI (or ask some OD contributor to do that)
Actually it worked without [[bin]] (contrary to https://doc.rust-lang.org/cargo/commands/cargo-install.html#description) cargo install --git https://github.com/lambdaclass/cairo-vm cairo1-run
For some reason cairo1-run
fails to compile the Sierra file produced by Scarb (and it also fails to compile the project because it does not support crates). I've upgraded cairo-lang-*
dependencies but the problem seems to be somewhere else.
I'm moving on with Scarb runner for now, will investigate later.
Another thing: we hit "Arguments list too long" in shell when running full client on large blocks (1MB), it seems that the workaround is to read args from file, Scarb does not support that, cairo1-run does.
Additional considerations:
Currently we use Scarb cairo-run extension for running the light client program but it has several downsides:
Another option is cairo1-run (from cairo-vm) but it still does not solve (1).
A proposed solution is a custom Cairo runner that:
T = Felt | Array<T>
)It should have a convenient CLI so that we can integrate it into the validation pipeline.