feat(cli): drop history stages (#2369)

This commit is contained in:
Roman Krasiuk
2023-04-25 00:31:24 +03:00
committed by GitHub
parent dbb0a35708
commit 21569180e1
2 changed files with 12 additions and 1 deletions

View File

@ -11,4 +11,5 @@ pub enum StageEnum {
Hashing,
Merkle,
TxLookup,
History,
}

View File

@ -14,7 +14,8 @@ use reth_db::{
use reth_primitives::ChainSpec;
use reth_staged_sync::utils::{chainspec::genesis_value_parser, init::insert_genesis_state};
use reth_stages::stages::{
ACCOUNT_HASHING, EXECUTION, MERKLE_EXECUTION, MERKLE_UNWIND, STORAGE_HASHING,
ACCOUNT_HASHING, EXECUTION, INDEX_ACCOUNT_HISTORY, INDEX_STORAGE_HISTORY, MERKLE_EXECUTION,
MERKLE_UNWIND, STORAGE_HASHING,
};
use std::sync::Arc;
use tracing::info;
@ -102,6 +103,15 @@ impl Command {
Ok::<_, eyre::Error>(())
})??;
}
StageEnum::History => {
tool.db.update(|tx| {
tx.clear::<tables::AccountHistory>()?;
tx.clear::<tables::StorageHistory>()?;
tx.put::<tables::SyncStage>(INDEX_ACCOUNT_HISTORY.0.to_string(), 0)?;
tx.put::<tables::SyncStage>(INDEX_STORAGE_HISTORY.0.to_string(), 0)?;
Ok::<_, eyre::Error>(())
})??;
}
_ => {
info!("Nothing to do for stage {:?}", self.stage);
}