mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf(db): reduce different repeated allocations (#2103)
This commit is contained in:
@ -32,4 +32,5 @@ enum StageEnum {
|
||||
Execution,
|
||||
Hashing,
|
||||
Merkle,
|
||||
TxLookup,
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ use reth_staged_sync::{
|
||||
Config,
|
||||
};
|
||||
use reth_stages::{
|
||||
stages::{BodyStage, ExecutionStage, SenderRecoveryStage},
|
||||
stages::{BodyStage, ExecutionStage, SenderRecoveryStage, TransactionLookupStage},
|
||||
ExecInput, Stage, StageId, UnwindInput,
|
||||
};
|
||||
use std::{net::SocketAddr, sync::Arc};
|
||||
@ -181,6 +181,16 @@ impl Command {
|
||||
}
|
||||
stage.execute(&mut tx, input).await?;
|
||||
}
|
||||
StageEnum::TxLookup => {
|
||||
let mut stage = TransactionLookupStage::new(num_blocks);
|
||||
|
||||
// Unwind first
|
||||
if !self.skip_unwind {
|
||||
stage.unwind(&mut tx, unwind).await?;
|
||||
}
|
||||
|
||||
stage.execute(&mut tx, input).await?;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user