-
Notifications
You must be signed in to change notification settings - Fork 328
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
eth_feeHistory Implementation #204
Conversation
This is a good start. I do however think that we shouldn't trust the rest of response given that just part of it is provably correct. You can imagine attacks where an RPC sends correct base fees, but wildly high priority fees to trick Helios users into sending transactions with a high priority fee. They could then auction that artificially valuable transaction off to a miner using something like flashbots. We should however be able to implement this method without needing any trust at all. Since Helios has past Does this strategy make sense? |
Hey guys, Tried my best but unfortunately computing the reward parameters ourselves has quite some overhead (can push on another branch if needed, just let me know). As can be seen with reth, some client actually don't give an answer for this parameter. I tried though, and unfortunately amount of request quickly starts going out of hand. Indeed, you need the gas_used parameter per transaction to accumulate it until you reach the gas_used percentile, at which point you can return the gas paid for that specific transaction. Ultimately, what that means is that you need to get the receipt for every transaction in each block queried as there is no other way to get the gas used (practical way at least, not planning to track opcode raised for that endpoint 😬 ) ... If there was a way to prove that the content was correct without querying it ourselves (wink wink zero-knowledge proof), it would make getting that list possible. Maybe we can follow reth for now and re-assess later on? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor changes requested. Overall, very nice work!
Co-authored-by: refcell.eth <abigger87@gmail.com>
Co-authored-by: refcell.eth <abigger87@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice!
Hey @sfyll, merging into a fee_history branch in the |
Implement eth_feeHistory as requested in #200 .
Veracity check on public RPC response done by comparing the response's base fee per gas with the local view provided by the
ExecutionPayload
object. This approach has two main corollaries:get_fee_history
inexecution/src/execution.rs
function checks the parameters and discards blocks that are not stored (and as such "validated") inExecutionPayload
. That makes returned values slightly less deterministic than one might have hoped, but seem in line with Alchemy's.Given that the most insightful test were done by impersonating the user, i.e. putting in place integration tests, these were implemented in a new directory
tests/
.Please note that this is my first PR into a public project + first time coding in Rust. So feel free to go heavy on the changes !