core/tracing: add hook for reverted out blocks
This commit is contained in:
parent
f670a7fd93
commit
cf873c3767
|
@ -2375,6 +2375,10 @@ func (bc *BlockChain) reorg(oldHead *types.Header, newHead *types.Block) error {
|
|||
if len(rebirthLogs) > 0 {
|
||||
bc.logsFeed.Send(rebirthLogs)
|
||||
}
|
||||
|
||||
if bc.logger != nil && bc.logger.OnReorg != nil {
|
||||
bc.logger.OnReorg(oldChain)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -134,6 +134,9 @@ type (
|
|||
// GenesisBlockHook is called when the genesis block is being processed.
|
||||
GenesisBlockHook = func(genesis *types.Block, alloc types.GenesisAlloc)
|
||||
|
||||
// ReorgHook is called when a segment of the chain is reverted.
|
||||
ReorgHook = func(reverted []*types.Block)
|
||||
|
||||
// OnSystemCallStartHook is called when a system call is about to be executed. Today,
|
||||
// this hook is invoked when the EIP-4788 system call is about to be executed to set the
|
||||
// beacon block root.
|
||||
|
@ -186,6 +189,7 @@ type Hooks struct {
|
|||
OnBlockEnd BlockEndHook
|
||||
OnSkippedBlock SkippedBlockHook
|
||||
OnGenesisBlock GenesisBlockHook
|
||||
OnReorg ReorgHook
|
||||
OnSystemCallStart OnSystemCallStartHook
|
||||
OnSystemCallEnd OnSystemCallEndHook
|
||||
// State events
|
||||
|
|
Loading…
Reference in New Issue