Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/engine/primitives/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ pub enum ConsensusEngineEvent<N: NodePrimitives = EthPrimitives> {
/// The fork choice state was updated, and the current fork choice status
ForkchoiceUpdated(ForkchoiceState, ForkchoiceStatus),
/// A block was added to the fork chain.
ForkBlockAdded(ExecutedBlockWithTrieUpdates<N>, Duration),
ForkBlockAdded(Box<ExecutedBlockWithTrieUpdates<N>>, Duration),
/// A new block was received from the consensus engine
BlockReceived(BlockNumHash),
/// A block was added to the canonical chain, and the elapsed time validating the block
CanonicalBlockAdded(ExecutedBlockWithTrieUpdates<N>, Duration),
CanonicalBlockAdded(Box<ExecutedBlockWithTrieUpdates<N>>, Duration),
/// A canonical chain was committed, and the elapsed time committing the data
CanonicalChainCommitted(Box<SealedHeader<N::BlockHeader>>, Duration),
/// The consensus engine processed an invalid block.
Expand Down
9 changes: 6 additions & 3 deletions crates/engine/tree/src/tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,10 @@ where
self.state.tree_state.insert_executed(block.clone());
self.metrics.engine.inserted_already_executed_blocks.increment(1);
self.emit_event(EngineApiEvent::BeaconConsensus(
ConsensusEngineEvent::CanonicalBlockAdded(block, now.elapsed()),
ConsensusEngineEvent::CanonicalBlockAdded(
Box::new(block),
now.elapsed(),
),
));
}
EngineApiRequest::Beacon(request) => {
Expand Down Expand Up @@ -2356,9 +2359,9 @@ where
// emit insert event
let elapsed = start.elapsed();
let engine_event = if is_fork {
ConsensusEngineEvent::ForkBlockAdded(executed, elapsed)
ConsensusEngineEvent::ForkBlockAdded(Box::new(executed), elapsed)
} else {
ConsensusEngineEvent::CanonicalBlockAdded(executed, elapsed)
ConsensusEngineEvent::CanonicalBlockAdded(Box::new(executed), elapsed)
};
self.emit_event(EngineApiEvent::BeaconConsensus(engine_event));

Expand Down
2 changes: 1 addition & 1 deletion crates/ress/provider/src/pending_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub async fn maintain_pending_state<P>(
ConsensusEngineEvent::CanonicalBlockAdded(block, _) |
ConsensusEngineEvent::ForkBlockAdded(block, _) => {
trace!(target: "reth::ress_provider", block = ? block.recovered_block().num_hash(), "Insert block into pending state");
pending_state.insert_block(block);
pending_state.insert_block(*block);
}
ConsensusEngineEvent::InvalidBlock(block) => {
if let Ok(block) = block.try_recover() {
Expand Down