Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changelog/verify-optimizer-runs-mismatch-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
forge-verify: patch
---

Reported the local optimizer runs in the `forge verify-bytecode` settings mismatch instead of the string `unknown`, which the only caller could not reach.
9 changes: 5 additions & 4 deletions crates/verify/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,13 @@ fn find_mismatch_in_settings(
);
mismatches.push(str);
}
if local_settings.optimizer_runs.is_some_and(|runs| etherscan_settings.runs != runs as u64)
|| (local_settings.optimizer_runs.is_none() && etherscan_settings.runs > 0)
// The only caller reaches this with a `Config` from `load_config`, which has run
// `normalize_optimizer_settings`, so `optimizer_runs` is always set by now.
if let Some(local_runs) = local_settings.optimizer_runs
&& etherscan_settings.runs != local_runs as u64
{
let str = format!(
"Optimizer runs mismatch: local={}, onchain={}",
local_settings.optimizer_runs.map_or("unknown".to_string(), |runs| runs.to_string()),
"Optimizer runs mismatch: local={local_runs}, onchain={}",
etherscan_settings.runs
);
mismatches.push(str);
Expand Down
Loading