Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions credible/backtesting-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,15 @@ Controls how transactions are detected in the block range.
**`false`:** Scans each block individually
- One `eth_getBlockByNumber` call per block
- Only detects direct calls where `tx.to == targetContract`
- Does not detect internal calls (e.g., when another contract calls your target contract through a router or aggregator)
- **RPC calls for 100 blocks:** ~100 calls

Use `trace_filter` for large block ranges or when you need to detect internal calls. Use block scanning when your RPC provider doesn't support `trace_filter`.

<Note>
Not all RPC providers support `trace_filter`, and some providers only support it on certain networks. Check your provider's documentation to confirm `trace_filter` availability for your target chain.
</Note>

```solidity
useTraceFilter: true // Recommended for most cases
useTraceFilter: false // For RPC providers and endpoints without trace_filter support
Expand Down
4 changes: 2 additions & 2 deletions credible/backtesting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Backtesting operates in two phases:
2. **Transaction Validation**: Replays each transaction with your assertion enabled

The tool fetches transactions using one of two methods:
- **trace_filter API** (recommended): Single RPC call for the entire block range, detects internal calls
- **Block scanning**: One RPC call per block, detects only direct calls
- **trace_filter API** (recommended): Single RPC call for the entire block range, detects both direct and internal calls (e.g., when Contract A calls your target Contract B through a router or aggregator)
- **Block scanning**: One RPC call per block, detects only direct calls where `tx.to` equals your target contract (does not detect internal calls)

For validation, the tool forks the EVM at each transaction to the target contract and replays it against the specified assertion.

Expand Down