native/mux: forward OnFaultV2 to child tracers with fallback

This commit is contained in:
GarmashAlex 2025-10-29 13:25:47 +03:00 committed by GitHub
parent bf35a2f113
commit 99923e9f54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,6 +64,7 @@ func newMuxTracer(ctx *tracers.Context, cfg json.RawMessage, chainConfig *params
OnExit: t.OnExit, OnExit: t.OnExit,
OnOpcode: t.OnOpcode, OnOpcode: t.OnOpcode,
OnFault: t.OnFault, OnFault: t.OnFault,
OnFaultV2: t.OnFaultV2,
OnGasChange: t.OnGasChange, OnGasChange: t.OnGasChange,
OnBalanceChange: t.OnBalanceChange, OnBalanceChange: t.OnBalanceChange,
OnNonceChange: t.OnNonceChange, OnNonceChange: t.OnNonceChange,
@ -92,6 +93,16 @@ func (t *muxTracer) OnFault(pc uint64, op byte, gas, cost uint64, scope tracing.
} }
} }
func (t *muxTracer) OnFaultV2(pc uint64, op byte, gas, cost uint64, scope tracing.OpContext, rData []byte, depth int, err error) {
for _, t := range t.tracers {
if t.OnFaultV2 != nil {
t.OnFaultV2(pc, op, gas, cost, scope, rData, depth, err)
} else if t.OnFault != nil {
t.OnFault(pc, op, gas, cost, scope, depth, err)
}
}
}
func (t *muxTracer) OnGasChange(old, new uint64, reason tracing.GasChangeReason) { func (t *muxTracer) OnGasChange(old, new uint64, reason tracing.GasChangeReason) {
for _, t := range t.tracers { for _, t := range t.tracers {
if t.OnGasChange != nil { if t.OnGasChange != nil {