Skip to content

Transaction trace #6706

Open
Open
@zees-dev

Description

@zees-dev

Related Component

forc

Problem you are trying to solve

The sway tooling needs to support transaction traces such that one can analyze the pathways of code executed within a transaction.

For example; when using the foundry tooling one can do this:

# > cast send --private-key $RAW_PRIVATE_KEY 0x0000B3965781EEF2BdB59A9dB31AB854B44A4Bff --value 31ether                                            

blockHash               0xca7e0a17b131d10e24f7b87759f1b3534425987f7beae14afa8727341f781d24
blockNumber             1
contractAddress         
cumulativeGasUsed       21000
effectiveGasPrice       1000000001
from                    0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
gasUsed                 21000
logs                    []
logsBloom               0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
root                    0x4c86387576fcdd67cdda3b8339bc0c37006346c79b03a8d818d386053fc06b85
status                  1 (success)
transactionHash         0x80bf15b8150af8572ba4d62bfa8afe499ffba7fc9110439eb5510113846515bf
transactionIndex        0
type                    2
blobGasPrice            1
blobGasUsed             
authorizationList       
to                      0x0000B3965781EEF2BdB59A9dB31AB854B44A4Bff
# > cast run 0x80bf15b8150af8572ba4d62bfa8afe499ffba7fc9110439eb5510113846515bf 

Executing previous transactions from the block.
Traces:
  [0] 0x0000B3965781EEF2BdB59A9dB31AB854B44A4Bff::fallback{value: 31000000000000000000}()
    └─ ← [Stop] 


Transaction successfully executed.
Gas used: 21000

In the example above a simple ether transfer transaction is executed using the cast tooling; one can get a call trace of the transaction using cast run command.
It would be great to have an equivalent, or atleast some way to dive deeper into the call trace of a transaction on the fuelvm.

Solution you'd like

A forc tooling equivalent to obtain a call trace. Will most likely need to be a sub-command or a new CLI tool equivalent to cast.

Notes

No response

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions