Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

debug_traceTransaction sometimes returns no trace steps when on a forked chain #579

Closed
haltman-at opened this issue Jun 2, 2020 · 7 comments
Assignees
Labels

Comments

@haltman-at
Copy link
Contributor

Expected Behavior

The debug_traceTransaction method should consistently return trace steps.

Current Behavior

Sometimes, when running on a forked chain, the debug_traceTransaction method returns an empty list of trace steps, even though the actual list of trace steps was nonempty. This seems to happen both for transactions before and after the fork. For a fixed transaction though, within a single Ganache instance, it seems to either always happen or never happen.

Steps to Reproduce (for bugs)

Unfortunately, I can't consistently reproduce this problem. Start Ganache with a forked chain and try debugging some transactions from before the fork, or make some transactions after the fork and try debugging those. Sometimes it'll happen, sometimes it won't.

For what it's worth, though, if you want to try it with a transaction from before the fork, one particular transaction I encountered the error with is transaction 0x6a86b051ad13bcf8a4ebfc33f6ccdacced818bd2de3149e7566e9f55cc0fab64 on the Goerli testnet. Note that sometimes when I've started Ganache this transaction will return no trace steps, while other times it works fine. However, as mentioned above, within a single instance of Ganache it seems to either work or fail consistently.

Context

I was trying to debug transactions on a forked chain. Not sure what more there is to say about that. I personally was trying to do this as a test of the debugger, but from what I hear this is indeed something actual users do with our debugger.

Your Environment

  • Version used: Ganache CLI v6.8.2 (ganache-core: 2.9.2)
  • Operating System and version: Release Linux Mint 19.1 Tessa 64-bit
@mikeseese
Copy link
Contributor

mikeseese commented Aug 20, 2020

@haltman-at what would you say your failure rate is? I've tried reproducing this in v6.8.2 with the transaction hash you mentioned using curl, and I easily get a non-empty response 10 out of 10 times

@haltman-at
Copy link
Contributor Author

Hm, good question. This hasn't happened in a while, to tell the truth.

@mikeseese
Copy link
Contributor

mikeseese commented Aug 24, 2020

How were you verifying whether or not you were getting the traces? were you manually sending the RPC requests with curl/something similar or were you using the debugger? If you were using the debugger, can you give me reproduction steps (i.e. run this command, then use this syntax to get this thing to show, you'd see this if it was good or this if it was bad, etc) on how you would have seen this?

@haltman-at
Copy link
Contributor Author

I was using the debugger. Initially this caused errors but I later altered the debugger to simply warn you rather than causing errors when this occurs. The reason I say there were no trace steps was because trace.steps, where we store them, was equal to [] when inspected. (I didn't actually inspect the raw RPC return, but if the trace result were entirely absent rather than being present but empty, this would cause other debugger errors, so I think we can rule that out even though I didn't directly inspect it.)

For repro steps, you can just use truffle debug <txHash>, assuming you can find a transaction where this occurs. If the trace steps are empty the debugger will (now) warn you about this on startup.

@mikeseese
Copy link
Contributor

Perfect, thanks. I'll try to keep reproducing this. Let me know if you run into it again; if you do, please let me know which version of truffle and/or ganache you're using

@mikeseese
Copy link
Contributor

I'm closing this as I can't reproduce it; feel free to reopen or open a new issue if we start seeing this again

@haltman-at
Copy link
Contributor Author

OK, I'll let you know if I see this again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants