diff --git a/credible/backtesting-reference.mdx b/credible/backtesting-reference.mdx index d6c9e90..f2cb18a 100644 --- a/credible/backtesting-reference.mdx +++ b/credible/backtesting-reference.mdx @@ -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`. + +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. + + ```solidity useTraceFilter: true // Recommended for most cases useTraceFilter: false // For RPC providers and endpoints without trace_filter support diff --git a/credible/backtesting.mdx b/credible/backtesting.mdx index 9354d12..e70cd63 100644 --- a/credible/backtesting.mdx +++ b/credible/backtesting.mdx @@ -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.