Skip to content

[executor] priority_fee_gwei to wei conversion missing — 1 gwei sent as 1 wei, txs never mined #186

@obchain

Description

@obchain

Summary

ChainConfig adds priority_fee_gwei: u64 (default 1). When gas.rs constructs the maxPriorityFeePerGas field of the EIP-1559 transaction envelope, it must multiply this value by 1,000,000,000 (1 gwei in wei) before passing it to alloy's TransactionRequest.

If the value is passed as U256::from(chain_cfg.priority_fee_gwei) without the multiplication, the priority fee is 1 wei — more than nine orders of magnitude below the BSC validator minimum of 1 gwei (1,000,000,000 wei). BSC validators will not prioritise or include the tx.

There is no compile-time or runtime error. The tx enters the mempool and stays stuck indefinitely. The only observable signal is the absence of included txs — indistinguishable from the base-fee headroom case without inspecting the mempool entry's maxPriorityFeePerGas field directly.

File

crates/charon-executor/src/gas.rsfetch_params() (construction of GasParams)

Fix

let priority_fee_wei = U256::from(chain_cfg.priority_fee_gwei)
    .checked_mul(U256::from(1_000_000_000u64))
    .ok_or(GasError::Overflow)?;

Add a unit test: assert_eq!(priority_fee_wei(1), U256::from(1_000_000_000u64)).

Refs #43

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer: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