From f88288c7b0d08942e35777cb5702e30ac935fc3a Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 23 Jun 2025 14:05:03 +0000 Subject: [PATCH] fix: lookup tx.to Signed-off-by: jsvisa --- eth/tracers/native/prestate.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eth/tracers/native/prestate.go b/eth/tracers/native/prestate.go index 179b836d68..57c66ae327 100644 --- a/eth/tracers/native/prestate.go +++ b/eth/tracers/native/prestate.go @@ -135,7 +135,7 @@ func (t *prestateTracer) OnOpcode(pc uint64, opcode byte, gas, cost uint64, scop case stackLen >= 5 && (op == vm.DELEGATECALL || op == vm.CALL || op == vm.STATICCALL || op == vm.CALLCODE): addr := common.Address(stackData[stackLen-2].Bytes20()) t.lookupAccount(addr) - // Lookup a delegation target + // Lookup the delegation target if t.chainConfig.IsPrague(t.env.BlockNumber, t.env.Time) { code := t.env.StateDB.GetCode(addr) if target, ok := types.ParseDelegation(code); ok { @@ -170,6 +170,13 @@ func (t *prestateTracer) OnTxStart(env *tracing.VMContext, tx *types.Transaction t.created[t.to] = true } else { t.to = *tx.To() + // Lookup the delegation target + if t.chainConfig.IsPrague(t.env.BlockNumber, t.env.Time) { + code := t.env.StateDB.GetCode(t.to) + if target, ok := types.ParseDelegation(code); ok { + t.lookupAccount(target) + } + } } t.lookupAccount(from)