Skip to content

[TMP - IGNORE] Show STORAGE verbosity diff in hh2 vs hh3 - #8434

Draft
ChristopherDedominici wants to merge 1 commit into
mainfrom
logs-storage-diff
Draft

[TMP - IGNORE] Show STORAGE verbosity diff in hh2 vs hh3#8434
ChristopherDedominici wants to merge 1 commit into
mainfrom
logs-storage-diff

Conversation

@ChristopherDedominici

Copy link
Copy Markdown
Contributor

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-tracer
does show them; Hardhat 3's native -v does not at any level.

hh3 (Hardhat 3 — native -v)

cd hh3
npx hardhat test test/verbosity.test.ts -vvvv
  • node_modules is symlinked to the monorepo's workspace build, so it runs
    as-is here. (Standalone, run npm install first.)
  • Try -vvv, -vvvv, -vvvvv — more frames appear, but never
    [SLOAD]/[SSTORE].
  • Shortcuts: npm run trace:3 / trace:4 / trace:5.

hh2 (Hardhat 2 — hardhat-tracer)

cd hh2
npm install
npx hardhat test --fulltrace   # or: npm run fulltrace
  • --fulltrace (= --vvvv) is the level that prints storage on all txs.
    --vv shows storage for failed txs only; --trace shows calls+events
    without storage.

What you'll see

Same script, same transaction, verbosity 4 on both:

  • hh2 --fulltrace → the initialize(7) frame prints its two [SSTORE]s
    • leading [SLOAD]s + [EVENT], and version() prints its [SLOAD].
  • hh3 -vvvv → only the call frame + gas + return; no storage lines at
    any level.

Both tests pass; the divergence is purely in what the trace renders. Each
folder's README.md has the full captured output and the ladder of flags.

image

Copilot AI review requested due to automatic review settings July 8, 2026 15:07
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b92bf58

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@socket-security

socket-security Bot commented Jul 8, 2026

Copy link
Copy Markdown

@socket-security

socket-security Bot commented Jul 8, 2026

Copy link
Copy Markdown

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm yargs is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: ?npm/mocha@11.7.6npm/yargs@17.7.3

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/yargs@17.7.3. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread hh3/test/verbosity.test.ts
Comment thread hh2/package-lock.json

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated 2 comments.

Comment thread hh2/package.json
Comment on lines +13 to +16
"@nomicfoundation/hardhat-ethers": "3.0.9",
"chai": "^4.3.10",
"ethers": "^6.13.0",
"hardhat": "2.26.1",
Comment thread hh2/package-lock.json
Comment on lines +1 to +12
{
"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",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants