Summary
fetch_params returns Ok(None) when the computed max_fee exceeds the configured ceiling. This overloads Option with two semantically different meanings: None = deliberate skip vs Some(params) = proceed.
The ? operator propagates Err but passes None through silently. A future refactor that adds .map() or ? on the returned Option converts a deliberate skip into a swallowed event: no log line, no Prometheus counter, no error. The pipeline silently drops the opportunity with no observable signal.
CeilingExceeded is a normal operational condition, not an error. Modelling it as Ok(None) conflates the "no result" semantic of Option with a domain decision.
File
crates/charon-executor/src/gas.rs — fetch_params() return type
Fix
Return a dedicated decision enum:
pub enum GasDecision {
Proceed(GasParams),
SkipCeilingExceeded { max_fee_gwei: u64, ceiling_gwei: u64 },
}
pub async fn fetch_params(...) -> Result<GasDecision, GasError>
The call site must explicitly match both variants. SkipCeilingExceeded should emit a debug! log and increment a charon_gas_ceiling_skip_total Prometheus counter.
Refs #43
Summary
fetch_paramsreturnsOk(None)when the computedmax_feeexceeds the configured ceiling. This overloadsOptionwith two semantically different meanings:None= deliberate skip vsSome(params)= proceed.The
?operator propagatesErrbut passesNonethrough silently. A future refactor that adds.map()or?on the returnedOptionconverts a deliberate skip into a swallowed event: no log line, no Prometheus counter, no error. The pipeline silently drops the opportunity with no observable signal.CeilingExceededis a normal operational condition, not an error. Modelling it asOk(None)conflates the "no result" semantic ofOptionwith a domain decision.File
crates/charon-executor/src/gas.rs—fetch_params()return typeFix
Return a dedicated decision enum:
The call site must explicitly match both variants.
SkipCeilingExceededshould emit adebug!log and increment acharon_gas_ceiling_skip_totalPrometheus counter.Refs #43