-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(circuit_prover): Add circuit prover #2908
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c458d03
feat(circuit_prover): Add circuit prover
EmilLuta 35353d5
Address CR & fix nits
EmilLuta 83a05b5
Reorder imports
EmilLuta 9f33628
linting fixes
EmilLuta df50f59
attempt to fix CI
EmilLuta 2008675
Fix CI builds & linting
EmilLuta 3ec5122
Add docs on non GPU/GPU config
EmilLuta f215baa
Lint .md
EmilLuta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[package] | ||
name = "zksync_circuit_prover" | ||
version.workspace = true | ||
edition.workspace = true | ||
authors.workspace = true | ||
homepage.workspace = true | ||
repository.workspace = true | ||
license.workspace = true | ||
keywords.workspace = true | ||
categories.workspace = true | ||
|
||
[dependencies] | ||
tokio = { workspace = true, features = ["macros", "time"] } | ||
tokio-util.workspace = true | ||
anyhow.workspace = true | ||
async-trait.workspace = true | ||
tracing.workspace = true | ||
bincode.workspace = true | ||
clap = { workspace = true, features = ["derive"] } | ||
|
||
zksync_config.workspace = true | ||
zksync_object_store.workspace = true | ||
zksync_prover_dal.workspace = true | ||
zksync_prover_fri_types.workspace = true | ||
zksync_prover_fri_utils.workspace = true | ||
zksync_queued_job_processor.workspace = true | ||
zksync_types.workspace = true | ||
zksync_prover_keystore = { workspace = true, features = ["gpu"] } | ||
zksync_env_config.workspace = true | ||
zksync_core_leftovers.workspace = true | ||
zksync_utils.workspace = true | ||
|
||
vise.workspace = true | ||
shivini = { workspace = true, features = [ | ||
"circuit_definitions", | ||
"zksync", | ||
] } | ||
zkevm_test_harness.workspace = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use std::{ops::Mul, time::Duration}; | ||
|
||
/// Backoff - convenience structure that takes care of backoff timings. | ||
#[derive(Debug, Clone)] | ||
pub struct Backoff { | ||
base_delay: Duration, | ||
current_delay: Duration, | ||
max_delay: Duration, | ||
} | ||
|
||
impl Backoff { | ||
/// The delay multiplication coefficient. | ||
// Currently it's hardcoded, but could be provided in the constructor. | ||
const DELAY_MULTIPLIER: u32 = 2; | ||
|
||
/// Create a backoff with base_delay (first delay) and max_delay (maximum delay possible). | ||
pub fn new(base_delay: Duration, max_delay: Duration) -> Self { | ||
Backoff { | ||
base_delay, | ||
current_delay: base_delay, | ||
max_delay, | ||
} | ||
} | ||
|
||
/// Get current delay, handling future delays if needed | ||
pub fn delay(&mut self) -> Duration { | ||
let delay = self.current_delay; | ||
self.current_delay = self | ||
.current_delay | ||
.mul(Self::DELAY_MULTIPLIER) | ||
.min(self.max_delay); | ||
delay | ||
} | ||
|
||
/// Reset the backoff time for to base delay | ||
pub fn reset(&mut self) { | ||
self.current_delay = self.base_delay; | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.