Configurable bad block hook in new tree #10425
Labels
A-blockchain-tree
Related to sidechains, reorgs and pending blocks
A-consensus
Related to the consensus engine
C-enhancement
New feature or request
ref #10405
We currently do not have a good way of inspecting block output if it is a bad block. We cannot call RPC methods like
debug_executionWitness
ordebug_traceBlock
because the block failed validation. Instead, we need a way to run a user-defined method after a block errors because it is an invalid block.If we wanted to be exhaustive, the hook would be run after this line:
reth/crates/engine/tree/src/tree/mod.rs
Line 1797 in e27ad1a
However, then we would not be able to use the outputs of the block. Instead, we should run it if validation fails here:
reth/crates/engine/tree/src/tree/mod.rs
Line 1740 in e27ad1a
Or here:
reth/crates/engine/tree/src/tree/mod.rs
Line 1730 in e27ad1a
It should be possible for the hook to re-execute the block with traces and get the witness + witness preimages.
The text was updated successfully, but these errors were encountered: