chore(stages): rewrite index history stage comments as doc (#2993)

This commit is contained in:
Alexey Shekhirin
2023-06-05 21:43:51 +04:00
committed by GitHub
parent 18b70f17f7
commit 50d325f1bc
2 changed files with 18 additions and 18 deletions

View File

@@ -92,15 +92,15 @@ impl<DB: Database> Stage<DB> for IndexAccountHistoryStage {
}
}
// The function proceeds as follows:
// 1. It first checks if the checkpoint has an `IndexHistoryCheckpoint` that matches the given
// block range. If it does, the function returns that checkpoint.
// 2. If the checkpoint's block range end matches the current checkpoint's block number, it creates
// a new `IndexHistoryCheckpoint` with the given block range and updates the progress with the
// current progress.
// 3. If none of the above conditions are met, it creates a new `IndexHistoryCheckpoint` with the
// given block range and calculates the progress by counting the number of processed entries in the
// `AccountChangeSet` table within the given block range.
/// The function proceeds as follows:
/// 1. It first checks if the checkpoint has an [IndexHistoryCheckpoint] that matches the given
/// block range. If it does, the function returns that checkpoint.
/// 2. If the checkpoint's block range end matches the current checkpoint's block number, it creates
/// a new [IndexHistoryCheckpoint] with the given block range and updates the progress with the
/// current progress.
/// 3. If none of the above conditions are met, it creates a new [IndexHistoryCheckpoint] with the
/// given block range and calculates the progress by counting the number of processed entries in the
/// [tables::AccountChangeSet] table within the given block range.
fn stage_checkpoint<DB: Database>(
tx: &Transaction<'_, DB>,
checkpoint: StageCheckpoint,

View File

@@ -94,15 +94,15 @@ impl<DB: Database> Stage<DB> for IndexStorageHistoryStage {
}
}
// The function proceeds as follows:
// 1. It first checks if the checkpoint has an `IndexHistoryCheckpoint` that matches the given
// block range. If it does, the function returns that checkpoint.
// 2. If the checkpoint's block range end matches the current checkpoint's block number, it creates
// a new `IndexHistoryCheckpoint` with the given block range and updates the progress with the
// current progress.
// 3. If none of the above conditions are met, it creates a new `IndexHistoryCheckpoint` with the
// given block range and calculates the progress by counting the number of processed entries in the
// `StorageChangeSet` table within the given block range.
/// The function proceeds as follows:
/// 1. It first checks if the checkpoint has an [IndexHistoryCheckpoint] that matches the given
/// block range. If it does, the function returns that checkpoint.
/// 2. If the checkpoint's block range end matches the current checkpoint's block number, it creates
/// a new [IndexHistoryCheckpoint] with the given block range and updates the progress with the
/// current progress.
/// 3. If none of the above conditions are met, it creates a new [IndexHistoryCheckpoint] with the
/// given block range and calculates the progress by counting the number of processed entries in the
/// [tables::StorageChangeSet] table within the given block range.
fn stage_checkpoint<DB: Database>(
tx: &Transaction<'_, DB>,
checkpoint: StageCheckpoint,