Skip to content

Improve mock gas metering - #379

Open
architect-dev wants to merge 7 commits into
masterfrom
feat/gas-metering-improvement
Open

architect-dev wants to merge 7 commits into
masterfrom
feat/gas-metering-improvement

Conversation

@architect-dev

Copy link
Copy Markdown
Collaborator

Realistic gas reporting for mocks.

Foundry - CofheTest.deployMocks() now excludes mock-only work from gas metering by default, so reported gas approximates real-network cost

Hardhat 2 / 3 - MockTaskManager tracks gas used by the mocking machinery and emits a MockGasConsumed(uint256) event per mocked op or allow. Exposes new utilities {hre/conn}.cofhe.getAdjustedGasUsed(receipt) / {hre/conn}.cofhe.getAdjustedGasBreakdown(receipt) which use these events to give an accurate adjusted gas spend. Also adds an opt-in cofhe.gasSummary config item that prints a per-method raw-vs-adjusted table if enabled.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a1384de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@cofhe/mock-contracts Minor
@cofhe/foundry-plugin Minor
@cofhe/hardhat-plugin Minor
@cofhe/hardhat-3-plugin Minor
@cofhe/site Minor
@cofhe/abi Minor
@cofhe/react Minor
@cofhe/sdk Minor
@cofhe/example-react Minor

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

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cofhesdk-react Ready Ready Preview Sep 16, 2026 10:06am UTC
1 Skipped Deployment
Project Deployment Actions Updated
cofhesdk-docs Ignored Ignored Sep 16, 2026 10:06am UTC

Request Review

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Vercel previews (commit a1384de)

Project Deployment Updated
docs Visit Preview Sep 16, 2026 10:10 UTC
react Visit Preview Sep 16, 2026 10:08 UTC

… env-gate the shim, scoped summary scans, clamped/deployment-aware reporting
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.

1 participant