Skip to content

autosetup: keep solc_optimize_map consistent when files change - #105

Merged
jar-ben merged 5 commits into
masterfrom
jaroslav/autosetup-fix-optimize-map-reconciliation
Jul 27, 2026
Merged

autosetup: keep solc_optimize_map consistent when files change#105
jar-ben merged 5 commits into
masterfrom
jaroslav/autosetup-fix-optimize-map-reconciliation

Conversation

@jar-ben

@jar-ben jar-ben commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

sync_compiler_maps_with_files and _update_compiler_maps_for_new_contracts maintained totality for compiler_map / solc_via_ir_map / solc_evm_version_map, but not solc_optimize_map. So when call resolution adds files to a conf that uses a per-contract solc_optimize_map (non-uniform optimizer_runs), the new files have no entry and certoraRun hard-rejects the conf ("files are not matched in solc_optimize_map") before any solc invocation.

Changes

  • sync_compiler_maps_with_files: added a solc_optimize_map trim block (keep only entries matching a contract in files), mirroring solc_via_ir_map / solc_evm_version_map.
  • update_optimize_map_for_contract (new): mirrors update_via_ir_map_for_contract — adds a map entry for a newly-added contract, using the reference map value when present else "200" (the established default; values are strings to match the map). Only the map form is extended; a scalar solc_optimize already covers every file.
  • Wired into _update_compiler_maps_for_new_contracts.

Tests

tests/test_compiler_flag_reconciliation.py: added 4 cases (adds with default, prefers reference value, no-op without a map, no-op when already present). Full file: 12 passed.

@jar-ben
jar-ben requested a review from naftali-g July 26, 2026 06:04
Base automatically changed from jaroslav/autosetup-curated-aave-math to master July 27, 2026 09:54
@jar-ben
jar-ben merged commit e2e2ee3 into master Jul 27, 2026
2 checks passed
@jar-ben
jar-ben deleted the jaroslav/autosetup-fix-optimize-map-reconciliation branch July 27, 2026 09:58
shellygr added a commit that referenced this pull request Jul 29, 2026
Conflict resolution highlights, reconciling the branch with #88/#102/#105/#107:

- _seed_compile_maps: master's setdefault-fold style extended to the declared
  solc_evm_version (folds into a pre-existing map as the default for uncovered
  contracts; seeded only when declared — absence means each solc's default,
  which a map entry cannot express).
- The strict-Yul-steps rung and the relax-autofinders last resort are re-gated
  on master's map-aware _yul_optimizer_pending (the pre-#88 scalar check never
  fired in solc_optimize_map mode); ladder remains add-optimizer -> solc
  default Yul steps -> relax autofinder assertion, one rung per pass.
- get_build_system_config_dict_with_updates: _reconcile_evm_version_keys runs
  BEFORE drop_scalars_superseded_by_maps — the helper expands the declared
  scalar into the map's missing entries, impossible once the scalar is dropped.
- update_evm_version_map_for_contract added beside #105's
  update_optimize_map_for_contract and wired into
  _update_compiler_maps_for_new_contracts, so contracts added after
  compilation analysis keep the evm map total.
- Both parents' appended test sections kept; the two #88 optimize-map ladder
  tests updated for the strict-steps rung (escalation now passes through
  strict_solc_optimizer, and enabling map entries no longer jumps straight to
  relaxing the autofinder assertion).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants