Skip to content

fix: add 20% margin to gas price to prevent transaction failures#270

Merged
pcarranzav merged 1 commit intomainfrom
fix/gas-price-margin
Aug 8, 2025
Merged

fix: add 20% margin to gas price to prevent transaction failures#270
pcarranzav merged 1 commit intomainfrom
fix/gas-price-margin

Conversation

@pcarranzav
Copy link
Member

Summary

  • Adds a 20% margin to the fetched gas price in the transaction monitor
  • Prevents "max fee per gas less than block base fee" errors during gas price fluctuations

Problem

The correct-last-epoch command was failing with gas price errors when the network's base fee increased between fetching the gas price and submitting the transaction. The transaction monitor was using the exact fetched gas price without any margin for fluctuations.

Solution

Added a 20% margin to the fetched gas price (gas_price + gas_price/5) to provide headroom for gas price increases during transaction processing.

Test plan

  • Build the oracle with cargo build --release
  • Run the correct-last-epoch command on a network with fluctuating gas prices
  • Verify that transactions no longer fail with "max fee per gas less than block base fee" errors

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@pcarranzav pcarranzav merged commit f58019b into main Aug 8, 2025
5 checks passed
@pcarranzav pcarranzav deleted the fix/gas-price-margin branch August 8, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants