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

debug_traceCall support #2782

Closed
rajivpo opened this issue Aug 15, 2022 · 10 comments
Closed

debug_traceCall support #2782

rajivpo opened this issue Aug 15, 2022 · 10 comments
Labels
C-anvil Command: anvil T-feature Type: feature

Comments

@rajivpo
Copy link
Contributor

rajivpo commented Aug 15, 2022

Component

Anvil

Describe the feature you would like

debug_traceCall is useful for getting a structured execution trace of eth_call, specifically when it comes to tx simulation. Unique challenges include the ability to enable users to leverage custom tracers written in js and state/block overrides, the latter of which is not present in debug_traceTransaction.

Additional context

I'm currently using a custom JS tracer, mostly to format data prior to a response as opposed to doing fancy stuff across multiple opcodes, but not leveraging state/block overrides.

Not sure how many others would benefit from this feature. hardhat does not yet support debug_traceCall either, but does have support for debug_traceTransaction. I'm aware of #1737 but figured I'd put this out there as well.

If this isn't prioritized, an alternative could be to run geth in clique mode with a custom genesis.json and then execute traces accordingly (h/t @tynes for the idea)

@rajivpo rajivpo added the T-feature Type: feature label Aug 15, 2022
@gakonst gakonst added this to Foundry Aug 15, 2022
@gakonst gakonst moved this to Todo in Foundry Aug 15, 2022
@mattsse mattsse added the C-anvil Command: anvil label Aug 15, 2022
@sambacha
Copy link
Contributor

second this

@aditya520
Copy link

aditya520 commented Aug 19, 2022

Would love to have this!

@samhatem
Copy link

would love this as well

@nathanhleung
Copy link
Contributor

Agreed, this would be a great feature to have.

@antazoey
Copy link
Contributor

antazoey commented Nov 1, 2022

Yes, I really could use this!

@Billy1900
Copy link

One more requirement, I got the trace like this:

{
    "depth": 1,
    "gas": 29978936,
    "gasCost": 3,
    "op": "PUSH1",
    "pc": 0,
    "stack": []
},

however, when I use debug_traceTransaction, I got

{
    "depth": 0,
    "error": "",
    "gas": 39469,
    "gasCost": 3,
    "memory": [],
    "op": "PUSH1",
    "pc": 0,
    "stack": [],
    "storage": {}
},

can we add storage and memory part?

@antazoey
Copy link
Contributor

antazoey commented Aug 3, 2023

can we add storage and memory part?

I get storage and memory when I request like this:

"debug_traceTransaction", [txn_hash, {"stepsTracing": True, "enableMemory": True}]

Edit: Also, I am running my Anvil node with the --steps-tracing flag

@antazoey
Copy link
Contributor

antazoey commented Aug 3, 2023

Wait, didn't #3990 resolve this issue?

@Evalir
Copy link
Member

Evalir commented Aug 3, 2023

pretty sure it did haha! thanks for flagging @antazoey — closing

@Evalir Evalir closed this as completed Aug 3, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Aug 3, 2023
@Billy1900
Copy link

can we add storage and memory part?

I get storage and memory when I request like this:

"debug_traceTransaction", [txn_hash, {"stepsTracing": True, "enableMemory": True}]

Edit: Also, I am running my Anvil node with the --steps-tracing flag

I am trying to trace a transaction which is not committed so I only want to use debug_traceCall, can I get the same data like via debug_traceTransaction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-anvil Command: anvil T-feature Type: feature
Projects
Archived in project
Development

No branches or pull requests

9 participants