-
Notifications
You must be signed in to change notification settings - Fork 57
feat: Lazily call setup function for moduli and curves on first use #1603
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
This comment has been minimized.
This comment has been minimized.
3b6f6bb
to
a05cfd9
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a6a58ae
to
438d810
Compare
This comment has been minimized.
This comment has been minimized.
438d810
to
6e80926
Compare
This comment has been minimized.
This comment has been minimized.
6e80926
to
46b55bc
Compare
This comment has been minimized.
This comment has been minimized.
setup_all_moduli(); | ||
setup_all_complex_extensions(); | ||
setup_all_curves(); | ||
// TODO: Since we don't explicitly call setup functions anymore, we should rewrite this test |
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.
don't forget this TODO before we merge feature branch
This comment has been minimized.
This comment has been minimized.
@@ -110,6 +113,7 @@ pub fn complex_declare(input: TokenStream) -> TokenStream { | |||
} | |||
#[cfg(target_os = "zkvm")] | |||
{ | |||
Self::assert_is_setup(); |
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.
side comment, technically shouldn't it be assert_is_set_up
? not worth changing though
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.
yes
extensions/pairing/tests/programs/openvm_init_fp12_mul_bls12_381.rs
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
… complex_setup_extern_func
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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, I cleaned up the macros a bit so they are safer for no_mangle
and also conform to the other extern functions better.
Commit: b39fd2e |
We no longer need to manually call
setup_*
at the start of main for the moduli and curves. Instead, setup is automatically done on first use of each modulus or curve.Depends on #1596