Skip to content

bug: invariant setup failure with compiler profiles enabled #9731

@grandizzy

Description

@grandizzy

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What version of Foundryup are you on?

No response

What command(s) is the bug in?

No response

Operating System

None

Describe the bug

Steps to reproduce:

  • git clone https://github.com/ethereum-optimism/optimism.git
  • git checkout opcm-up/upgrade-asr - branch with following compiler profiles enabled
additional_compiler_profiles = [
  { name = "dispute", optimizer_runs = 5000 },
]
compilation_restrictions = [
  { paths = "src/dispute/FaultDisputeGame.sol", optimizer_runs = 5000 },
  { paths = "src/dispute/PermissionedDisputeGame.sol", optimizer_runs = 5000 },
  { paths = "src/L1/OPContractsManager.sol", optimizer_runs = 5000 },
]
  • cd optimism/packages/contracts-bedrock
  • forge test --mt invariant_gasLimitBoundaries fails with
Ran 1 test for test/invariants/SystemConfig.t.sol:SystemConfig_GasLimitBoundaries_Invariant
[FAIL: failed to set up invariant testing environment: src/universal/Proxy.sol:Proxy does not have the selector 0xb40a817c] invariant_gasLimitBoundaries() (runs: 0, calls: 0, reverts: 0)
Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 9.84ms (4.89ms CPU time)

Ran 1 test suite in 49.66ms (9.84ms CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests)

Failing tests:
Encountered 1 failing test in test/invariants/SystemConfig.t.sol:SystemConfig_GasLimitBoundaries_Invariant
[FAIL: failed to set up invariant testing environment: src/universal/Proxy.sol:Proxy does not have the selector 0xb40a817c] invariant_gasLimitBoundaries() (runs: 0, calls: 0, reverts: 0)
  • test pass if removing compiler profiles from foundry.toml and forge clean && forge build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions