Skip to content
This repository was archived by the owner on Apr 18, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ serde.workspace = true
serde_derive = "1.0"
serde_json = { workspace = true, features = ["unbounded_depth"] }
serde_stacker.workspace = true
thiserror = "1.0"
sha2 ="0.10.2"
revm = { version = "17.1.0", default-features = false, features = ["std"] }

Expand Down
6 changes: 0 additions & 6 deletions prover/src/aggregator.rs

This file was deleted.

43 changes: 43 additions & 0 deletions prover/src/aggregator/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/// Errors encountered in the proof generation pipeline for batch and bundle proving.
#[derive(thiserror::Error, Debug)]
pub enum BatchProverError {
/// Represents a mismatch in the verifying key at the specified proof layer.
#[error("verifying key mismatch: layer={0}, expected={1}, found={2}")]
VerifyingKeyMismatch(crate::config::LayerId, String, String),
/// Verifying key for the specified layer was not found in the prover.
#[error("verifying key not found: layer={0}, expected={1}")]
VerifyingKeyNotFound(crate::config::LayerId, String),
/// Sanity check failure indicating that the [`Snark`][snark_verifier_sdk::Snark]
/// [`protocol`][snark_verifier::Protocol] did not match the expected protocols.
#[error("SNARK protocol mismatch: index={0}, expected={1}, found={2}")]
ChunkProtocolMismatch(usize, String, String),
/// Indicates that after generating an EVM verifier contract, the proof itself could not be
/// verified successfully, implying that this sanity check failed.
#[error("EVM verifier contract could not verify proof")]
SanityEVMVerifier,
/// Error indicating that the verification of batch proof failed.
#[error("proof verification failure")]
Verification,
/// Error indicating that the verifier contract's deployment code is not found.
#[error("EVM verifier deployment code not found!")]
VerifierCodeMissing,
/// Error indicating that in the final [`BundleProof`][crate::BundleProofV2] the number of
/// instances found does not match the number of instances expected.
#[error("number of instances in bundle proof mismatch! expected={0}, got={1}")]
PublicInputsMismatch(usize, usize),
/// This variant represents other errors.
#[error("custom: {0}")]
Custom(String),
}

impl From<String> for BatchProverError {
fn from(value: String) -> Self {
Self::Custom(value)
}
}

impl From<anyhow::Error> for BatchProverError {
fn from(value: anyhow::Error) -> Self {
Self::Custom(value.to_string())
}
}
20 changes: 20 additions & 0 deletions prover/src/aggregator/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mod error;
pub use error::BatchProverError;

mod prover;
pub use prover::{check_chunk_hashes, Prover};

mod recursion;
pub use recursion::RecursionTask;

mod verifier;
pub use verifier::Verifier;

/// Re-export some types from the [`aggregator`] crate.
pub use aggregator::{BatchData, BatchHash, BatchHeader, MAX_AGG_SNARKS};

/// Alias for convenience.
pub type BatchProver<'a> = Prover<'a>;

/// Alias for convenience.
pub type BatchVerifier<'a> = Verifier<'a>;
Loading
Loading