Skip to content

Commit

Permalink
feat: reth drop-stage merkle (paradigmxyz#1941)
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst authored Mar 23, 2023
1 parent d580b5a commit 1ce021f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/reth/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ impl Command {
BlockTransitionIndex,
TxTransitionIndex,
SyncStage,
SyncStageProgress,
Transactions
]);
}
Expand Down
12 changes: 12 additions & 0 deletions bin/reth/src/drop_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ impl Command {
Ok::<_, eyre::Error>(())
})??;
}
StageEnum::Merkle => {
tool.db.update(|tx| {
tx.clear::<tables::AccountsTrie>()?;
tx.clear::<tables::StoragesTrie>()?;
tx.put::<tables::SyncStageProgress>(
// TODO: Extract to constant in `TrieLoader` in trie/mod.rs
"TrieLoader".to_string(),
Vec::new(),
)?;
Ok::<_, eyre::Error>(())
})??;
}
_ => {
info!("Nothing to do for stage {:?}", self.stage);
}
Expand Down
1 change: 1 addition & 0 deletions bin/reth/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ enum StageEnum {
Bodies,
Senders,
Execution,
Merkle,
}

0 comments on commit 1ce021f

Please sign in to comment.