-
Notifications
You must be signed in to change notification settings - Fork 5.4k
forc-call detailed vm-interpreter call traces #7251
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JoshuaBatty
approved these changes
Jun 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! LGTM
kayagokalp
approved these changes
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge one!
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
enhancement
New feature or request
forc
forc-call
Everything related to the `forc-call` plugin in `forc-client` package
team:tooling
Tooling Team
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR updates the
forc call
functionality to provide detailed call traces.This is achieved via retrieving
Vec<StorageReadReplayEvent>
from transactions (dry-run and/or live mode) and executing these in a vm-interpreter.Additional
forc-call
updates:--label <contract-addr>:<name>
--contract-abi <contract-addr>:<abi-file-or-url>
Example
Assume the following 2 contracts - where
demo-caller
callsdemo
contract:demo
:0xe84e278cb083a5b3ff871f1d3de26fdd13ae044070e1bbda18b60a13f98bb295
demo-caller
:0xed4437b191cc78a02df048f21a73df37f1627efdde7d7e4232468b9de9d83485
demo contract source
demo-caller contract source
Previous functionality:
cargo run -p forc-client --bin forc-call -- \ --abi ./demo/demo-caller/out/release/demo-caller-abi.json \ ed4437b191cc78a02df048f21a73df37f1627efdde7d7e4232468b9de9d83485 \ call_increment_count "{(1,1)}" -vvv
Output:

Updated functionality:
cargo run -p forc-client --bin forc-call -- \ --abi ./demo/demo-caller/out/release/demo-caller-abi.json \ ed4437b191cc78a02df048f21a73df37f1627efdde7d7e4232468b9de9d83485 \ --contract-abi e84e278cb083a5b3ff871f1d3de26fdd13ae044070e1bbda18b60a13f98bb295:./demo/demo/out/release/demo-abi.json \ --label ed4437b191cc78a02df048f21a73df37f1627efdde7d7e4232468b9de9d83485:demo-caller \ --label e84e278cb083a5b3ff871f1d3de26fdd13ae044070e1bbda18b60a13f98bb295:demo \ call_increment_count "{(1,1)}" -vv
Output:

Other misc. improvements to
forc-call
AI description
This pull request introduces significant enhancements to the
forc call
functionality, improving usability, debugging, and trace readability for multi-contract interactions.The changes include support for labeled contract addresses, additional ABI files for better decoding, and updates to verbosity levels. Additionally, dependencies and internal parsing logic have been updated to support these features.
Enhancements to
forc call
functionality:Support for labeled contract addresses:
--label
flag to allow users to assign human-readable labels to contract addresses in transaction traces, improving readability. [1] [2]Support for additional ABIs:
--contract-abi
flag to specify additional contract ABIs for decoding function signatures, parameters, and return values in multi-contract interactions. [1] [2]Improved verbosity and tracing:
-vv
instead of-vvv
.Dependency and internal updates:
Dependency additions:
fuel-core-storage
as a dependency inCargo.toml
to support new features. [1] [2]Parsing and execution logic:
forc-client
to include reusable functions for parsing ABIs and labels.call_function
logic to handle additional ABIs and integrate with the new dry-run execution method. [1] [2]Checklist
Breaking*
orNew Feature
labels where relevant.