PR: #41 (feat/executor: transaction builder + eth_call simulator)
File: crates/charon-executor/src/builder.rs — build_tx()
Refs #41
Problem
EIP-1559 requires max_fee_per_gas >= max_priority_fee_per_gas. build_tx accepts both as u128 with no validation:
pub async fn build_tx<P>(
&self,
provider: &P,
calldata: Bytes,
max_fee_per_gas: u128,
max_priority_fee_per_gas: u128,
gas_limit: u64,
) -> Result<TransactionRequest>
If a caller passes inverted values, alloy encodes the TransactionRequest successfully and sign() produces a valid signed envelope. The envelope is rejected by every BSC node at submission with "max priority fee per gas higher than max fee per gas". The error surfaces only at broadcast, not at build or sign time, making it a silent failure from the executor's perspective.
Fix
Add a guard at the start of build_tx:
if max_priority_fee_per_gas > max_fee_per_gas {
anyhow::bail!(
"max_priority_fee_per_gas ({max_priority_fee_per_gas}) > max_fee_per_gas ({max_fee_per_gas})"
);
}
PR: #41 (feat/executor: transaction builder + eth_call simulator)
File: crates/charon-executor/src/builder.rs — build_tx()
Refs #41
Problem
EIP-1559 requires max_fee_per_gas >= max_priority_fee_per_gas. build_tx accepts both as u128 with no validation:
If a caller passes inverted values, alloy encodes the TransactionRequest successfully and sign() produces a valid signed envelope. The envelope is rejected by every BSC node at submission with "max priority fee per gas higher than max fee per gas". The error surfaces only at broadcast, not at build or sign time, making it a silent failure from the executor's perspective.
Fix
Add a guard at the start of build_tx: