feat: add ETL to Hashing Stages (#7030)

This commit is contained in:
joshieDo
2024-03-26 17:48:35 +01:00
committed by GitHub
parent 1939939bc1
commit 96e39d29b9
5 changed files with 182 additions and 434 deletions

View File

@ -1,6 +1,7 @@
use super::setup;
use crate::utils::DbTool;
use eyre::Result;
use reth_config::config::EtlConfig;
use reth_db::{database::Database, table::TableImporter, tables, DatabaseEnv};
use reth_node_core::dirs::{ChainPath, DataDirPath};
use reth_node_ethereum::EthEvmConfig;
@ -106,12 +107,20 @@ async fn unwind_and_copy<DB: Database>(
)?;
// Bring hashes to TO
AccountHashingStage { clean_threshold: u64::MAX, commit_threshold: u64::MAX }
.execute(&provider, execute_input)
.unwrap();
StorageHashingStage { clean_threshold: u64::MAX, commit_threshold: u64::MAX }
.execute(&provider, execute_input)
.unwrap();
AccountHashingStage {
clean_threshold: u64::MAX,
commit_threshold: u64::MAX,
etl_config: EtlConfig::default(),
}
.execute(&provider, execute_input)
.unwrap();
StorageHashingStage {
clean_threshold: u64::MAX,
commit_threshold: u64::MAX,
etl_config: EtlConfig::default(),
}
.execute(&provider, execute_input)
.unwrap();
let unwind_inner_tx = provider.into_tx();

View File

@ -247,10 +247,10 @@ impl Command {
(Box::new(TransactionLookupStage::new(batch_size, etl_config, None)), None)
}
StageEnum::AccountHashing => {
(Box::new(AccountHashingStage::new(1, batch_size)), None)
(Box::new(AccountHashingStage::new(1, batch_size, etl_config)), None)
}
StageEnum::StorageHashing => {
(Box::new(StorageHashingStage::new(1, batch_size)), None)
(Box::new(StorageHashingStage::new(1, batch_size, etl_config)), None)
}
StageEnum::Merkle => (
Box::new(MerkleStage::default_execution()),