feat(prune, stages): prune pipeline stage (#9419)

This commit is contained in:
Alexey Shekhirin
2024-07-11 20:18:56 +01:00
committed by GitHub
parent c31d69683d
commit b040b86a54
19 changed files with 416 additions and 79 deletions

View File

@ -71,6 +71,8 @@ pub struct StageConfig {
pub sender_recovery: SenderRecoveryConfig,
/// Execution stage configuration.
pub execution: ExecutionConfig,
/// Prune stage configuration.
pub prune: PruneStageConfig,
/// Account Hashing stage configuration.
pub account_hashing: HashingConfig,
/// Storage Hashing stage configuration.
@ -228,6 +230,20 @@ impl From<ExecutionConfig> for ExecutionStageThresholds {
}
}
/// Prune stage configuration.
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]
pub struct PruneStageConfig {
/// The maximum number of entries to prune before committing progress to the database.
pub commit_threshold: usize,
}
impl Default for PruneStageConfig {
fn default() -> Self {
Self { commit_threshold: 1_000_000 }
}
}
/// Hashing stage configuration.
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]