miden_block_prover/
errors.rs1use miden_objects::{AccountTreeError, Digest, NullifierTreeError};
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum ProvenBlockError {
6 #[error("nullifier witness has a different root than the current nullifier tree root")]
7 NullifierWitnessRootMismatch(#[source] NullifierTreeError),
8
9 #[error("failed to track account witness")]
10 AccountWitnessTracking { source: AccountTreeError },
11
12 #[error("account ID prefix already exists in the tree")]
13 AccountIdPrefixDuplicate { source: AccountTreeError },
14
15 #[error(
16 "account tree root of the previous block header is {prev_block_account_root} but the root of the partial tree computed from account witnesses is {stale_account_root}, indicating that the witnesses are stale"
17 )]
18 StaleAccountTreeRoot {
19 prev_block_account_root: Digest,
20 stale_account_root: Digest,
21 },
22
23 #[error(
24 "nullifier tree root of the previous block header is {prev_block_nullifier_root} but the root of the partial tree computed from nullifier witnesses is {stale_nullifier_root}, indicating that the witnesses are stale"
25 )]
26 StaleNullifierTreeRoot {
27 prev_block_nullifier_root: Digest,
28 stale_nullifier_root: Digest,
29 },
30}