Skip to content
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

Execution tracing for past blocks #2491

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 99 additions & 48 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ fuel-core-xtask = { version = "0.0.0", path = "./xtask" }
fuel-gas-price-algorithm = { version = "0.40.0", path = "crates/fuel-gas-price-algorithm" }

# Fuel dependencies
fuel-vm-private = { version = "0.58.2", package = "fuel-vm", default-features = false }
fuel-vm-private = { git = "https://github.com/FuelLabs/fuel-vm", branch = "dento/execution-trace", package = "fuel-vm", default-features = false }
# fuel-vm-private = { version = "0.58.2", package = "fuel-vm", default-features = false }

# Common dependencies
anyhow = "1.0"
Expand Down
69 changes: 69 additions & 0 deletions crates/client/assets/schema.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,10 @@ type Mutation {
"""
dryRun(txs: [HexString!]!, utxoValidation: Boolean, gasPrice: U64): [DryRunTransactionExecutionStatus!]!
"""
Get execution trace for an already-executed transaction.
"""
traceTx(txId: HexString!, trigger: TraceTrigger!): [TraceTransactionExecutionStatus!]!
"""
Submits transaction to the `TxPool`.

Returns submitted transaction if the transaction is included in the `TxPool` without problems.
Expand Down Expand Up @@ -1170,6 +1174,71 @@ type SuccessStatus {

scalar Tai64Timestamp

type TraceFailureStatus {
programState: ProgramState
reason: String!
receipts: [Receipt!]!
executionTrace: [TraceFrame!]!
totalGas: U64!
totalFee: U64!
}

type TraceFrame {
"""
Register values
"""
registers: [U64!]!
"""
Changes to memory `(address, bytes)` that occurred since the last frame
"""
memoryDiff: [TraceFrameMemoryPatch!]!
"""
How many of the original receipts have been produced by this point
"""
receiptCount: Int!
}

type TraceFrameMemoryPatch {
"""
Start address
"""
start: Int!
"""
Bytes of data
"""
bytes: HexString!
}

type TraceSuccessStatus {
programState: ProgramState
receipts: [Receipt!]!
executionTrace: [TraceFrame!]!
totalGas: U64!
totalFee: U64!
}

type TraceTransactionExecutionStatus {
id: TransactionId!
status: TraceTransactionStatus!
receipts: [Receipt!]!
}

union TraceTransactionStatus = TraceSuccessStatus | TraceFailureStatus

"""
One of the films in the Star Wars Trilogy
"""
enum TraceTrigger {
"""
After each instruction
"""
ON_INSTRUCTION
"""
After an instruction has created a receipt
"""
ON_RECEIPT
}

type Transaction {
id: TransactionId!
inputAssetIds: [AssetId!]
Expand Down
Loading
Loading