> ## Documentation Index
> Fetch the complete documentation index at: https://rexrex.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace Block State Diff

> Summarize account and storage changes produced by a block.

Use `execution state-diff` to trace a block and summarize which accounts changed during execution.

The command uses the prestate tracer in diff mode, then aggregates account changes across all traced transactions.

## Command

```sh theme={null}
rex execution state-diff \
  --block latest
```

Limit the printed account table:

```sh theme={null}
rex execution state-diff \
  --block latest \
  --limit 10
```

## Example Output

```text theme={null}
EXECUTION STATE DIFF

Block:               latest
Trace method:        debug_traceBlockByNumber
Transactions traced: 4
Trace errors:        0
Accounts changed:    9
Balance changes:     3
Nonce changes:       1
Code changes:        0
Storage slots:       12

ADDRESS                                      TXS BALANCE NONCE CODE   STORAGE CREATED DELETED
0x5fbdb2315678afecb367f032d93f642f64180aa3    4 no      no    no          12 no      no
0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266    1 yes     yes   no           0 no      no
```

## How It Works

For block numbers and tags, the command calls:

```text theme={null}
debug_traceBlockByNumber
```

For block hashes, it calls:

```text theme={null}
debug_traceBlockByHash
```

Both use this tracer configuration:

```json theme={null}
{
    "tracer": "prestateTracer",
    "tracerConfig": {
        "diffMode": true
    }
}
```

## Field Notes

* `TXS` is the number of traced transactions that touched the account.
* `BALANCE`, `NONCE`, and `CODE` indicate whether that field changed at least once.
* `STORAGE` counts unique storage slots changed for the account across the traced block.
* Debug tracing can be expensive on large blocks. Start with recent dev or small local blocks while learning the output.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.