[TMP - IGNORE] Show STORAGE verbosity diff in hh2 vs hh3 - #8434
[TMP - IGNORE] Show STORAGE verbosity diff in hh2 vs hh3#8434ChristopherDedominici wants to merge 1 commit into
Conversation
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
d7cd5d7 to
b92bf58
Compare
There was a problem hiding this comment.
Pull request overview
Adds two small standalone fixture projects (hh2/ and hh3/) to demonstrate a tracing/verbosity output difference: Hardhat 2 + hardhat-tracer prints storage ops ([SLOAD]/[SSTORE]) in call traces, while Hardhat 3’s native -v call traces don’t.
Changes:
- Introduces an HH3 demo project (TypeScript + Mocha + Ethers) with a minimal contract and test to generate representative traces at
-vvv/-vvvv/-vvvvv. - Introduces an HH2 demo project (CommonJS +
hardhat-tracer) running the same contract/test flow and documenting the tracer verbosity ladder. - Adds READMEs capturing expected outputs and how to reproduce the comparison.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| hh3/tsconfig.json | TS compiler settings for the HH3 demo project. |
| hh3/test/verbosity.test.ts | HH3 test that runs deploy/initialize/version/revert to produce traces. |
| hh3/README.md | HH3 reproduction steps + captured -vvvv output and explanation. |
| hh3/package.json | HH3 demo dependencies and trace convenience scripts. |
| hh3/hardhat.config.ts | HH3 config enabling the Mocha+Ethers toolbox and Solidity version alignment. |
| hh3/contracts/Initializable__Mock.sol | Minimal contract that performs SSTORE/SLOAD to make the trace difference visible. |
| hh3/.gitignore | Ignores build outputs, artifacts, and node_modules for the HH3 demo. |
| hh2/test/verbosity.test.js | HH2 test (same flow as HH3) to generate comparable traces. |
| hh2/README.md | HH2 reproduction steps + tracer verbosity ladder + captured --fulltrace output. |
| hh2/package.json | HH2 demo dependencies and scripts (--trace / --fulltrace). |
| hh2/package-lock.json | NPM lockfile for HH2 demo dependencies. |
| hh2/hardhat.config.js | HH2 config enabling ethers/chai matchers + hardhat-tracer. |
| hh2/contracts/Initializable__Mock.sol | Same minimal contract as HH3 for an apples-to-apples comparison. |
| hh2/.gitignore | Ignores artifacts/cache and node_modules for the HH2 demo. |
| "@nomicfoundation/hardhat-ethers": "3.0.9", | ||
| "chai": "^4.3.10", | ||
| "ethers": "^6.13.0", | ||
| "hardhat": "2.26.1", |
| { | ||
| "name": "hh2-storage-verbosity-demo", | ||
| "version": "0.0.1", | ||
| "lockfileVersion": 3, | ||
| "requires": true, | ||
| "packages": { | ||
| "": { | ||
| "name": "hh2-storage-verbosity-demo", | ||
| "version": "0.0.1", | ||
| "devDependencies": { | ||
| "@nomicfoundation/hardhat-chai-matchers": "2.0.8", | ||
| "@nomicfoundation/hardhat-ethers": "3.0.9", |
How to run hh2 and hh3
Both projects are set up to demonstrate the difference in how storage ops
(
SLOAD/SSTORE) appear in test call traces: Hardhat 2 +hardhat-tracerdoes show them; Hardhat 3's native
-vdoes not at any level.hh3 (Hardhat 3 — native
-v)node_modulesis symlinked to the monorepo's workspace build, so it runsas-is here. (Standalone, run
npm installfirst.)-vvv,-vvvv,-vvvvv— more frames appear, but never[SLOAD]/[SSTORE].npm run trace:3/trace:4/trace:5.hh2 (Hardhat 2 —
hardhat-tracer)--fulltrace(=--vvvv) is the level that prints storage on all txs.--vvshows storage for failed txs only;--traceshows calls+eventswithout storage.
What you'll see
Same script, same transaction, verbosity 4 on both:
--fulltrace→ theinitialize(7)frame prints its two[SSTORE]s[SLOAD]s +[EVENT], andversion()prints its[SLOAD].-vvvv→ only the call frame + gas + return; no storage lines atany level.
Both tests pass; the divergence is purely in what the trace renders. Each
folder's
README.mdhas the full captured output and the ladder of flags.