-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: implement EIP-7685 #8053
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
feat: implement EIP-7685 #8053
Conversation
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.
Just leave it empty
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.
smol nit
crates/primitives/src/request.rs
Outdated
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.
we're missing a few helper impls but this is ok
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.
will add before merge to main
81f39e4 to
be76a64
Compare
| let block_ommers = self.get_or_take::<tables::BlockOmmers, TAKE>(range.clone())?; | ||
| let block_withdrawals = | ||
| self.get_or_take::<tables::BlockWithdrawals, TAKE>(range.clone())?; | ||
| let block_requests = self.get_or_take::<tables::BlockRequests, TAKE>(range.clone())?; |
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.
still dont love this get/take function we should investigate fixing later
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.
agree
| // note(onbjerg): the rpc spec has not been changed to include requests, so for now we just | ||
| // set these to empty | ||
| let (requests, requests_root) = | ||
| if chain_spec.is_prague_active_at_timestamp(block_env.timestamp.to::<u64>()) { | ||
| (Some(Requests::default()), Some(EMPTY_ROOT_HASH)) | ||
| } else { | ||
| (None, None) | ||
| }; | ||
|
|
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.
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.
the pr is for the engine api, this code snippet is for regular rpc which does not have any changes currently
|
|
||
| /// Returns all recorded requests. | ||
| pub fn take_requests(&mut self) -> Requests { | ||
| pub fn take_requests(&mut self) -> Vec<Requests> { |
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.
I think we start having a lot of these Vec<Vec<_>> outer / inner vecs so maybe we should do a generic Batch<T> to encapsulate that
| // HACK(onbjerg): we need this to always set `requests` to `None` since we might otherwise generate | ||
| // a block with `None` withdrawals and `Some` requests, in which case we end up trying to decode the | ||
| // requests as withdrawals |
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.
this seems fine, not a hack?
Co-authored-by: Alexey Shekhirin <[email protected]>
Adds types for EIP-7685, adds a new
Requeststable, and adjusts the code where appropriate.This still lacks:
Requestsin the bodies stageWill do these in separate PRs to unblock EIPs 6110 and 7002