-
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
SRS caching #192
SRS caching #192
Conversation
@@ -0,0 +1,31 @@ | |||
#!/bin/env bash |
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.
Could be nice to run https://www.shellcheck.net/, in CI and locally.
|
||
impl_srs!(caml_fp_srs, WasmPastaFp, WasmG, Fp, G, WasmPolyComm, Fp); | ||
|
||
#[wasm_bindgen] |
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.
It seems it is duplicated code that can be parametrized by the curve (I might be wrong by reading only GitHub panel). Can it be moved into the macro impl_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.
you're right, could be in the macro. I think it's easier to maintain outside the macro, see my slack thread here: https://o1-labs.slack.com/archives/C01UNQH8XEZ/p1698141695847899
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.
Mmh, I see. I understand your point, and I do agree (I hate macros...). However, IMO, it is good to stay with one convention, and maybe initiate a refactorization after.
Not a blocking comment for this PR, only an opinion.
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.
lgtm, cant really say too much about the Rust part tho!
unsafe { &mut *(std::sync::Arc::as_ptr(&srs) as *mut _) }; | ||
let domain = EvaluationDomain::<$F>::new(1 << (log2_size as usize)).expect("invalid domain size"); | ||
ptr.add_lagrange_basis(domain); | ||
crate::rayon::run_in_pool(|| { |
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.
looks like a simple but powerful change lol
|
||
impl_srs!(caml_fp_srs, WasmPastaFp, WasmG, Fp, G, WasmPolyComm, Fp); | ||
|
||
#[wasm_bindgen] |
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.
Mmh, I see. I understand your point, and I do agree (I hate macros...). However, IMO, it is good to stay with one convention, and maybe initiate a refactorization after.
Not a blocking comment for this PR, only an opinion.
Cache SRS and Lagrange basis
This