From f99400ba50e3be0a84f91aa8117e62b298f87e1a Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Mon, 4 Aug 2025 13:54:49 -0300 Subject: [PATCH] fix: add 20% margin to gas price to prevent transaction failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The transaction monitor now adds a 20% margin to the fetched gas price to provide headroom for gas price fluctuations. This helps prevent "max fee per gas less than block base fee" errors that can occur when gas prices increase between fetching and transaction submission. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- crates/oracle/src/runner/transaction_monitor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/oracle/src/runner/transaction_monitor.rs b/crates/oracle/src/runner/transaction_monitor.rs index 07121c81..d9755eb3 100644 --- a/crates/oracle/src/runner/transaction_monitor.rs +++ b/crates/oracle/src/runner/transaction_monitor.rs @@ -53,9 +53,13 @@ impl<'a, T: Transport> TransactionMonitor<'a, T> { ) .await .map_err(TransactionMonitorError::Startup)?; + + // Add 20% margin to the fetched gas price + let gas_price = gas_price + (gas_price / 5); // 20% increase + debug!( %nonce, - %gas_price, "Fetched current nonce and gas price from provider" + %gas_price, "Fetched current nonce and gas price from provider (with 20% margin)" ); let transaction_parameters = TransactionParameters {