Skip to content

Forks incorrectly use the default hardfork #13040

@die-herdplatte

Description

@die-herdplatte

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.5.1-dev Commit SHA: e589ccf

What version of Foundryup are you on?

foundryup: 1.5.0

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

When creating forks, the default Spec (hardfork) is being used for it (currently prague).
This is surprising as I would expect it to either use the fork's actual EVM version or keep the environment's Spec (which is the behavior that the section on evm_version configuration suggests).

The following test fails:

/// forge-config: default.evm_version = "cancun"
function testKeepsEvmVersion() public {
    assertEq(vm.getEvmVersion(), "cancun");
    vm.createSelectFork("anyfork", 1);
    vm.assertEq(vm.getEvmVersion(), "cancun"); // is "prague"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bugType: bugT-needs-triageType: this issue needs to be labelled

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions