> ## 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.

# Execution

> Simulate calls, replay transactions, and inspect block-level state changes.

The execution commands inspect what the EVM does with calls, transactions, and blocks.

Use these commands when you want to answer execution-client questions such as:

* what return data and gas estimate would this call produce?
* what call tree did this mined transaction execute?
* which accounts and storage slots changed while executing this block?

<CardGroup cols={2}>
  <Card title="Simulate" icon="play" href="/docs/execution/simulate">
    Run an `eth_call` and `eth_estimateGas` against a selected block state.
  </Card>

  <Card title="Replay Tx" icon="route" href="/docs/execution/replay-tx">
    Replay one transaction with the debug call tracer.
  </Card>

  <Card title="State Diff" icon="git-compare-arrows" href="/docs/execution/state-diff">
    Trace a block and summarize changed accounts and storage slots.
  </Card>
</CardGroup>

## Prerequisites

`execution simulate` uses the standard `eth` namespace:

```sh theme={null}
reth node \
  --dev \
  --http \
  --http.api eth,net,web3 \
  --datadir ./alice
```

`execution replay-tx` and `execution state-diff` use debug tracing methods. Enable the `debug` namespace:

```sh theme={null}
reth node \
  --dev \
  --http \
  --http.api eth,net,web3,debug \
  --datadir ./alice
```

Rex connects to the local execution RPC endpoint at
`http://127.0.0.1:8545` (`localhost:8545`) by default:

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

Use the global `--rpc <URL>` flag to target a different endpoint.

## Block Selectors

Execution commands that accept `--block` support:

* decimal block numbers such as `12345`
* 0x-prefixed block numbers such as `0x3039`
* 32-byte block hashes
* tags: `latest`, `safe`, `finalized`, and `earliest`

For block hashes, `state-diff` uses `debug_traceBlockByHash`. For number and tag selectors, it uses `debug_traceBlockByNumber`.


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