create_invalid_block_hook

Function create_invalid_block_hook 

Source
pub async fn create_invalid_block_hook<N, P, E>(
    config: &NodeConfig<<P as ChainSpecProvider>::ChainSpec>,
    data_dir: &ChainPath<DataDirPath>,
    provider: P,
    evm_config: E,
    chain_id: u64,
) -> Result<Box<dyn InvalidBlockHook<N>>, Report>
where N: NodePrimitives, P: StateProviderFactory + ChainSpecProvider + Clone + Send + Sync + 'static, E: ConfigureEvm<Primitives = N> + Clone + 'static,
Expand description

Creates an invalid block hook based on the node configuration.

This function constructs the appropriate InvalidBlockHook based on the debug configuration in the node config. It supports:

  • Witness hooks for capturing block witness data
  • Healthy node verification via RPC

ยงArguments

  • config - The node configuration containing debug settings
  • data_dir - The data directory for storing hook outputs
  • provider - The blockchain database provider
  • evm_config - The EVM configuration
  • chain_id - The chain ID for verification