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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/hyperliquid-evm-trace-replay-block-transactions",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# trace_replayBlockTransactions | Hyperliquid EVM

> Replays all transactions in a block and returns trace information for each transaction. This method provides detailed execution traces for all transactions in a specific block.

<Info>
  This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `trace_replayBlockTransactions` JSON-RPC method replays all transactions in a block and returns trace information for each transaction. This method provides detailed execution traces for all transactions in a specific block by replaying their execution, making it essential for comprehensive block analysis.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

1. **Block identifier** (string, required): Block number, hash, or "latest"/"earliest"/"pending"
2. **Trace types** (array, required): Array of trace types to include in response

### Trace types

* `"trace"`: Basic execution trace information
* `"vmTrace"`: Virtual machine execution trace
* `"stateDiff"`: State differences caused by transactions

## Response

The method returns an array of trace results for each transaction in the block.

### Response structure

**Block trace results:**

* Array of trace results, one per transaction in the block
* Each result contains detailed execution traces for the transaction

## Usage example

### Basic implementation

```javascript theme={"system"}
// Replay all transactions in a block with tracing
const replayBlockTransactions = async (blockIdentifier, traceTypes = ['trace']) => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'trace_replayBlockTransactions',
      params: [blockIdentifier, traceTypes],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Example usage
replayBlockTransactions('latest').then(results => {
  console.log(`Replayed ${results.length} transactions`);
  results.forEach((result, index) => {
    console.log(`Transaction ${index + 1}:`);
    if (result.trace) {
      result.trace.forEach(trace => {
        console.log(`  Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
      });
    }
  });
});
```

## Example request

```shell Shell theme={"system"}
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "trace_replayBlockTransactions",
    "params": [
      "latest",
      ["trace"]
    ],
    "id": 1
  }' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
```

## Use cases

The `trace_replayBlockTransactions` method is essential for applications that need to:

* **Block analysis**: Analyze complete blocks with detailed execution traces
* **Performance monitoring**: Monitor transaction execution performance across blocks
* **Analytics platforms**: Build comprehensive blockchain analytics tools
* **Forensic investigation**: Investigate suspicious blocks with complete trace data
* **Compliance monitoring**: Monitor regulatory compliance across entire blocks
* **Development tools**: Build block-level debugging and analysis tools
* **Research platforms**: Support detailed blockchain research and analysis
* **Security auditing**: Audit block execution for security issues
* **MEV analysis**: Analyze Maximum Extractable Value opportunities across blocks
* **Protocol monitoring**: Monitor protocol behavior across multiple transactions

This method provides comprehensive block-level transaction replay capabilities with detailed traces on the Hyperliquid EVM platform.


## OpenAPI

````yaml /openapi/hyperliquid_node_api/evm_trace_replay_block_transactions.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - trace_replayBlockTransactions
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: trace_replayBlockTransactions
      description: >-
        Replays all transactions in a block and returns trace information for
        each transaction. This method provides detailed execution traces for all
        transactions in a specific block.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - trace_replayBlockTransactions
                  default: trace_replayBlockTransactions
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [block identifier, trace types array]'
                  default:
                    - latest
                    - - trace
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: trace_replayBlockTransactions
              params:
                - latest
                - - trace
              id: 1
      responses:
        '200':
          description: Successful response with trace data for all transactions
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: array
                    description: Array of trace results for each transaction in the block
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  - trace:
                      - action:
                          from: 0x...
                          to: 0x...
                          value: '0x0'
                          gas: 0x...
                          input: 0x...
                          callType: call
                        result:
                          gasUsed: '0x5208'
                          output: 0x
                        traceAddress: []
                        type: call

````