Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 <[email protected]>
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