Skip to content

perf(anvil): avoid debug_traceBlock prefix replay#14858

Open
Perico-perica46 wants to merge 1 commit into
foundry-rs:masterfrom
Perico-perica46:perf/anvil-debug-trace-block-replay
Open

perf(anvil): avoid debug_traceBlock prefix replay#14858
Perico-perica46 wants to merge 1 commit into
foundry-rs:masterfrom
Perico-perica46:perf/anvil-debug-trace-block-replay

Conversation

@Perico-perica46
Copy link
Copy Markdown
Contributor

Motivation

debug_traceBlockByHash and debug_traceBlockByNumber traced each mined transaction by calling debug_traceTransaction. For supported geth built-in tracers, transaction tracing can replay the transactions before the target from the parent block state, so tracing a full block repeats the same prefixes.

Solution

Replay mined blocks once for supported geth built-in tracers, creating a fresh inspector per transaction and committing each result into a local cache before tracing the next transaction. Unsupported tracer modes keep the existing per-transaction fallback path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant