Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get innternal transactions by tracer #201

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from
Draft

Conversation

giskook
Copy link

@giskook giskook commented Dec 17, 2024

Get internal transaction by tracer

Comment on lines +41 to +43
func init() {
register("okTracer", NewOKTracer)
}
Copy link
Collaborator

@Vui-Chee Vui-Chee Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function called anywhere? How does the tracing for EVM actually begins?

From: currentTx.From.String(),
To: toAddress,
ValueWei: value.String(),
CallValueWei: hexutil.EncodeBig(value),
Copy link
Collaborator

@Vui-Chee Vui-Chee Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows core VM conversion and will display hex string.

Comment on lines +355 to +360
if index-2 >= 0 {
callTx.InternalIndex = *big.NewInt(int64(index - 2))
} else {
callTx.InternalIndex = *big.NewInt(0)
log.Error("internalTxTraceToInnerTx got -ve internal index.", "index", index, "calc idx", index-2)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-2 to match previous inner tx response. And log error if somehow trace idx becomes -ve.

@Vui-Chee
Copy link
Collaborator

Some things to note, not all fields can be replicated due to slight differences in implementation. I will list those fields here:

  • trace_address is not set in new tracer
  • output is set in new tracer (but not in old inner tx)
  • name is different (the instruction name is different)

@Vui-Chee
Copy link
Collaborator

There is also 1 slight issue, I do not know why call_value_wei is 0 for the new tracer.

Screenshot 2024-12-19 at 12 13 17 PM

@giskook giskook marked this pull request as draft December 24, 2024 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants