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
feat: implement EIP-7685 #8053
Conversation
@@ -325,6 +326,8 @@ impl StorageInner { | |||
Some(calculate_excess_blob_gas(parent_excess_blob_gas, parent_blob_gas_used)) | |||
} | |||
|
|||
// todo: do we support requests root in auto-seal |
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
#[derive(Debug, Clone, PartialEq, Eq, Default, Hash, RlpEncodableWrapper, RlpDecodableWrapper)] | ||
pub struct Requests(pub Vec<Request>); |
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
@@ -727,6 +736,7 @@ impl<TX: DbTxMut + DbTx> DatabaseProvider<TX> { | |||
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
@@ -84,7 +84,7 @@ impl BlockBatchRecord { | |||
} | |||
|
|||
/// 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?
Adds types for EIP-7685, adds a new
Requests
table, and adjusts the code where appropriate.This still lacks:
Requests
in the bodies stageWill do these in separate PRs to unblock EIPs 6110 and 7002