Skip to content
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

Add fee history API #300

Merged

Conversation

uprendis
Copy link
Contributor

@uprendis uprendis commented May 5, 2022

Add a version of eth_feeHistory API call from web3 API. Due to the DAG consensus, estimating fee based on a history of recent blocks is a flawed approach. Thus, the method returns an estimation of fee tip depending on provided percentiles, instead of an actual history

@uprendis uprendis requested review from hadv, cyberbono3 and rus-alex May 5, 2022 15:15
@uprendis uprendis requested a review from andrecronje as a code owner May 5, 2022 15:15
tips = append(tips, (*hexutil.Big)(scaledTip))
}
res.OldestBlock.ToInt().SetUint64(uint64(oldest))
for i := uint64(0); i < uint64(last-oldest+1); i++ {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we just keep it only to compatibility with EIP-1559 API but actually the values are the same for all blocks in range?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, exactly

@uprendis uprendis merged commit 5b887fd into Fantom-foundation:develop May 5, 2022
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