Repository navigation
Conversation
Wodann
temporarily deployed
to
github-action-benchmark
October 3, 2026 13:24 — with
GitHub Actions
Inactive
🦋 Changeset detectedLatest commit: cdde332 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1809 +/- ##
==========================================
- Coverage 81.51% 81.51% -0.01%
==========================================
Files 473 473
Lines 84041 84105 +64
Branches 84041 84105 +64
==========================================
+ Hits 68505 68554 +49
- Misses 13245 13254 +9
- Partials 2291 2297 +6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Wodann
temporarily deployed
to
github-action-benchmark
October 3, 2026 13:31 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 3, 2026 13:31 — with
GitHub Actions
Failure
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 4, 2026 00:08
254b7b0 to
1264638
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 4, 2026 00:08 — with
GitHub Actions
Inactive
Wodann
temporarily deployed
to
github-action-benchmark
October 4, 2026 00:13 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 4, 2026 00:13 — with
GitHub Actions
Failure
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 5, 2026 20:30
1264638 to
12ef4b3
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 5, 2026 20:30 — with
GitHub Actions
Inactive
Wodann
temporarily deployed
to
github-action-benchmark
October 5, 2026 21:06 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 5, 2026 21:06 — with
GitHub Actions
Failure
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 6, 2026 22:12
12ef4b3 to
508e73b
Compare
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 6, 2026 22:13
508e73b to
ff9e522
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 6, 2026 22:14 — with
GitHub Actions
Inactive
Wodann
temporarily deployed
to
github-action-benchmark
October 6, 2026 22:22 — with
GitHub Actions
Inactive
Wodann
temporarily deployed
to
github-action-benchmark
October 6, 2026 22:22 — with
GitHub Actions
Inactive
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 7, 2026 15:47
ff9e522 to
6f6f717
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 7, 2026 15:47 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 7, 2026 15:52 — with
GitHub Actions
Failure
Wodann
had a problem deploying
to
github-action-benchmark
October 7, 2026 15:52 — with
GitHub Actions
Error
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 7, 2026 16:34
6f6f717 to
1bc8f61
Compare
Wodann
requested a deployment
to
github-action-benchmark
October 7, 2026 16:34 — with
GitHub Actions
Queued
Wodann
temporarily deployed
to
github-action-benchmark
October 7, 2026 17:24 — with
GitHub Actions
Inactive
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 19, 2026 15:54
0e1814b to
1b08b38
Compare
Wodann
had a problem deploying
to
github-action-benchmark
October 19, 2026 15:54 — with
GitHub Actions
Error
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 19, 2026 16:17
1b08b38 to
e63dcd4
Compare
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 19, 2026 16:18
e63dcd4 to
5e7efe4
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 19, 2026 16:18 — with
GitHub Actions
Inactive
Wodann
temporarily deployed
to
github-action-benchmark
October 19, 2026 16:24 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 19, 2026 16:24 — with
GitHub Actions
Failure
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 19, 2026 17:29
5e7efe4 to
a8fe85c
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 19, 2026 17:29 — with
GitHub Actions
Inactive
Wodann
temporarily deployed
to
github-action-benchmark
October 19, 2026 17:33 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 19, 2026 17:33 — with
GitHub Actions
Failure
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 21, 2026 21:10
a8fe85c to
6b8cf3b
Compare
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 21, 2026 22:04
6b8cf3b to
daa45d9
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 21, 2026 22:04 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 21, 2026 22:07 — with
GitHub Actions
Error
Wodann
had a problem deploying
to
github-action-benchmark
October 21, 2026 22:07 — with
GitHub Actions
Error
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 21, 2026 22:17
daa45d9 to
559ed77
Compare
Wodann
temporarily deployed
to
github-action-benchmark
October 21, 2026 22:18 — with
GitHub Actions
Inactive
Wodann
had a problem deploying
to
github-action-benchmark
October 21, 2026 22:24 — with
GitHub Actions
Error
Wodann
had a problem deploying
to
github-action-benchmark
October 21, 2026 22:24 — with
GitHub Actions
Error
Wodann
force-pushed
the
perf/traces-on-demand-v2
branch
from
October 21, 2026 22:49
559ed77 to
062845c
Compare
Hardhat 2 only reads the EVM traces of a response when a VM event listener exists. Plugins like coverage or tracers register one, but the harness registered none, so it never measured that path.
`Provider.setIncludeCallTraces` sets which call traces the responses of later requests include. It follows the `setVerboseTracing` plumbing: `SyncProvider`, then `Provider`, then a `SetIncludeCallTraces` message that the event loop applies to `ProviderData`. Traces that are not included are never collected. A consumer that reads traces conditionally can keep collection off while nothing reads them.
Hardhat 2 created its provider with `includeCallTraces: All`. Every response then recorded and retained a call trace arena, even without a VM event listener to read it. The provider is now created without call traces. Before each request, the wrapper evaluates whether a VM event listener exists. When that differs from the last applied value, it calls `setIncludeCallTraces`. `hardhat_reset` recreates the provider from the creation-time config, so the tracked value resets with it.
The tracing inspector recorded step stack and memory snapshots for every transaction, even while responses excluded call traces. Only `Response::traces()` reads those snapshots. It only has call traces to read while they are included. The Solidity stack-trace path reads only `pc` and `op`. `recorded_stack()` and `records_memory()` now record nothing while `include_call_traces` is `None`. The observer config is built from them for each EVM run, so `setIncludeCallTraces` also switches recording.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With #1301, Hardhat 2 creates its provider with
includeCallTraces: All, so every response records, retains and tears down a call trace arena. Hardhat 2 only reads those traces when a plugin has registered a VM event listener, which the provider benchmark and most projects never do. On the benchmark that static cost is 1.11×main.This PR collects traces only while a listener exists, and records per-step stack and memory snapshots only while traces are collected.
What changes
Provider.setIncludeCallTraces(includeCallTraces)sets which call traces the responses of later requests include, through the same plumbing assetVerboseTracing:SyncProvider,edr_provider::Provider, aSetIncludeCallTracesmessage applied toProviderDataby the event loop (crates/edr_napi/src/provider.rs,crates/edr_provider/src/event_loop.rs).includeCallTraces. Before each request the wrapper evaluates its existingneedsTracesexpression and calls the setter when the value changed since the last call, so a process with plugins makes one napi call.hardhat_resetrecreates the inner provider from the creation-time config and resets the tracked value (patches/hardhat@2.28.6.patch).includeCallTraces.ObservabilityConfig::recorded_stack()andrecords_memory()returnNone/falsewhile call traces are excluded. OnlyResponse::traces()reads step snapshots; the stack-trace path readspcandop. The observer config is built per EVM run, so the setter switches recording too (crates/edr_provider/src/observability.rs).pnpm providerBenchmark --vm-step-listenerregisters a no-opsteplistener so the trace-reading path can be measured (js/benchmark).Compatibility
includeCallTracesper provider as before; no change.needsTracesis evaluated per request.Benchmark Results
Provider benchmark on
edr-benchmark-runner,mainbaselineea0b7fc1e. "#1301 alone" is the series with traces statically enabled (run 37063378094); "this PR" is the same series with these commits (run 37088120381, zero alerts). Both runs were taken on top of #1562, which was measured at 0.97×mainon this path.With a listener attached (
--vm-step-listener, local idle machine, medians of 5), this PR against the EDR that Hardhat 2.29.1 ships: seaport 0.82×, uniswap-v3-core 0.84×, openzeppelin 0.87× in wall time; peak RSS 0.83× to 0.88×. Against #1301 alone the listener path is unchanged within 1% on uniswap-v3-core and openzeppelin and 0.66× on seaport.Hardhat 3 regression benchmark on the series including these commits: run 37093003911, 99 entries across 11 scenarios, zero alerts.
Validation
crates/edr_napipnpm test: 95 passing, 1 pending. New: traces absent by default, present with per-step top-of-stack aftersetIncludeCallTraces(All), absent afterNone.cargo test -p edr_provider: two new unit tests onrecorded_stack()/records_memory()for excluded and included traces.hardhat-tests: 2811 passing, 167 pending. Thetrace-event-bridgespec adds: no listener yields no traces; a listener added then removed gets traces only while registered; a listener kept acrosshardhat_resetstill gets steps; a listener removed before a reset and re-added after it. Removing the reset line from the installed patch makes the third case fail.-D warnings,cargo fmt,pnpm lint,pnpm build:typingFile,pnpm install --frozen-lockfile: clean.Notes for review
main.recordStack: Topallocates a one-element stack copy per step while traces are included, which is why recording is gated onincludeCallTracesrather than left to the configured value alone.falserather than "unknown": the new inner provider is created withNone, so this is the same state, and a listener that survives the reset triggers oneAllcall on the next request.needsTracestoggling in build: upgrade Hardhat 2 to @nomicfoundation/edr v0.25.1 hardhat#7985.