reth icon indicating copy to clipboard operation
reth copied to clipboard

Add an example for fetching sidecars from mined 4844 transactions from the CL

Open mattsse opened this issue 1 year ago • 3 comments

Describe the feature

the payload the EL receives from CL does not include the sidecars of 4844 transactions, there's only a chance that the local txpool has them, but not guarantee that the pool has seen a mined 4844 tx.

the eth API has an endpoint for fetching sidecars:

https://ethereum.github.io/beacon-APIs/#/Beacon/getBlobSidecars

TODO

  • add an example that listens canonical_state and either fetches the blobs for mined 4844 transactions from the local pool, or requests them from the cl

similar to this example:

https://github.com/paradigmxyz/reth/blob/4fb5889aa9cad0028dda803c657f7b42cdd54ed4/examples/beacon-api-sse/src/main.rs#L28-L28

The CL API serialization is slightly different from EL, with stringified integers for example.

we already have some types for the eth2 API: https://github.com/paradigmxyz/reth/blob/4fb5889aa9cad0028dda803c657f7b42cdd54ed4/crates/rpc/rpc-types/src/beacon/mod.rs#L8-L8

we need missing request/response bindings, which can be easily generated via https://transform.tools/json-to-rust-serde

The ideal solution would be a reusable stream implementation that we can eventually move to a separate crate

Additional context

No response

mattsse avatar Apr 01 '24 21:04 mattsse

Will take this!

JackG-eth avatar Apr 01 '24 21:04 JackG-eth

FYI, Was away for a week but am working on this, should ship it soon.

JackG-eth avatar Apr 15 '24 09:04 JackG-eth

Very close to shipping!

JackG-eth avatar May 13 '24 08:05 JackG-eth

I believe this can now be closed, re: #7443. @mattsse

JackG-eth avatar May 30 '24 09:05 JackG-eth