Skip to content

Commit

Permalink
clarify docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhirin committed Sep 29, 2024
1 parent 258315a commit 63fc2e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions crates/exex/exex/src/wal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ impl Wal {
self.inner.commit(notification)
}

/// Finalizes the WAL to the given block, inclusive.
/// Finalizes the WAL up to the given canonical block, inclusive.
///
/// 1. Finds a notification with first unfinalized block (first notification containing a
/// committed block higher than `to_block`).
/// 2. Removes the notifications from the beginning of WAL until the found notification. If this
/// notification includes both finalized and non-finalized blocks, it will not be removed.
/// The caller should check that all ExExes are on the canonical chain and will not need any
/// blocks from the WAL below the provided block, inclusive.
pub fn finalize(&self, to_block: BlockNumHash) -> eyre::Result<()> {
self.inner.finalize(to_block)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/exex/exex/src/wal/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl Storage {
})
}

/// Reads the notification from the file with the given id.
/// Reads the notification from the file with the given ID.
#[instrument(target = "exex::wal::storage", skip(self))]
pub(super) fn read_notification(&self, file_id: u64) -> eyre::Result<Option<ExExNotification>> {
let file_path = self.file_path(file_id);
Expand All @@ -120,7 +120,7 @@ impl Storage {
Ok(serde_json::from_reader(&mut file)?)
}

/// Writes the notification to the file with the given id.
/// Writes the notification to the file with the given ID.
#[instrument(target = "exex::wal::storage", skip(self, notification))]
pub(super) fn write_notification(
&self,
Expand Down

0 comments on commit 63fc2e8

Please sign in to comment.