Skip to content

[executor] fetch_params Ok(None) skip-signal is leaky — silent drop risk on future refactor #188

@obchain

Description

@obchain

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.rsfetch_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlayer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p1-coreCore MVP scopestatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions