-
Notifications
You must be signed in to change notification settings - Fork 12
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
Cache prover keys #187
Cache prover keys #187
Conversation
module Js_environment = struct | ||
type t = Node | Web | Unknown | ||
|
||
let value = | ||
let env = get_ts_bindings () |. "jsEnvironment" in | ||
Js.( | ||
if phys_equal env (def (string "node")) then Node | ||
else if phys_equal env (def (string "web")) then Web | ||
else Unknown) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes the ocaml bindings aware of the current JS environment. I originally thought that I needed this to avoid using nodejs filesystem operations on the web. in the design I ended up with, the write
and read
operations are generic and can be set to something which works in either nodejs or the web on the JS side; so this remains unused.
It still seems useful to have.
) -> Result<WasmPlonkVerifierIndex, JsError> { | ||
let vi: Result<DlogVerifierIndex<$G, OpeningProof<$G>>, serde_json::Error> = serde_json::from_str(&index); | ||
match vi { | ||
Ok(vi) => Ok(to_wasm(srs, vi)), | ||
Err(e) => Err(JsError::new(&(e.to_string()))), | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verification key encoding was already in place in a usable way (encode as JSON string, this is fine for vks which are small). I just changed the deserialization so that it can throw a proper error and not just panic
function getRustConversion(wasm: wasm) { | ||
return rustConversion ?? (rustConversion = createRustConversion(wasm)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is exposed to the main o1js codebase
Companion to o1-labs/o1js#1187
cache
andstorables
arguments to values wrapping astorage
argument provided from the JS sidestorables
argument is added to Pickles in the Mina companion: Cache prover keys MinaProtocol/mina#14396