arbos/l1_pricing/
error.rs

1use arb_storage::StorageError;
2
3use crate::address_set::AddressSetError;
4
5/// Errors raised by the L1 pricing subsystem (batch poster table and update
6/// model).
7#[derive(Clone, thiserror::Error, Debug)]
8pub enum L1PricingError {
9    /// Underlying storage failure.
10    #[error(transparent)]
11    Storage(#[from] StorageError),
12
13    /// The batch-poster table is backed by an [`AddressSet`], so its lookup
14    /// failures surface here.
15    #[error(transparent)]
16    AddressSet(#[from] AddressSetError),
17
18    /// `open_poster(create_if_not_exist=false)` was called with an unknown
19    /// address.
20    #[error("batch poster not found")]
21    BatchPosterNotFound,
22
23    /// `add_poster` was called with an address that is already a poster.
24    #[error("batch poster already exists")]
25    BatchPosterAlreadyExists,
26
27    /// `set_parent_gas_floor_per_token` requires ArbOS v50 or later.
28    #[error("parent gas floor is unsupported before ArbOS v50")]
29    ParentGasFloorUnsupportedVersion,
30
31    /// `update_for_batch_poster_spending` was called with a time outside the
32    /// monotonic window `[last_update_time, current_time]`.
33    #[error("invalid update time")]
34    InvalidUpdateTime,
35}