-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement eth_feeHistory API #2309
Comments
The latest release of Besu includes this btw |
@banteg, yep, need somebody who will implement it (probably copy-paste from geth is enough). |
This can be closed, correct? |
Yep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rationale
Why should this feature exist?
The eth_feeHistory API was recently introduced in the JSON-RPC spec as a counterpart to EIP1559, which is currently live on Ropsten & Goerli and is scheduled for mainnet at block 12965000.
The API exposes information that is useful for setting parameters for the new transaction fee mechanism. One main rationale for EIP1559 is to improve the transaction-sending user experience. Wallet designers seeking to implement a change to deliver the improved user experience will need to have access to that information.
Together, a wallet and user must select two parameters,
maxPriorityFeePerGas
andmaxFeePerGas
. If the API was implemented on Erigon it would allow for rational selection of those two parameters using an Erigon node. Otherwise, another source of information might be needed.This API might remove the need for third party gas price oracles, increasing users autonomy and rewarding those who run an Erigon node.
What are the use-cases?
maxFeePerGas
). For example, a wallet might choose a maximum fee that is twice the base fee.maxPriorityFeePerGas
). For example, a wallet might choose the gas premium that was the lowest accepted in the last block, or the average of some percentile that matches user preference.A range of wallet-related resources are here. I also made some notes on what the API could enable for a wallet UI here.
Implementation
I am making this issue primarily to raise awareness about the API and the ecosystem it might support. While not strictly required before the Mainnet hard fork, there might be a dependency graph:
I will not be implementing the API, but hope to instead be useful in the process if I can.
API notes
Here is a digest that I have made using the JSON-RPC spec, which outlines the key components used in the API POST method.
blockCount
single query. Less than requested may be returned if not all blocks are available."
str(hex(25)) = "0x19"
.newestBlock
str(hex(5093543)) = "0x4db8a7"
.rewardPercentiles
effective priority fees per gas in ascending order, weighted by gas used."
The text was updated successfully, but these errors were encountered: