paradigmxyz / reth

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

Unify Alloy and Reth EIP-4844 types #8063

Open shekhirin opened 2 months ago

shekhirin commented 2 months ago

Describe the feature

When using foundry-blob-explorers with Reth types, a bunch of type conversion shenanigans are needed https://github.com/paradigmxyz/reth/blob/fd2ade5013b82f87f9d2f990eb6748743582b15f/examples/exex/rollup/src/execution.rs#L140-L147

I believe it's due to type duplication between Alloy and Reth.

Additional context

No response

mattsse commented 2 months ago

@prestwich in alloy we have different blob types depending on the features:

https://github.com/alloy-rs/alloy/blob/c6329d5680467f0a47fc5e99f0f278eebb09e461/crates/consensus/src/transaction/eip4844.rs#L22-L31

should we stick to alloy_primitives and instead do a transmute in c-kzg validation?

https://github.com/alloy-rs/alloy/blob/c6329d5680467f0a47fc5e99f0f278eebb09e461/crates/consensus/src/transaction/eip4844.rs#L474-L479

then we could also easily move the sidecar type to the eips crate

prestwich commented 2 months ago

relevant issue:

https://github.com/alloy-rs/alloy/issues/402

as stated there, i would prefer to always use alloy-primitives, and transmute in verification

mattsse commented 2 months ago

nice, on it!