Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add WithdrawalsProvider::withdrawals_by_block_range #13877

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joshieDo
Copy link
Collaborator

@joshieDo joshieDo commented Jan 20, 2025

Allows using it on read_block_bodies with the provider, and not rely solely on DB cursors

for StaticFileSegment::BlockMeta

on top of #13894

@joshieDo joshieDo added C-enhancement New feature or request A-db Related to the database A-static-files Related to static files labels Jan 20, 2025
@joshieDo joshieDo requested review from mattsse and klkvr January 20, 2025 13:18
@joshieDo joshieDo marked this pull request as draft January 20, 2025 13:22
Comment on lines 16 to 20
/// Returns the withdrawals per block within the requested block range.
fn withdrawals_by_block_range(
&self,
range: RangeInclusive<BlockNumber>,
) -> ProviderResult<Vec<Withdrawals>>;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is return vec here problematic for pre withdrawals blocks?

crates/storage/storage-api/src/chain.rs Show resolved Hide resolved
@joshieDo joshieDo force-pushed the joshie/withdrawalsrange branch from 17dee72 to 4cfdb9b Compare January 20, 2025 23:30
@joshieDo joshieDo changed the base branch from main to joshie/sfw January 20, 2025 23:30
@joshieDo joshieDo force-pushed the joshie/withdrawalsrange branch from 4cfdb9b to a8f9e52 Compare January 20, 2025 23:45
@joshieDo joshieDo marked this pull request as ready for review January 20, 2025 23:46
@joshieDo joshieDo force-pushed the joshie/withdrawalsrange branch from a8f9e52 to 980e4ad Compare January 20, 2025 23:50
@joshieDo joshieDo force-pushed the joshie/withdrawalsrange branch from 980e4ad to 6e86a4f Compare January 20, 2025 23:52
@joshieDo joshieDo force-pushed the joshie/withdrawalsrange branch 2 times, most recently from e0a84a4 to 26394df Compare January 21, 2025 00:27
Comment on lines 169 to 170
for ((header, transactions), withdrawals) in
inputs.into_iter().zip(provider.withdrawals_by_block_range(block_range)?)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice, now we no longer need the shanghai check

Base automatically changed from joshie/sfw to main January 21, 2025 13:38
@joshieDo joshieDo force-pushed the joshie/withdrawalsrange branch from 26394df to 7f32447 Compare January 21, 2025 20:40
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

I realize that we only have to do this for eth, so we could add a dedicated chainstorage impl for optimism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database A-static-files Related to static files C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants