mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-27 16:18:08 -05:00
docs: document Options in get_highest_* and ensure_invariants (#9529)
This commit is contained in:
@@ -646,8 +646,13 @@ impl StaticFileProvider {
|
||||
/// * its highest block should match the stage checkpoint block number if it's equal or higher
|
||||
/// than the corresponding database table last entry.
|
||||
/// * If the checkpoint block is higher, then request a pipeline unwind to the static file
|
||||
/// block.
|
||||
/// * If the checkpoint block is lower, then heal by removing rows from the static file.
|
||||
/// block. This is expressed by returning [`Some`] with the requested pipeline unwind
|
||||
/// target.
|
||||
/// * If the checkpoint block is lower, then heal by removing rows from the static file. In
|
||||
/// this case, the rows will be removed and [`None`] will be returned.
|
||||
///
|
||||
/// * If the database tables overlap with static files and have contiguous keys, or the
|
||||
/// checkpoint block matches the highest static files block, then [`None`] will be returned.
|
||||
fn ensure_invariants<TX: DbTx, T: Table<Key = u64>>(
|
||||
&self,
|
||||
provider: &DatabaseProvider<TX>,
|
||||
@@ -736,11 +741,15 @@ impl StaticFileProvider {
|
||||
}
|
||||
|
||||
/// Gets the highest static file block if it exists for a static file segment.
|
||||
///
|
||||
/// If there is nothing on disk for the given segment, this will return [`None`].
|
||||
pub fn get_highest_static_file_block(&self, segment: StaticFileSegment) -> Option<BlockNumber> {
|
||||
self.static_files_max_block.read().get(&segment).copied()
|
||||
}
|
||||
|
||||
/// Gets the highest static file transaction.
|
||||
///
|
||||
/// If there is nothing on disk for the given segment, this will return [`None`].
|
||||
pub fn get_highest_static_file_tx(&self, segment: StaticFileSegment) -> Option<TxNumber> {
|
||||
self.static_files_tx_index
|
||||
.read()
|
||||
|
||||
Reference in New Issue
Block a user