Skip to content

Conversation

@filip-parity
Copy link

TL;DR

This pull request implements vm.warp cheatcode support in polkadot-foundry's PVM mode, following the same pattern as existing cheat codes like vm.roll and vm.setNonce.

Changes

  • Added warpCall handler in revive-strategy/src/cheatcodes/mod.rs
  • Implemented set_timestamp function that updates both EVM context and pallet-revive runtime
  • Added comprehensive test in forge/tests/cli/revive_vm.rs to verify PVM integration
  • Exported Timestamp from revive-env/src/lib.rs for runtime access

How it works

When vm.warp(newTimestamp) is called in PVM mode it:

  • Updates EVM context: ecx.env.block.timestamp = newTimestamp
  • Updates pallet-revive runtime: Timestamp::set_timestamp(newTimestamp)
  • Ensures Solidity block.timestamp reflects the change in both execution contexts

Closes #306

Copy link

@pkhry pkhry left a comment

Choose a reason for hiding this comment

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

LGTM, barring the comments about tracing in output in private.

@filip-parity filip-parity merged commit e9bdb71 into master Sep 23, 2025
27 of 31 checks passed
@filip-parity filip-parity deleted the issues/306 branch September 23, 2025 07:27
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.

[Forge test] [Cheatcode support] Implement vm.warp

4 participants