paradigmxyz / reth

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

Move more provider traits into storage-api crate #12478

Open mattsse opened 2 weeks ago

mattsse commented 2 weeks ago

Describe the feature

we still have a few traits defined in the reth-provider crate that are independent of reth-provider internals, like

https://github.com/paradigmxyz/reth/blob/e6a6fc4c2e188c71b6dc67e67549cf38d0bb1d46/crates/storage/provider/src/traits/history.rs#L10-L10

all of those should be moved to https://github.com/paradigmxyz/reth/blob/e6a6fc4c2e188c71b6dc67e67549cf38d0bb1d46/crates/storage/storage-api/Cargo.toml#L2-L2

ideally, trait by trait to make review easy. can be re-exported from reth-provider to not break a ton of stuff

Additional context

No response

PanGan21 commented 2 weeks ago

Hi @mattsse started with #12480 and I can continue on this depending on the recommended length of each pr!

mattsse commented 2 weeks ago

cool, ty!

PanGan21 commented 2 weeks ago

Which other traits do you think are relevant to this task?

mattsse commented 2 weeks ago

this one we can move as well

https://github.com/paradigmxyz/reth/blob/cef7ec80c13acac11ac4c2b93bf6bd19f4298d8c/crates/storage/provider/src/traits/header_sync_gap.rs#L31-L31

PanGan21 commented 1 week ago

I had a look again on this and it seems it is used here: https://github.com/paradigmxyz/reth/blob/cef7ec80c13acac11ac4c2b93bf6bd19f4298d8c/crates/storage/provider/src/providers/database/provider.rs#L1202

Do you still consider that it should be moved to storage-api crate?

mattsse commented 1 week ago

hmm, actually not sure about this one because this is kinda p2p, so we can keep this particular one for now

PanGan21 commented 1 week ago

hmm, actually not sure about this one because this is kinda p2p, so we can keep this particular one for now

Cool. What else do you think is necessary to resolve this ticket?