-
Notifications
You must be signed in to change notification settings - Fork 947
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(evm): EIP-7002 withdrawal requests #8212
Conversation
198370e
to
602bd89
Compare
48f448f
to
dbfdbc8
Compare
…ithdrawal-requests
crates/ethereum/evm/src/execute.rs
Outdated
/// | ||
/// Returns an error if execution fails or receipt verification fails. | ||
fn execute_and_verify( | ||
&mut self, | ||
block: &BlockWithSenders, | ||
total_difficulty: U256, | ||
) -> Result<(Vec<Receipt>, u64), BlockExecutionError> { | ||
) -> Result<(Vec<Receipt>, Vec<Request>, u64), BlockExecutionError> { |
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.
can we add a type for this
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.
added
/// All the EIP-7685 requests of the transactions in the block. | ||
pub requests: 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.
this is fine for now
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.
how would you improve it?
Self { bundle, receipts, first_block } | ||
} | ||
} | ||
|
||
// TODO(mattsse): unify the types, currently there's a cyclic dependency between | ||
#[cfg(any(test, feature = "test-utils"))] |
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 still need this I believe
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.
yeah but it doesn't include the requests in the bundle state now, so for now I gated it behind the cfg and added a todo
…ithdrawal-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.
good start
crates/ethereum/evm/src/execute.rs
Outdated
Ok((receipts, cumulative_gas_used)) | ||
let withdrawal_requests = | ||
post_block_withdrawal_requests(&self.chain_spec, block.timestamp, evm)?; | ||
|
||
Ok((receipts, cumulative_gas_used, withdrawal_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.
TODO: we should convert this to a struct 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.
converted now
/// If Prague is not active at the given timestamp, then this is a no-op, and an empty vector is | ||
/// returned. Otherwise, the withdrawal requests are returned. | ||
#[inline] | ||
pub fn post_block_withdrawal_requests<EXT, DB: Database + DatabaseCommit>( |
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.
needs unit test but OK with moving fast
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.
gonna add it after we merge this PR
83139dd
to
0d9deb9
Compare
0d9deb9
to
f50b10c
Compare
…ithdrawal-requests
…ithdrawal-requests
…ithdrawal-requests
…ithdrawal-requests
/// Helper type for the output of executing a block. | ||
#[derive(Debug, Clone)] | ||
struct EthExecuteOutput { |
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 will combine this with the other output types separately
Implements the EIP-7002 post-block system contract call. Tests are pending, will be added in the next PR.