Skip to main content

evm_fork_cache/cold_start/
error.rs

1//! The typed error surface for cold-start runs.
2
3/// A hard error that aborts a cold-start round or run.
4///
5/// Deliberately typed (no `#[from] anyhow::Error` blanket arm): composed-primitive
6/// errors are converted explicitly at call sites via [`ColdStartError::Fetch`], so
7/// a partial round's outcomes are never silently collapsed.
8#[derive(Debug, thiserror::Error)]
9pub enum ColdStartError {
10    /// A round declared verify/probe slots but the cache has no storage batch
11    /// fetcher configured.
12    #[error("cold-start requires a storage batch fetcher")]
13    NoBatchFetcher,
14    /// The planner kept returning `Continue` past `max_rounds` executed rounds.
15    #[error("cold-start round budget exceeded ({max_rounds})")]
16    RoundBudgetExceeded {
17        /// The configured maximum number of executed rounds.
18        max_rounds: usize,
19    },
20    /// A composed fetch/call error, carrying the underlying cause explicitly.
21    #[error("cold-start fetch error: {0}")]
22    Fetch(anyhow::Error),
23}