Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ETL to Hashing Stages #7030

Merged
merged 12 commits into from
Mar 26, 2024
21 changes: 15 additions & 6 deletions bin/reth/src/commands/stage/dump/merkle.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions bin/reth/src/commands/stage/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
2 changes: 2 additions & 0 deletions crates/node-core/src/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,10 +863,12 @@ impl NodeConfig {
.set(AccountHashingStage::new(
stage_config.account_hashing.clean_threshold,
stage_config.account_hashing.commit_threshold,
stage_config.etl.clone(),
))
.set(StorageHashingStage::new(
stage_config.storage_hashing.clean_threshold,
stage_config.storage_hashing.commit_threshold,
stage_config.etl.clone(),
))
.set(MerkleStage::new_execution(stage_config.merkle.clean_threshold))
.set(TransactionLookupStage::new(
Expand Down
Loading
Loading