paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.91k stars 1.14k forks source link

Introduce new that represents the variants of all versioned payload types #11748

Closed mattsse closed 1 week ago

mattsse commented 1 week ago

Describe the feature

currently both op and eth have the same payload types,

https://github.com/paradigmxyz/reth/blob/5e386130da0b123e107f5eb5a9a3a3622bc50129/crates/engine/primitives/src/lib.rs#L34-L35

hence we're able to do use:

https://github.com/paradigmxyz/reth/blob/5e386130da0b123e107f5eb5a9a3a3622bc50129/crates/payload/primitives/src/payload.rs#L8-L11

with https://github.com/alloy-rs/alloy/pull/1480 this will no longer be the case and we need helpers to make this work

TODO

enum ExecutionPayload<T: EngineTypes> {
 V1(T::ExecutionPayloadV1),
 ...
}
// and a ref type that takes &'a as variant values
enum ExecutionPayloadRef

ref https://github.com/alloy-rs/alloy/pull/1480 cc @cody-wang-cb

Additional context

No response

PanGan21 commented 1 week ago

Nice, it seems though that if EngineTypes is imported in reth-payload-primitives there will be a cyclic dependency issue. What would be a good way to work around this issue?

YashBit commented 1 week ago

@mattsse Please can you assign this to me.

mattsse commented 1 week ago

actually I got it wrong and have to close this because I mixed up envelope types with payload types