Interactively debugging internal transactions #10136
Unanswered
scottbuckley
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hi @scottbuckley thanks for your question / suggestion! Foundry works with what we call "call frames" that we jump in and out of. As an example:
You can then press
This gets you something like
If this is not what you mean, would you mind expanding on it further? Feel free to open a feature request ticket detailing your request, it is a bit easier to keep track off than in the discussions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there. I've been trying to find a way to interactively debug the the bytecode of a transaction, including jumping to the bytecode (with appropriate calldata etc) of an external contract when the debug trace performs
CALL
or similar.I am relatively new to using Foundry tools, but I have been running Anvil local archive nodes to play around with this kind of debugging, and used the in-terminal interactive debugger via Cast, which I'm enjoying. I was lead to believe that the interactive debugger in
hevm
would have the functionality i'm looking for, and I actually fixed (and had a PR accepted) the current release ofhevm
just to try it out, and it turns out thathevm
has removed the interactive debugging feature, so I'm back to Cast. Remix does this in theory, but its debugger is extremely unreliable.The example transaction I'm looking at is here on Holesky. It only has a single internal transaction. It appears that Cast breaks the bytecode trace into two "pages" - one for before the internal transaction, and one for after. It would be amazing if I could get Cast to jump to the bytecode trace of that internal transaction in-between those pages, either automatically, or via a key pressed when the
CALL
opcode is selected, or via a setting.A secondary option would be some version of
cast run
which grabs the "transaction tree" (what BlockScout calls the "raw trace"), then lets me choose which sub-transaction I want to debug, before opening the interactive debugger. I was looking around to see if Cast returns this set of internal transactions somehow, but I also couldn't find this feature.I am interested in developing this feature myself if something similar doesn't already exist, but I thought I'd first ask to see if there's something like this I don't yet know about. I couldn't find anything like this in the Foundry Book. If nothing like this exists, I'd be interested to hear the devs' ideas of what challenges I might face implementing it.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions