-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add test config in zero bin #742
Conversation
zero/src/prover_state/cli.rs
Outdated
@@ -62,6 +62,9 @@ macro_rules! gen_prover_state_config { | |||
pub persistence: CircuitPersistence, | |||
#[clap(long, help_heading = HEADING, default_value_t = TableLoadStrategy::OnDemand)] | |||
pub load_strategy: TableLoadStrategy, | |||
/// Run in an unsafe but fast configuration for testing |
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.
Can you explain what unsafe
means here? What's the tradeoff to the user? What does it mean if it passes?
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.
unsafe
may not be the appropriate term here. I've updated the comments to reflect that. Passing tests with use_test_config
confirms the logic and correctness of the code, but it doesn't guarantee the security of the proofs generated, as this configuration sacrifices security for speed.
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.
I don't really understand what security means in this context, but I'm happy with the change
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.
Our current STARK configuration targets a 100-bit security level, meaning an attacker would need to make 2^100 attempts to create a fraudulent proof that the verifier would accept. However, we can lower this security level (allowing an attacker to require significantly fewer attempts to create a fraudulent proof) in exchange for faster performance during testing.
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.
@0xaatif are you good with this part, or should Sai reword the one-liner?
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
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, thanks!
#676 Now, with the
--use-test-config
flag, you should see a significant speed gain when running tests with Zero Bin. In the example below, execution time was reduced by around 48% when proving blocks on the testnet.Before
After