Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into alexey/exex-wal-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Oct 2, 2024
2 parents 9420e87 + e882d00 commit 850c1a1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion crates/exex/exex/src/wal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl WalInner {
}

let (removed_notifications, removed_size) = self.storage.remove_notifications(file_ids)?;
debug!(target: "exex::wak", ?removed_notifications, ?removed_size, "Storage was finalized");
debug!(?removed_notifications, ?removed_size, "Storage was finalized");

self.update_metrics(&block_cache, -(removed_size as i64));

Expand Down
12 changes: 6 additions & 6 deletions crates/exex/exex/src/wal/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ impl Storage {
/// # Returns
///
/// The size of the file that was removed in bytes, if any.
#[instrument(skip(self))]
#[instrument(target = "exex::wal::storage", skip(self))]
fn remove_notification(&self, file_id: u32) -> Option<u64> {
let path = self.file_path(file_id);
let size = path.metadata().ok()?.len();

match reth_fs_util::remove_file(self.file_path(file_id)) {
Ok(()) => {
debug!(target: "exex::wal::storage", "Notification was removed from the storage");
debug!("Notification was removed from the storage");
Some(size)
}
Err(err) => {
debug!(target: "exex::wal::storage", ?err, "Failed to remove notification from the storage");
debug!(?err, "Failed to remove notification from the storage");
None
}
}
Expand Down Expand Up @@ -108,14 +108,14 @@ impl Storage {
) -> impl Iterator<Item = eyre::Result<(u32, u64, ExExNotification)>> + '_ {
range.map(move |id| {
let (notification, size) =
self.read_notification(id)?.ok_or_eyre("notification {id} not found")?;
self.read_notification(id)?.ok_or_eyre("notification not found")?;

Ok((id, size, notification))
})
}

/// Reads the notification from the file with the given ID.
#[instrument(skip(self))]
#[instrument(target = "exex::wal::storage", skip(self))]
pub(super) fn read_notification(
&self,
file_id: u32,
Expand Down Expand Up @@ -144,7 +144,7 @@ impl Storage {
/// # Returns
///
/// The size of the file that was written in bytes.
#[instrument(skip(self, notification))]
#[instrument(target = "exex::wal::storage", skip(self, notification))]
pub(super) fn write_notification(
&self,
file_id: u32,
Expand Down
3 changes: 0 additions & 3 deletions crates/storage/db/src/static_file/mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ macro_rules! add_segments {
$(
#[doc = concat!("Mask for ", stringify!($segment), " static file segment. See [`Mask`] for more.")]
#[derive(Debug)]
// TODO: remove next attribute when nightly is fixed (ie. does
// not return wrong warnings for never constructed structs).
#[allow(dead_code)]
pub struct [<$segment Mask>]<FIRST, SECOND = (), THIRD = ()>(Mask<FIRST, SECOND, THIRD>);
)+
}
Expand Down
10 changes: 1 addition & 9 deletions crates/storage/provider/src/providers/blockchain_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,15 +821,7 @@ impl<N: ProviderNodeTypes> TransactionsProvider for BlockchainProvider2<N> {
self.get_in_memory_or_storage_by_tx(
id.into(),
|provider| provider.transaction_sender(id),
|tx_index, _, block_state| {
Ok(block_state
.block()
.block()
.body
.transactions
.get(tx_index)
.and_then(|transaction| transaction.recover_signer()))
},
|tx_index, _, block_state| Ok(block_state.block().senders.get(tx_index).copied()),
)
}
}
Expand Down

0 comments on commit 850c1a1

Please sign in to comment.