Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Mar 3, 2025

This PR contains the following updates:

Package Change Age Confidence
hardhat-gas-reporter ^1.0.9^2.0.0 age confidence

Release Notes

cgewecke/hardhat-gas-reporter (hardhat-gas-reporter)

v2.3.0: Etherscan API V2

Compare Source

This release migrates the plugin to Etherscan's new V2 API. (V1 will stop working in June 2025). A benefit of this change is that you'll only need a single API key to access any of the L1 and L2 networks Etherscan supports. As a result, the plugin's L1Etherscan and L2Etherscan options are being deprecated in favor of a new etherscan option.

Your existing L1Etherscan key will continue to work.

To simplify your reporter config as you make this upgrade, make the change below:

const config: HardhatUserConfig = {
  gasReporter: {
+    etherscan: "ABC...", // Same value as your old `L1Etherscan` key
-    L1Etherscan: "ABC...",  
-    L2Etherscan: "DEF..."
  }
}

(You'll continue to see price data even if you don't change your config. The plugin defaults to using your L1Etherscan key if it doesn't see the newer option set.)

What's Changed

Full Changelog: cgewecke/hardhat-gas-reporter@v2.2.3...v2.3.0

v2.2.3: Small L2 Bug Fixes

Compare Source

This release fixes two small bugs affecting L2 gas reporting:

  • Sub-gwei L1 baseFees were being incorrectly rounded to zero when calculating OPStack chain costs.
  • Setting a gasPrice on the Hardhat Network config could result in test suites which emulate Arbitrum hanging (thanks to @​mattador1 for reporting and helping debug this)
  • We've also updated the viem package (which should resolve npm installation warnings for one of its transitive dependencies)
What's Changed

Full Changelog: cgewecke/hardhat-gas-reporter@v2.2.2...v2.2.3

v2.2.2: Support solc 0.8.28 features

Compare Source

What's Changed

New Contributors

Full Changelog: cgewecke/hardhat-gas-reporter@v2.2.1...v2.2.2

v2.2.1: Fix L1 Etherscan api key logic

Compare Source

Bug Fixes

Recently, Etherscan began requiring an api key to fetch live gasPrice and baseFee data for Ethereum mainnet. This release fixes a bug in the way the L1Etherscan api key option was set which caused those data calls to fail.

Full Changelog: cgewecke/hardhat-gas-reporter@v2.2.0...v2.2.1

v2.2.0: Gas Golfing Support

Compare Source

New

This release adds a trackGasDeltas option.

When enabled, the reporter displays changes in gas usage between test runs - super useful for optimization work.

Many thanks to @​0xVolosnikov for writing this feature.

Screen Shot 2024-05-23 at 11 40 47 AM

Bugfixes

  • A bug that prevented correct identification of factory deployed contracts in some cases has been fixed. (Thanks to @​CSY54 for reporting and providing a nice reproduction case to add to the test suite).
PRs

New Contributors

Full Changelog: cgewecke/hardhat-gas-reporter@v2.1.1...v2.2.0

v2.1.1: Allow sub-gwei blobBaseFee

Compare Source

What's Changed

  • Fix bug in pricing for OP stack chains when the reported L1 blobBaseFee drops below 1 gwei by @​cgewecke in #​228

Full Changelog: cgewecke/hardhat-gas-reporter@v2.1.0...v2.1.1

v2.1.0: Arbitrum & Base L2 Network Support

Compare Source

What's New

  • Arbitrum and Base have been added to the list of L2 networks the gas reporter can emulate
    gasReporter: {
      L2: "arbitrum" | "base" | "optimism",
      L2Etherscan: "ABC....",
      coinmarketcap: "abc...",
    }
  • blobBaseFee is now fetched directly from the OP stack GasOracle contracts (should be accurate)
  • ⚠️ To get live blobBaseFee prices for L2 emulation you'll need to set the L2Etherscan api key option.
  • the JSON output object now includes a separate intrinsic gas measurement for each transaction. This could be convenient if you want to do more complex post-processing with the gas data.

What's changed

Full Changelog: cgewecke/hardhat-gas-reporter@v2.0.2...v2.1.0

v2.0.2: Fix crash with --parallel flag

Compare Source

What's Changed

Full Changelog: cgewecke/hardhat-gas-reporter@v2.0.1...v2.0.2

v2.0.1: Optimism Ecotone (EIP-4844)

Compare Source

What's Changed

Full Changelog: cgewecke/hardhat-gas-reporter@v2.0.0...v2.0.1

v2.0.0: : Optimism L2 & View/Pure Method Gas

Compare Source

Screen Shot 2024-03-14 at 12 48 35 PM

What's New

  • Configuration for chains with Etherscan support has been simplified to a single key. Just set the L1 option to one of the supported networks and the reporter will take care of the rest. (You'll still need a coinmarketcap api key)

    gasReporter: {
      L1: "gnosis",
      coinmarketcap: "abc...",
    }
  • Gas reporting for L2 networks is coming online, starting with Optimism.

    gasReporter: {
      L2: "optimism",
      coinmarketcap: "abc...",
    }
  • Gas metrics for view and pure methods are now available as an option. You can also exclude intrinsic gas costs for state-changing methods. (⚠️ There are performance hits when the view and pure options are enabled)

    gasReporter: {
      // Debits intrinsic gas for state-changing method calls in order to model contracts
      // that will never be called by an EOA
      includeIntrinsicGas: false,
    
      // This option executes an additional `eth_estimateGas` for every `eth_call`
      // detected by the reporter. If you have 1000's of tests setting it to true has a
      // noticeable performance impact
      reportPureAndViewMethods: true,
    
      // This option can add SIGNIFICANT LAG to test startup time if you have
      // 100's of contracts in your project. (It parses all the sources in your dependency tree
      // to identify state variable declarations)
      excludeAutoGeneratedGetters: true,
    }
  • There are multiple report formats, including markdown.

  • The reporter now supports sub-gwei gas prices. Sub-penny cost display is possible by configuring the currencyDisplayPrecision option

  • Dedicated support for the OpenZeppelin Upgrades plugin has been added. (Their proxy pattern often resulted in missing gas data because the reporter didn't know what contract was being called - that's all handled under the hood now.)

  • Dedicated support for the hardhat-viem plugin has been added (this was broken and should be fixed by this release)

  • There are many new output, display and low-level options - check out the Config Examples section of the docs

  • There's additional support for custom proxy contract resolution. If you're routing your calls through contract middleware you can configure the reporter to understand how that works and get the data you expect.

  • Additionally:

    • eth-gas-reporter's logic has been ported here and translated to Typescript
    • The plugin has been decoupled from Mocha so it can be seamlessly integrated with lots of other tasks or test frameworks
    • There have been big architectural changes and testing improvements and additional features are in the pipeline

Breaking

  • Codechecks support was removed because it hasn't been accepting users for a while. I loved codechecks. (Building a github action for the reporter is on the V2 roadmap though).
  • The JSON object emitted by the reporter has changed to reflect the plugin's internal types. If you've been post-processing that data you'll need to look at the JSON Output docs and update your logic.
  • The gas-reporter:merge task has been renamed hhgas:merge
  • The onlyCalledMethods option has been renamed showUncalledMethods and must be set to true (if you want that).

Funding

Work on V2 was funded in part by OpenZeppelin via DRIPS, a public goods protocol that helps direct funding to packages in your dependency tree. If you're using DRIPS and want to add hardhat-gas-reporter to the packages you support its page is here.

Full Changelog: cgewecke/hardhat-gas-reporter@v1.10.0...v2.0.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.65%. Comparing base (8c101ad) to head (84d9f72).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #197      +/-   ##
==========================================
- Coverage   99.65%   99.65%   -0.01%     
==========================================
  Files          23       23              
  Lines        1175     1164      -11     
==========================================
- Hits         1171     1160      -11     
  Misses          4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 821da8e to 15eb556 Compare August 10, 2025 12:48
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 15eb556 to b6a1429 Compare August 19, 2025 19:13
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from b6a1429 to e1cffbb Compare August 31, 2025 10:31
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from e1cffbb to 196ae1b Compare September 25, 2025 13:48
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 196ae1b to c87d6c6 Compare October 22, 2025 01:34
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from c87d6c6 to 88ad997 Compare November 10, 2025 16:56
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 88ad997 to 1b056fa Compare November 18, 2025 14:58
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 1b056fa to 3c7d9cd Compare December 3, 2025 19:58
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 3c7d9cd to 84d9f72 Compare December 31, 2025 16:02
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 84d9f72 to 9ec03d4 Compare January 8, 2026 19:07
@renovate renovate bot force-pushed the renovate/hardhat-gas-reporter-2.x branch from 9ec03d4 to 8f54211 Compare January 19, 2026 19:15
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.

2 participants