tracing: add OnFaultV2 hook with rData to FaultHookV2 and Hooks

This commit is contained in:
GarmashAlex 2025-10-29 13:24:14 +03:00 committed by GitHub
parent 5dd0fe2f53
commit 17d313747d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -113,6 +113,12 @@ type (
// FaultHook is invoked when an error occurs during the execution of an opcode.
FaultHook = func(pc uint64, op byte, gas, cost uint64, scope OpContext, depth int, err error)
// FaultHookV2 is invoked when an error occurs during the execution of an opcode.
// It includes the return data (e.g. revert reason) available at the time of the fault.
// This mirrors the signature of OpcodeHook by including rData and allows tracers to
// capture revert data directly at fault time.
FaultHookV2 = func(pc uint64, op byte, gas, cost uint64, scope OpContext, rData []byte, depth int, err error)
// GasChangeHook is invoked when the gas changes.
GasChangeHook = func(old, new uint64, reason GasChangeReason)
@ -198,6 +204,7 @@ type Hooks struct {
OnExit ExitHook
OnOpcode OpcodeHook
OnFault FaultHook
OnFaultV2 FaultHookV2
OnGasChange GasChangeHook
// Chain events
OnBlockchainInit BlockchainInitHook