Skip to content

Commit

Permalink
feat: add ETL to Hashing Stages (paradigmxyz#7030)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo authored Mar 26, 2024
1 parent 1939939 commit 96e39d2
Show file tree
Hide file tree
Showing 5 changed files with 188 additions and 440 deletions.
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 @@ -859,10 +859,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

0 comments on commit 96e39d2

Please sign in to comment.