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

fix: remove sidecars when calling block_with_senders #70

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ impl<TX: DbTx> DatabaseProvider<TX> {
Vec<Address>,
Vec<Header>,
Option<Withdrawals>,
Option<BlobSidecars>,
Option<Requests>,
) -> ProviderResult<Option<B>>,
{
Expand Down Expand Up @@ -418,9 +417,8 @@ impl<TX: DbTx> DatabaseProvider<TX> {
})
.collect();

let sidecars = self.sidecars(&self.block_hash(block_number)?.unwrap_or_default())?;

construct_block(header, body, senders, ommers, withdrawals, sidecars, requests)
// the sidecars will always be None as this is not needed
construct_block(header, body, senders, ommers, withdrawals, requests)
}

/// Returns a range of blocks from the database.
Expand Down Expand Up @@ -1650,8 +1648,8 @@ impl<TX: DbTx> BlockReader for DatabaseProvider<TX> {
id,
transaction_kind,
|block_number| self.header_by_number(block_number),
|header, body, senders, ommers, withdrawals, sidecars, requests| {
Block { header, body, ommers, withdrawals, sidecars, requests }
|header, body, senders, ommers, withdrawals, requests| {
Block { header, body, ommers, withdrawals, sidecars: None, requests }
// Note: we're using unchecked here because we know the block contains valid txs
// wrt to its height and can ignore the s value check so pre
// EIP-2 txs are allowed
Expand All @@ -1671,8 +1669,8 @@ impl<TX: DbTx> BlockReader for DatabaseProvider<TX> {
id,
transaction_kind,
|block_number| self.sealed_header(block_number),
|header, body, senders, ommers, withdrawals, sidecars, requests| {
SealedBlock { header, body, ommers, withdrawals, sidecars, requests }
|header, body, senders, ommers, withdrawals, requests| {
SealedBlock { header, body, ommers, withdrawals, sidecars: None, requests }
// Note: we're using unchecked here because we know the block contains valid txs
// wrt to its height and can ignore the s value check so pre
// EIP-2 txs are allowed
Expand Down
Loading