reth
reth copied to clipboard
Add an example for fetching sidecars from mined 4844 transactions from the CL
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
Will take this!
FYI, Was away for a week but am working on this, should ship it soon.
Very close to shipping!
I believe this can now be closed, re: #7443. @mattsse