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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joshieDo
Copy link
Collaborator

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

for StaticFileSegment::BlockMeta

@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
Comment on lines +159 to +162
let block_range = inputs
.first()
.and_then(|(first, _)| inputs.last().map(|(last, _)| first.number()..=last.number()))
.expect("qed");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

is this fair to assume? that the vec is always ordered?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that should always hold, yes

@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?

Comment on lines +159 to +162
let block_range = inputs
.first()
.and_then(|(first, _)| inputs.last().map(|(last, _)| first.number()..=last.number()))
.expect("qed");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that should always hold, yes

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