Skip to content

[Forge test] [Cheatcode support] Validate gas metering cheatcodes work in PVM mode #381

@filip-parity

Description

@filip-parity

At the moment the gas metering cheatcodes (pauseGasMetering, resumeGasMetering, resetGasMetering) are not validated for PVM mode. When tests use these cheatcodes while running in pallet-revive execution mode, they fall back to the default EVM handler.

Expected Behavior

vm.pauseGasMetering()

  • When calling vm.pauseGasMetering():
  • Gas metering should be paused in the EVM execution context
  • The cheatcode should work correctly in both EVM and PVM execution modes
  • In PVM mode, gas metering should also be paused or handled appropriately
  • Subsequent gas consumption should not be counted until vm.resumeGasMetering() is called

vm.resumeGasMetering()

  • When calling vm.resumeGasMetering():
  • Gas metering should be resumed in the EVM execution context
  • The cheatcode should work correctly in both EVM and PVM execution modes
  • In PVM mode, gas metering should resume normal tracking
  • Gas consumption should be counted again after this call

vm.resetGasMetering()

  • When calling vm.resetGasMetering():
  • Gas should be reset to the frame's gas limit in the EVM execution context
  • The cheatcode should work correctly in both EVM and PVM execution modes
  • In PVM mode, gas should be reset appropriately
  • Subsequent gasleft() calls should reflect the reset value

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions