use alloy_primitives::B256; use reth_execution_types::BlockExecutionOutput; use reth_primitives::{NodePrimitives, RecoveredBlock, SealedHeader}; use reth_trie::updates::TrieUpdates; /// An invalid block hook. pub trait InvalidBlockHook: Send + Sync { /// Invoked when an invalid block is encountered. fn on_invalid_block( &self, parent_header: &SealedHeader, block: &RecoveredBlock, output: &BlockExecutionOutput, trie_updates: Option<(&TrieUpdates, B256)>, ); } impl InvalidBlockHook for F where N: NodePrimitives, F: Fn( &SealedHeader, &RecoveredBlock, &BlockExecutionOutput, Option<(&TrieUpdates, B256)>, ) + Send + Sync, { fn on_invalid_block( &self, parent_header: &SealedHeader, block: &RecoveredBlock, output: &BlockExecutionOutput, trie_updates: Option<(&TrieUpdates, B256)>, ) { self(parent_header, block, output, trie_updates) } }