Skip to content

Conversation

grandizzy
Copy link
Collaborator

@grandizzy grandizzy commented Oct 8, 2025

Motivation

    /// Returns the execution evm version.
    #[cheatcode(group = Evm, safety = Safe)]
    function getEvmVersion() external pure returns (string memory evm);

    /// Set the execution evm version.
    #[cheatcode(group = Evm, safety = Safe)]
    function setEvmVersion(string calldata evm) external;

Solution

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@grandizzy grandizzy added this to the v1.5.0 milestone Oct 8, 2025
@grandizzy grandizzy marked this pull request as ready for review October 8, 2025 06:32
0xrusowsky
0xrusowsky previously approved these changes Oct 8, 2025
Copy link
Contributor

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

unsure if this solves the original ticket entirely, given some evm versions also imply changes in solc and therefore the resulting artifacts. for example, earlier evm versions do not support tstore/tload. wdyt?

@grandizzy
Copy link
Collaborator Author

unsure if this solves the original ticket entirely, given some evm versions also imply changes in solc and therefore the resulting artifacts. for example, earlier evm versions do not support tstore/tload. wdyt?

yep, good point, I updated comment to prevent closing the issue. For the 2nd part I think we could extend the additional compilation profiles as in #9840 (comment)

zerosnacks
zerosnacks previously approved these changes Oct 8, 2025
Copy link
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

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

code changes lgtm & i can see how this can be useful, agreeing on the comments above on it being a partial solution.

@grandizzy grandizzy enabled auto-merge (squash) October 8, 2025 12:35
@grandizzy grandizzy requested a review from onbjerg October 8, 2025 12:35
#[cheatcode(group = Evm, safety = Unsafe)]
function coolSlot(address target, bytes32 slot) external;

/// Returns the execution evm version.
Copy link
Member

Choose a reason for hiding this comment

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

actually can we add a note on the cheatcodes docs too? that runtime/execution evm version is not the same as compilation one

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 updated in 0838c54

@grandizzy grandizzy disabled auto-merge October 8, 2025 12:49
@DaniPopes
Copy link
Member

string also is not the best because you don't encode the hierarchy that we have with integer/enum, eg that cancun enables paris, london etc

@grandizzy grandizzy dismissed stale reviews from 0xrusowsky and zerosnacks via 0c9f919 October 8, 2025 12:57
@grandizzy
Copy link
Collaborator Author

grandizzy commented Oct 8, 2025

string also is not the best because you don't encode the hierarchy that we have with integer/enum, eg that cancun enables paris, london etc

can you pls detail, I thought these are OK to return from getEvmVersion call https://github.com/bluealloy/revm/blob/1bf799dd51648d3c8114b1a7496133ed8bc6603f/crates/primitives/src/hardfork.rs#L98

For setting it I reused the same as config does to be consistent

pub fn evm_spec_id(evm_version: EvmVersion) -> SpecId {

@grandizzy grandizzy requested a review from DaniPopes October 8, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants