Skip to content

feat(cheatcodes): add vm.startGasRecording + vm.stopGasRecording  #7900

@frolic

Description

@frolic

Following the lastCallGas addition here: https://github.com/foundry-rs/forge-std/releases/tag/v1.8.2

I'd love to see some way to startGasRecording and stopGasRecording (similar to logs, state diff/mapping recordings) where we can record and retrieve a list of Gas[] to iterate over.

This would give us much finer control (and I assume accuracy) over the gas measuring strategy we use here:
https://github.com/latticexyz/mud/blob/main/packages/gas-report/README.md
https://github.com/latticexyz/mud/blob/main/packages/gas-report/src/GasReporter.sol

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions