-
Notifications
You must be signed in to change notification settings - Fork 1
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
[wip]: BlockExecutor
#1
base: main
Are you sure you want to change the base?
Conversation
2184951
to
5540708
Compare
5540708
to
8a9da44
Compare
EvmF: EvmFactory<Evm: Evm<Tx: From<T>>>, | ||
ReceiptB: ReceiptBuilder<T, <EvmF::Evm as Evm>::Outcome>, | ||
{ | ||
type Input = alloy_consensus::Block<T>; |
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 should perhaps consider adding some convenience type here so that we can accept any block variant, e.g. with recovered senders.
or we require it recovered as input
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.
Think API wise you want the block to be either type, and if it's not recovered it should do the recovery for you -- so probably a T: Into RecoveredBlock?
|
||
impl<EvmF, ReceiptB, T> BlockExecutor for EthBlockExecutor<EvmF, ReceiptB, T> | ||
where | ||
EvmF: EvmFactory<Evm: Evm<Tx: From<T>>>, |
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 could be problematic where tx is like TxEnvelope
because we still need to do recovery
pub trait BlockExecutor { | ||
/// Input for the block execution. | ||
type Input: BlockExecutionInput; | ||
|
||
/// Outcome of the block execution. | ||
type Output: BlockExecutionOutcome; | ||
|
||
/// Errors that can occur during block execution. | ||
type Error; | ||
|
||
fn execute(&mut self, input: Self::Input) -> Result<Self::Output, Self::Error>; | ||
} |
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.
cool, yep I think this is it.
pretty simple and should allow for any kind of restrictions that may be necessary
} | ||
} | ||
|
||
impl<T> BlockExecutionInput for alloy_consensus::Block<T> { |
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.
Note: this should still support somebody adding a custom block executor, say, enforcing inclusion lists from the header
Motivation
Solution
PR Checklist