bee icon indicating copy to clipboard operation
bee copied to clipboard

fix(transaction): implement EIP-1559 compliant fee calculation

Open gacevicljubisa opened this issue 8 months ago • 0 comments

Checklist

  • [x] I have read the coding guide.
  • [ ] My change requires a documentation update, and I have done it.
  • [ ] I have added tests to cover my changes.
  • [x] I have filled out the description and linked the related issues.

Description

This PR refactors the gas cost estimation to be fully EIP-1559 compliant. The previous implementation relied on the outdated legacy SuggestGasPrice method, which provided inaccurate estimates for the required gas funds.

  • suggestedFeeAndTip is modified
  • This function calculates an estimated transaction cost by using the latest block's baseFee and a suggested tip (SuggestGasTipCap).
  • the estimation uses a buffered baseFee plus the tip (gasFeeCap = (2 * baseFee) + gasTipCap)
  • SuggestGasPrice is removed from suggestedFeeAndTip

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

gacevicljubisa avatar Jun 17 '25 11:06 gacevicljubisa