rpc: update fee estimation RPCs to support EIP-1559 tools e.g. MetaMask #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #187, After #166.
As mentioned in #6 (comment), our price model (fixed
baseFee+ minimumeffectiveGasTip) will touch off RPC errors in MetaMask. Because it analyseseth_feeHistorydirectly and suggests aGasTipCaplower than we expected. This fallback is removed in MetaMask/core, but not yet the extension.To prevent this kind of issues in similar tools and libraries, this PR increases
suggestGasTipCapto 112.5% of the Policy limit, and sets it as the minimum return value ofeth_feeHistoryas well. (The corresponding multiplier of MetaMask ranges from 0.94 to 0.98, which is confusing but meanwhile the fact).The 12.5% increase in
suggestGasTipCapwill allow us to perform a 12.5% increase in gas tip Policy without rejecting existing transactions in txpool. As forbaseFee, a 100% increase is allowed with https://github.com/bane-labs/go-ethereum/blob/bane-main/accounts/abi/bind/base.go#L282.I know it seems much more correct to return the minimum
effectiveGasTipineth_feeHistoryinstead of 112.5% of it, but MetaMask doesn't work with it. :(