chore: refactor DefaultStages to take StageConfig (#8173)

This commit is contained in:
joshieDo
2024-05-12 12:38:34 +01:00
committed by GitHub
parent 487f7e302b
commit d9f9504dbd
17 changed files with 245 additions and 223 deletions

View File

@ -96,6 +96,19 @@ pub struct StageConfig {
pub etl: EtlConfig,
}
impl StageConfig {
/// The highest threshold (in number of blocks) for switching between incremental and full
/// calculations across `MerkleStage`, `AccountHashingStage` and `StorageHashingStage`. This is
/// required to figure out if can prune or not changesets on subsequent pipeline runs during
/// `ExecutionStage`
pub fn execution_external_clean_threshold(&self) -> u64 {
self.merkle
.clean_threshold
.max(self.account_hashing.clean_threshold)
.max(self.storage_hashing.clean_threshold)
}
}
/// Header stage configuration.
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq, Serialize)]
#[serde(default)]