miden_processor/host/advice/
errors.rs1#![allow(unused_assignments)]
3
4use alloc::vec::Vec;
5
6use miden_utils_diagnostics::{Diagnostic, miette};
7
8use crate::{Felt, Word, crypto::MerkleError};
9
10#[derive(Debug, thiserror::Error, Diagnostic)]
11pub enum AdviceError {
12 #[error("value for key {} already present in the advice map", key.to_hex())]
13 #[diagnostic(help(
14 "previous values at key were '{prev_values:?}'. Operation would have replaced them with '{new_values:?}'",
15 ))]
16 MapKeyAlreadyPresent {
17 key: Word,
18 prev_values: Vec<Felt>,
19 new_values: Vec<Felt>,
20 },
21 #[error("value for key {} not present in the advice map", .key.to_hex())]
22 MapKeyNotFound { key: Word },
23 #[error("advice stack read failed")]
24 StackReadFailed,
25 #[error(
26 "provided merkle tree {depth} is out of bounds and cannot be represented as an unsigned 8-bit integer"
27 )]
28 InvalidMerkleTreeDepth { depth: Felt },
29 #[error("provided node index {index} is out of bounds for a merkle tree node at depth {depth}")]
30 InvalidMerkleTreeNodeIndex { depth: Felt, index: Felt },
31 #[error("failed to lookup value in Merkle store")]
32 MerkleStoreLookupFailed(#[source] MerkleError),
33 #[error("Merkle store backend merge failed")]
35 MerkleStoreMergeFailed(#[source] MerkleError),
36 #[error("Merkle store backend update failed")]
37 MerkleStoreUpdateFailed(#[source] MerkleError),
38}