Summary
Per the repo convention established in PRs #28, #40, and #41, all library-boundary error types must be thiserror enums so callers can match on specific variants to determine routing: drop opportunity, retry, or abort pipeline. anyhow::Result erases variant identity.
For gas.rs the variants needed are:
MissingBaseFee — retry on next block (transient, not fatal)
CeilingExceeded — skip this tx (not an error condition at all)
Provider(e) — retry with backoff
Overflow — abort pipeline (invariant violation)
For nonce.rs:
Without variant discrimination, the executor pipeline treats all gas oracle failures identically. A transient RPC error halts the bot; a ceiling-exceeded event surfaces as an error log instead of a skip metric.
Files
crates/charon-executor/src/gas.rs
crates/charon-executor/src/nonce.rs
Fix
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum GasError {
#[error("baseFeePerGas absent from block header")]
MissingBaseFee,
#[error("provider error: {0}")]
Provider(#[from] alloy::transports::TransportError),
#[error("arithmetic overflow in gas calculation")]
Overflow,
}
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum NonceError {
#[error("provider error: {0}")]
Provider(#[from] alloy::transports::TransportError),
}
Verify thiserror is in the workspace Cargo.toml [workspace.dependencies] (flagged as missing in PR #40 Finding 4).
Refs #43
Summary
Per the repo convention established in PRs #28, #40, and #41, all library-boundary error types must be
thiserrorenums so callers can match on specific variants to determine routing: drop opportunity, retry, or abort pipeline.anyhow::Resulterases variant identity.For
gas.rsthe variants needed are:MissingBaseFee— retry on next block (transient, not fatal)CeilingExceeded— skip this tx (not an error condition at all)Provider(e)— retry with backoffOverflow— abort pipeline (invariant violation)For
nonce.rs:Provider(e)— retryWithout variant discrimination, the executor pipeline treats all gas oracle failures identically. A transient RPC error halts the bot; a ceiling-exceeded event surfaces as an error log instead of a skip metric.
Files
crates/charon-executor/src/gas.rscrates/charon-executor/src/nonce.rsFix
Verify
thiserroris in the workspaceCargo.toml[workspace.dependencies](flagged as missing in PR #40 Finding 4).Refs #43