Skip to content

Commit f58019b

Browse files
authored
Merge pull request #270 from graphprotocol/fix/gas-price-margin
fix: add 20% margin to gas price to prevent transaction failures
2 parents 158234c + f99400b commit f58019b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

crates/oracle/src/runner/transaction_monitor.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ impl<'a, T: Transport> TransactionMonitor<'a, T> {
5353
)
5454
.await
5555
.map_err(TransactionMonitorError::Startup)?;
56+
57+
// Add 20% margin to the fetched gas price
58+
let gas_price = gas_price + (gas_price / 5); // 20% increase
59+
5660
debug!(
5761
%nonce,
58-
%gas_price, "Fetched current nonce and gas price from provider"
62+
%gas_price, "Fetched current nonce and gas price from provider (with 20% margin)"
5963
);
6064

6165
let transaction_parameters = TransactionParameters {

0 commit comments

Comments
 (0)