Skip to content

fix: honor zero optimizer runs during bytecode verification - #678

Open
omerbek wants to merge 1 commit into
circlefin:masterfrom
omerbek:fix/verify-bytecode-optimizer-runs-zero
Open

omerbek wants to merge 1 commit into
circlefin:masterfrom
omerbek:fix/verify-bytecode-optimizer-runs-zero

Conversation

@omerbek

@omerbek omerbek commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • treat optimizerRuns: 0 as a provided value instead of falling through the truthy guard
  • keep the existing validation path for supplied optimizer run values
  • add regression coverage that expects forge build --optimizer-runs 0 to run

Fixes #677.

Testing

  • corepack yarn --ignore-engines hardhat test test/scripts/hardhat/verifyOnChainBytecode.test.ts --grep "optimizerRuns is zero"
  • corepack yarn --ignore-engines prettier scripts/hardhat/verifyOnChainBytecode.ts test/scripts/hardhat/verifyOnChainBytecode.test.ts --check

Note: this local Windows environment has Node v21.6.1 while the repo pins Node 20.18.0, so I used --ignore-engines. The full file test also requires a real Foundry forge build to generate Foundry artifacts; for this focused regression I used the existing static ArtifactType.OPMainnet path and a temp forge stub only for the hardhat-foundry startup checks.

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.

Bytecode verification skips recompilation when optimizerRuns is zero

1 participant