paradigmxyz / reth

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

Wrap BlobTransactionSideCar in Arcs in txpool #11460

Open mattsse opened 1 month ago

mattsse commented 1 month ago

Describe the feature

currently, we're cloning the sidecar in various places, which is pretty expensive, we also never modify these so we really should pass that around as an Arc.

this is pretty common and we should actually add a helper type like SharedBlobTransactionSidecar(Arc<BlobTransactionSidecar>) to alloy directly.

TODO

since this type is very simple, this can also added to reth so we don't need to wait until it lands in alloy.

e.g:

https://github.com/paradigmxyz/reth/blob/ac85fc0507b2300350cb0156461f23b7a641b06b/crates/transaction-pool/src/traits.rs#L405-L408

Additional context

No response

kdonthi commented 1 month ago

I would like to take this

mattsse commented 1 month ago

actually we can just use Arc<BlobTransactionSidecar> everywhere first

like we already do here:

https://github.com/paradigmxyz/reth/blob/0ce1dd6794a36c6cddab15a0b6d16f2195cd89df/crates/transaction-pool/src/traits.rs#L579-L579

we still want the helper type on alloy though

YashBit commented 1 month ago

@mattsse I am interested in some good first issues as well. But they always seem to be taken up quickly. Any other recommendations for issues which don't have the label, but might be relatively easier to get started with?