Skip to content

fix: improve Gas Fee Estimation by Integrating Filecoin's EIP-1559-Compatible APIs#1182

Merged
karlem merged 7 commits intomainfrom
review-premium-estimate
Nov 25, 2024
Merged

fix: improve Gas Fee Estimation by Integrating Filecoin's EIP-1559-Compatible APIs#1182
karlem merged 7 commits intomainfrom
review-premium-estimate

Conversation

@karlem
Copy link
Copy Markdown
Contributor

@karlem karlem commented Oct 23, 2024

Close #1175
Close #982

This PR updates our gas fee estimation to leverage the eth_maxPriorityFeePerGas and eth_getBlockByNumber (to retrieve the current base_fee_per_gas from the latest mined block) API calls, using Eth-standard APIs available through Filecoin. Since Filecoin supports EIP-1559, these calls are fully compatible with Filecoin's implementation, aligning with standard EVM practices and ensuring interoperability across EVM chains.

Key Changes:

  • The max_priority_fee_per_gas() and base_fee_per_gas() functions retrieve gas fee estimates based on Filecoin's adherence to EIP-1559.
  • Gas fee calculation buffers the base fee with a multiplier of 2 to accommodate potential cumulative increases, aligning with the 12.5% maximum cap on base fee growth per block. By doubling the base fee, we account for possible surges in consecutive blocks, ensuring that estimates remain responsive to rapid market changes while providing a buffer for handling block-to-block volatility.

This approach simplifies our fee estimation logic by utilizing available EIP-1559-compatible APIs, improving chances of capturing better gas market dynamics on specific networks (Filecoin in this case) to increase chance of fast transaction inclusion within a block.

@karlem karlem changed the title feat: use estimation from Alloy feat: align wi Oct 25, 2024
@karlem karlem changed the title feat: align wi feat: align with Filecoin implementation Oct 25, 2024
@karlem karlem changed the title feat: align with Filecoin implementation Improve Gas Fee Estimation by Integrating Filecoin's EIP-1559-Compatible APIs Oct 25, 2024
@karlem karlem changed the title Improve Gas Fee Estimation by Integrating Filecoin's EIP-1559-Compatible APIs fix: improve Gas Fee Estimation by Integrating Filecoin's EIP-1559-Compatible APIs Oct 28, 2024
@karlem karlem marked this pull request as ready for review October 28, 2024 13:22
@karlem karlem requested a review from a team as a code owner October 28, 2024 13:22
@karlem karlem self-assigned this Oct 28, 2024
@karlem karlem requested a review from cryptoAtwill November 14, 2024 13:33
@karlem karlem force-pushed the review-premium-estimate branch from 42faf3b to 68287d5 Compare November 20, 2024 12:03
@karlem karlem merged commit bcc73c9 into main Nov 25, 2024
@karlem karlem deleted the review-premium-estimate branch November 25, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Review ipc-cli gas parameters ipc relayer uses fixed gas parameters

2 participants