-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: main
Are you sure you want to change the base?
Conversation
let block_range = inputs | ||
.first() | ||
.and_then(|(first, _)| inputs.last().map(|(last, _)| first.number()..=last.number())) | ||
.expect("qed"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
/// Returns the withdrawals per block within the requested block range. | ||
fn withdrawals_by_block_range( | ||
&self, | ||
range: RangeInclusive<BlockNumber>, | ||
) -> ProviderResult<Vec<Withdrawals>>; |
There was a problem hiding this comment.
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?
let block_range = inputs | ||
.first() | ||
.and_then(|(first, _)| inputs.last().map(|(last, _)| first.number()..=last.number())) | ||
.expect("qed"); |
There was a problem hiding this comment.
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
Allows using it on
read_block_bodies
with the provider, and not rely solely on DB cursorsfor
StaticFileSegment::BlockMeta