trace_replayBlockTransactions
Replays all transactions in a block on Base and returns the requested traces.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
Use Cases#
- Block replay - Re-execute all transactions with full trace output
- State diff analysis - Get state changes for every transaction in a block
- VM trace extraction - Obtain detailed EVM execution traces for consumer dApps, SocialFi, NFT marketplaces, and merchant payment integrations
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
blockNumber | QUANTITY|TAG | Yes | Block number in hex or tag |
traceTypes | Array | Yes | Trace types: ["trace"], ["vmTrace"], ["stateDiff"], or combinations |
Request#
{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": ["latest", ["trace"]],
"id": 1
}
Code Examples#
- cURL
- JavaScript
- Python
curl -X POST https://api-base-mainnet-archive.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": ["latest", ["trace"]],
"id": 1
}'
import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-base-mainnet-archive.n.dwellir.com/YOUR_API_KEY');
const results = await provider.send('trace_replayBlockTransactions', [
'latest',
['trace']
]);
console.log('Transactions replayed:', results.length);
for (const result of results.slice(0, 3)) {
console.log(` Tx ${result.transactionHash}: ${result.trace.length} traces`);
}
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-base-mainnet-archive.n.dwellir.com/YOUR_API_KEY'))
results = w3.provider.make_request('trace_replayBlockTransactions', [
'latest',
['trace']
])
for tx in results['result'][:3]:
print(f'Tx {tx["transactionHash"]}: {len(tx["trace"])} traces')
Related Methods#
trace_replayTransaction- Replay a single transactiontrace_block- Get traces without replaytrace_filter- Filter traces by criteria