pub enum PoolOpenFailureReason {
InsufficientDeposit,
ContractRevert,
RpcError,
}Expand description
Which class of failure aborted a buyer openPool attempt (#966). Carried
through the anyhow error chain as typed context so the metrics layer can
bump the matching decdn_pool_open_failures_{reason}_total sibling
counter (one counter per class — a plain counter field carries no label dimension) and
attach a structured reason log field, while the human-readable message is
preserved for logs.
The sibling-counter shape is the settled convention (#1475), not a stopgap:
these three classes have unrelated operator remedies (fund the wallet / fix
the contract call / chase the RPC) and no meaningful aggregate — “how many
pool opens failed” is not a question with one answer or one response. decdn_probe_hold_unavailable_total is the one
labeled reason split, and it is labeled precisely because its values do
share one aggregate and one budget axis.
Variants§
InsufficientDeposit
The node’s USDC balance/allowance cannot cover the deposit; or the
deposit is zero — as requested, or as the received balance delta under
a fee-on-transfer token; or the credited deposit is below the
network’s minDeposit. An operator misconfiguration either way.
Metric label insufficient_deposit.
ContractRevert
Any other deterministic on-chain revert (the deposit was not escrowed).
Metric label contract_revert.
RpcError
A transient transport/RPC fault (no revert data) — submit or receipt
wait failed at the network layer. Metric label rpc_error.
Implementations§
Source§impl PoolOpenFailureReason
impl PoolOpenFailureReason
Sourcepub const fn as_label(self) -> &'static str
pub const fn as_label(self) -> &'static str
The metric/label and structured-log reason token for this class —
the {reason} slug in the decdn_pool_open_failures_{reason}_total
sibling counter name and the value of the structured-log reason field.
Sourcepub fn classify_revert_data(revert_data: Option<&Bytes>) -> Self
pub fn classify_revert_data(revert_data: Option<&Bytes>) -> Self
Classify the revert data (if any) attached to an openPool submit
(send()) error. None revert data is a transport/RPC fault; present
revert data is decoded against the insufficient-deposit error selectors
to split InsufficientDeposit from a generic ContractRevert.
Pass the result of alloy’s Error::as_revert_data() (an inherent method
on alloy_contract::Error); keeping the signature on raw bytes makes the
policy unit-testable without constructing a live RPC error.
Trait Implementations§
Source§impl Clone for PoolOpenFailureReason
impl Clone for PoolOpenFailureReason
impl Copy for PoolOpenFailureReason
Source§impl Debug for PoolOpenFailureReason
impl Debug for PoolOpenFailureReason
Source§impl Display for PoolOpenFailureReason
impl Display for PoolOpenFailureReason
impl Eq for PoolOpenFailureReason
Source§impl PartialEq for PoolOpenFailureReason
impl PartialEq for PoolOpenFailureReason
impl StructuralPartialEq for PoolOpenFailureReason
Auto Trait Implementations§
impl Freeze for PoolOpenFailureReason
impl RefUnwindSafe for PoolOpenFailureReason
impl Send for PoolOpenFailureReason
impl Sync for PoolOpenFailureReason
impl Unpin for PoolOpenFailureReason
impl UnsafeUnpin for PoolOpenFailureReason
impl UnwindSafe for PoolOpenFailureReason
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.