-
Notifications
You must be signed in to change notification settings - Fork 135
[DO NOT MERGE] native circuit.rs
implementation
#3345
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
base: native/napi
Are you sure you want to change the base?
Conversation
} | ||
|
||
#[napi] | ||
pub fn prover_to_json(prover_index: External<WasmPastaFpPlonkIndex>) -> 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.
Oh so instead of requiring a new type for Napi's indexes you expect receiving the old wasm type for this, that's interesting!
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.
yea WasmPastaFpPlonkIndex
here is the exact same as in plonk-wasm with the exception of the wasm-bindgen macro but that can be fixed later. We should actually be able to share some types and functions between both implementations but i just copy&pasted for now
// TOOD: remove incl all dependencies when no longer needed and we only pass napi objects around | ||
#[derive(Serialize, Deserialize)] | ||
struct SerializedProverIndex { | ||
prover_index: Vec<u8>, |
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.
Why does it include separate fields for srs and prover index? In Kimchi's ProverIndex
, srs is just one of its contents.
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.
please let me know if there is an easier way to serialize ProverIndex<GAffine, OpeningProof<GAffine>>
, that would be very helpful
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.
we actually have something similar already in caml_pasta_fp_plonk_index_encode
but that doesnt encode the srs
.serialize(&mut rmp_serde::Serializer::new(&mut srs)) | ||
.map_err(|e| e.to_string())?; | ||
|
||
let serialized = SerializedProverIndex { prover_index, srs }; |
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.
Like, isn't this redundant?
mina MinaProtocol/mina#17948
o1js o1-labs/o1js#2554
proof-systems #3345