Skip to content

forc-call tracing detailed insights #7197

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

Open
zees-dev opened this issue May 23, 2025 · 0 comments
Open

forc-call tracing detailed insights #7197

zees-dev opened this issue May 23, 2025 · 0 comments
Labels
dev-experience Anything to do with the developer experience forc-call Everything related to the `forc-call` plugin in `forc-client` package

Comments

@zees-dev
Copy link
Contributor

Issue

Transaction tracing functionality is being added to forc-call in this PR: #7196

However, there are a few minor issues with the traces which need to be addressed:

  • call traces should also print out the function being called - in format:
    • [gas-used] <contract-id>:<function-signature> - given that the ABI is provided for the contract
    • The return data should be formatted properly; not Vec<u8> - but instead be decoded based on the ABI provided

Potential implementation details/insights

The call receipt itself does not contain the details of the function being called; instead the transaction must be re-run with a the VM interpreter.

  • step through VM until CALL receipt is encountered; and based on the VM data (registers, pc, etc.) the call function can be extracted
    The same approach may be required for the return data

Note: A caveat to the approach above is that a transaction may need to be submitted first - since a hash and storage are required to setup/instantiate a VM.

An example of VM interpreter setup for tracing can be found here: https://github.com/FuelLabs/execution-trace/blob/494c19099fdb70246a5ed08304d9f72731120367/crates/execution-trace/src/lib.rs#L137

@zees-dev zees-dev added forc-call Everything related to the `forc-call` plugin in `forc-client` package dev-experience Anything to do with the developer experience labels May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev-experience Anything to do with the developer experience forc-call Everything related to the `forc-call` plugin in `forc-client` package
Projects
None yet
Development

No branches or pull requests

1 participant