|
| 1 | +/// Errors encountered in the proof generation pipeline for batch and bundle proving. |
| 2 | +#[derive(thiserror::Error, Debug)] |
| 3 | +pub enum BatchProverError { |
| 4 | + /// Represents a mismatch in the verifying key at the specified proof layer. |
| 5 | + #[error("verifying key mismatch: layer={0}, expected={1}, found={2}")] |
| 6 | + VerifyingKeyMismatch(crate::config::LayerId, String, String), |
| 7 | + /// Verifying key for the specified layer was not found in the prover. |
| 8 | + #[error("verifying key not found: layer={0}, expected={1}")] |
| 9 | + VerifyingKeyNotFound(crate::config::LayerId, String), |
| 10 | + /// Sanity check failure indicating that the [`Snark`][snark_verifier_sdk::Snark] |
| 11 | + /// [`protocol`][snark_verifier::Protocol] did not match the expected protocols. |
| 12 | + #[error("SNARK protocol mismatch: index={0}, expected={1}, found={2}")] |
| 13 | + ChunkProtocolMismatch(usize, String, String), |
| 14 | + /// This variant represents other errors. |
| 15 | + #[error("custom: {0}")] |
| 16 | + Custom(String), |
| 17 | +} |
| 18 | + |
| 19 | +impl From<String> for BatchProverError { |
| 20 | + fn from(value: String) -> Self { |
| 21 | + Self::Custom(value) |
| 22 | + } |
| 23 | +} |
| 24 | + |
| 25 | +impl From<anyhow::Error> for BatchProverError { |
| 26 | + fn from(value: anyhow::Error) -> Self { |
| 27 | + Self::Custom(value.to_string()) |
| 28 | + } |
| 29 | +} |
0 commit comments