debug_traceCallMany: strip filler blocks from overrides result#11348
Conversation
**Q: Bug?** A: `debug_traceCallMany` overrides path returned traces for every simulated block, including the filler blocks `SimulateTxExecutor` inserts when `BlockOverride.Number` has gaps. Result count no longer matched the input bundles. **Q: Fix?** A: Compute each bundle's target block number (same `overrideNumber ?? lastBlockNumber + 1` rule the executor uses) and filter `simulationResult.Data` down to that set. Regression test covers a non-contiguous gap between two bundles.
|
@claude review |
|
Claude finished @LukaszRozmej's task in 4m 59s —— View job Code Review
SummaryThe fix is logically correct and addresses a real bug. The FindingsMedium — Logic coupling: duplicated block-number-resolution formulaFile:
The PR description acknowledges the formula is the same as the executor's, but doesn't address the maintenance risk. The right long-term fix is to either:
For now the duplication is safe, but this should be either addressed or explicitly acknowledged with rationale. Low — No completeness check after filteringIEnumerable<IEnumerable<GethLikeTxTrace>> bundleTraces = simulationResult.Data
.Where(blockResult => blockResult.Number is long n && bundleBlockNumbers.Contains(n))
.Select(blockResult => blockResult.Traces);If (due to a future bug) a bundle's target block is absent from // After filtering:
Debug.Assert(bundleTraces.Count() == bundles.Length, "Unexpected result count after filler-block filter");This is low-severity because the current executor guarantees all requested blocks appear in the output, but defensive code here would catch regressions early. Low — Test gap: only covers
|
|
Added the gap=1 boundary case for "Test gap"; skipping "Logic coupling" (extracting a helper just relocates the duplication unlessSimulateTxExecutor also calls it — better as a separate IsFiller refactor PR) and "No completeness check" (Debug.Assert compiles out in Release, so it wouldn't guard prod). |
|
@claude review |
|
Claude finished @svlachakis's task in 2m 0s —— View job Code Review
SummaryThe fix is correct and the test improvements address the prior review's outstanding gaps. No new issues found. Formula correctness — verifiedThe filter's block-number formula matches
Both iterate over bundles in order and advance Author responses to prior findings — accepted
Minor nit (non-blocking)
VerdictAll prior findings have been addressed or acknowledged with clear rationale. The fix is correct, safe, and well-tested. |
debug_traceCallManyoverrides path returned traces for every simulated block, including the filler blocksSimulateTxExecutorinserts whenBlockOverride.Numberhas gaps. Result count no longer matched the input bundles.Compute each bundle's target block number (same
overrideNumber ?? lastBlockNumber + 1rule the executor uses) and filtersimulationResult.Datadown to that set. Regression test covers a non-contiguous gap between two bundles.