Open mattsse opened 2 days ago
I'd like to work on this.
I'm running into a roadblock.
The create_reorg_head
function relies on the internals of the ExecutionPayloadRequest (which is being abstracted out). Specifically, it requires the ExecutionPayloadValidator<Spec>
to be coupled with the ExecutionPayloadRequest.
Currently, I have added an associated type to the EngineTypes
trait.
trait EngineTypes {
type ExecutionPayloadRequest;
}
One thing I could do is to add a dependency on Spec
for EngineTypes
. This way, we would be able to do the following:
trait EngineTypes<Spec> {
type ExecutionPayloadRequest: ExecutionPayloadRequest<Spec>;
}
trait ExecutionPayloadRequest<Spec> {
fn create_reorg_head(
self,
provider: &Provider,
evm_config: &Evm,
payload_validator: &ExecutionPayloadValidator<Spec>,
depth: usize,
) -> RethResult<Self>;
}
Or one alternative would be:
trait EngineTypes {
type Spec;
type ExecutionPayloadRequest: ExecutionPayloadRequest<Self::Spec>;
}
Would that be fine? Or am I missing an obvious thing.
Actually I havn't looked too much into it but it seems like Provider
and Evm
would both need to be coupled as well. Not sure what would the right thing be for this project.
Describe the feature
currently we have hardcoded the executionpayload type and sidecar:
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/engine/primitives/src/message.rs#L144-L148
ideally we want this to be configurable.
especially when we want to make custom block types work.
first step would be introducing an associated in the
EngineTypes
https://github.com/paradigmxyz/reth/blob/3408059393bcf03f6727f790ec52f28114e25d02/crates/engine/primitives/src/lib.rs#L33-L33
that encapsulates both, for example
type ExecutionPayloadRequest
and add a helper type that has the payload and sidecar as fields
Additional context
No response