mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
feat(storage, tree): respect Transaction Lookup pruning in the blockchain tree (#4410)
This commit is contained in:
@ -193,7 +193,7 @@ impl Command {
|
||||
let provider_rw = factory.provider_rw()?;
|
||||
|
||||
// Insert block, state and hashes
|
||||
provider_rw.insert_block(block.clone(), None)?;
|
||||
provider_rw.insert_block(block.clone(), None, None)?;
|
||||
block_state.write_to_db(provider_rw.tx_ref(), block.number)?;
|
||||
let storage_lists = provider_rw.changed_storages_with_range(block.number..=block.number)?;
|
||||
let storages = provider_rw.plainstate_storages(storage_lists)?;
|
||||
|
||||
@ -185,7 +185,7 @@ impl Command {
|
||||
continue
|
||||
}
|
||||
};
|
||||
provider_rw.insert_block(sealed_block.block, Some(sealed_block.senders))?;
|
||||
provider_rw.insert_block(sealed_block.block, Some(sealed_block.senders), None)?;
|
||||
}
|
||||
|
||||
// Check if any of hashing or merkle stages aren't on the same block number as
|
||||
|
||||
@ -267,6 +267,9 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
|
||||
let metrics_listener = MetricsListener::new(metrics_rx);
|
||||
ctx.task_executor.spawn_critical("metrics listener task", metrics_listener);
|
||||
|
||||
let prune_config =
|
||||
self.pruning.prune_config(Arc::clone(&self.chain))?.or(config.prune.clone());
|
||||
|
||||
// configure blockchain tree
|
||||
let tree_externals = TreeExternals::new(
|
||||
db.clone(),
|
||||
@ -284,6 +287,7 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
|
||||
tree_externals,
|
||||
canon_state_notification_sender.clone(),
|
||||
tree_config,
|
||||
prune_config.clone().map(|config| config.parts),
|
||||
)?
|
||||
.with_sync_metrics_tx(metrics_tx.clone()),
|
||||
);
|
||||
@ -365,9 +369,6 @@ impl<Ext: RethCliExt> NodeCommand<Ext> {
|
||||
None
|
||||
};
|
||||
|
||||
let prune_config =
|
||||
self.pruning.prune_config(Arc::clone(&self.chain))?.or(config.prune.clone());
|
||||
|
||||
// Configure the pipeline
|
||||
let (mut pipeline, client) = if self.dev.dev {
|
||||
info!(target: "reth::cli", "Starting Reth in dev mode");
|
||||
|
||||
Reference in New Issue
Block a user