Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js';

Returns traces matching the specified filter. The response is limited to 10000 traces per response. <CreditCost network="evm_trace" method="trace_filter" />
Returns traces matching the specified filter. The block range is limited to 100 blocks per query (the difference between `fromBlock` and `toBlock`). <CreditCost network="evm_trace" method="trace_filter" />
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,24 @@ description: Ethereum trace methods

# Ethereum trace methods

Infura provides access to the following trace API methods to allow users to gain insights into the execution of smart contracts and transactions:

- [`trace_block`](trace_block.mdx)
- [`trace_call`](trace_call.mdx)
- [`trace_callMany`](trace_callmany.mdx)
- [`trace_transaction`](trace_transaction.mdx)
- [`trace_filter`](trace_filter.mdx)

:::info

Trace API is currently an open beta feature, available to paying Infura customers.

Trace API is an open beta feature, available to paying Infura customers.
:::

When tracing transactions, the trace diagnostic options are [`trace`](#trace) and [`stateDiff`](#statediff).
Infura provides access to trace API methods that provide insights into the execution of smart contracts and transactions.

:::info

`trace_block, trace_filter`, and `trace_transaction` returns `trace` information, whereas `trace_call` and `trace_callMany`
allow you to use the `trace` or `stateDiff` diagnostic options when tracing calls or transactions.
| Method | Diagnostic options |
|-----------------------|-------------------------------------------|
|[`trace_block`](trace_block.mdx)|[`trace`](#trace)|
|[`trace_call`](trace_call.mdx)|[`trace`](#trace), [`stateDiff`](#statediff)|
|[`trace_callMany`](trace_callmany.mdx)|[`trace`](#trace), [`stateDiff`](#statediff)|
|[`trace_transaction`](trace_transaction.mdx)|[`trace`](#trace)|
|[`trace_filter`](trace_filter.mdx)|[`trace`](#trace)|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the previous note might be more accurate than the table. For trace_block, trace_transaction, and trace_filter, there are no "diagnostic options," the methods just always return trace information.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting, note that I am reverting fully so that includes "When tracing transactions, the trace diagnostic options are trace and stateDiff."
If diagnostic options per the original is wrong, do you have alt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my new comment below.


:::caution
Trace responses are handled generically to enable support of additional fields beyond
those documented here. This requires graceful handling.
:::

## `trace`
Expand Down Expand Up @@ -61,30 +58,35 @@ smart contract transaction. Excludes precompiled contracts.
| Key | Value |
|-----------------------|-----------------------------------------------------------------------------------------------------------------|
| `action` | Transaction details. |
| `callType` | Whether the transaction is `call` or `create`. |
| `from` | Address of the transaction sender. |
| `gas` | Gas provided by sender. |
| `input` | Transaction data. |
| `to` | Target of the transaction. |
| `value` | Value transferred in the transaction. |
| &nbsp;&nbsp;- `creationMethod` | Opcode used during contract creation: `create` or `create2`. Returned for `create` operations. |
| &nbsp;&nbsp;- `callType` | Whether the transaction is `call`, `staticcall`, `delegatecall`. Returned for `call` operations. |
| &nbsp;&nbsp;- `from` | Address of the transaction sender. |
| &nbsp;&nbsp;- `gas` | Gas provided by sender. |
| &nbsp;&nbsp;- `input` | Transaction data. Returned for `call` operations. |
| &nbsp;&nbsp;- `init` | Contract initialization code. Returned for `create` operations. |
| &nbsp;&nbsp;- `to` | Target of the transaction. Returned for `call` operations. |
| &nbsp;&nbsp;- `value` | Value transferred in the transaction. |
| `blockHash` | Hash of the block containing this trace. |
| `blockNumber` | Block number containing this trace. |
| `result` | Transaction result. |
| `gasUsed` | Gas used by the transaction. Includes any refunds of unused gas. |
| `output` | Return value of the contract call. Contains only the actual value sent by a `RETURN` operation. If a `RETURN` was not executed, the output is empty bytes. |
| `subTraces` | Traces of contract calls made by the transaction. |
| &nbsp;&nbsp;- `address` | Address of the newly created contract. Returned for `create` operations. |
| &nbsp;&nbsp;- `code` | Bytecode of the newly created contract. Returned for `create` operations. |
| &nbsp;&nbsp;- `gasUsed` | Gas used by the transaction. Includes any refunds of unused gas. |
| &nbsp;&nbsp;- `output` | Return value of the contract call. Contains only the actual value sent by a `RETURN` operation. If a `RETURN` was not executed, the output is empty bytes. Returned for `call` operations. |
| `subtraces` | Number of sub-traces (nested contract calls) made by the transaction. |
| `traceAddress` | Tree list address of where the call occurred, address of the parents, and order of the current sub call. |
| `transactionHash` | Hash of the transaction. |
| `transactionPosition` | Transaction position. |
| `type` | Whether the transaction is a `CALL` or `CREATE` series operation. |

| `transactionHash` | Hash of the transaction. |
| `transactionPosition` | Transaction position within the block. |
| `type` | Whether the transaction is a `call` or `create` operation. |

## `stateDiff`

Displays state changes in the requested block for each transaction, represented as a map of accounts to an object. Lists
the balance, code, nonce, and storage changes from immediately before the transaction to after the transaction. For the `key:value` pairs:

- `+` indicates the field didn’t exist before and now has the specified value.
- `-` indicates a deleted value.
- `*` has a `from` and a `to` value.
- `+` indicates the field didn’t exist before and now has the specified value
- `-` indicates a deleted value
- `*` has a `from` and a `to` value

An absent value is distinct from zero when creating accounts or clearing storage. For example, when clearing storage, an absent value means that a particular storage slot has not yet been assigned a value, while a zero value means that the storage slot has been assigned and set to zero.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ smart contract transaction. Excludes precompiled contracts.
| `result` | Transaction result. |
| `gasUsed` | Gas used by the transaction. Includes any refunds of unused gas. |
| `output` | Return value of the contract call. Contains only the actual value sent by a `RETURN` operation. If a `RETURN` was not executed, the output is empty bytes. |
| `subTraces` | Traces of contract calls made by the transaction. |
| `subtraces` | Traces of contract calls made by the transaction. |
| `traceAddress` | Tree list address of where the call occurred, address of the parents, and order of the current sub call. |
| `transactionHash` | Hash of the transaction. |
| `transactionPosition`| Transaction position. |
Expand Down
Loading