Skip to content

fix: add snake_case aliases for ModelCheckerSettings fields#348

Merged
grandizzy merged 1 commit intofoundry-rs:mainfrom
grandizzy:fix/model-checker-snake-case-aliases
Jan 20, 2026
Merged

fix: add snake_case aliases for ModelCheckerSettings fields#348
grandizzy merged 1 commit intofoundry-rs:mainfrom
grandizzy:fix/model-checker-snake-case-aliases

Conversation

@grandizzy
Copy link
Contributor

@grandizzy grandizzy commented Jan 20, 2026

Motivation

ref foundry-rs/foundry#12801 (should bump before closing issue)

The ModelCheckerSettings struct uses #[serde(rename_all = "camelCase")] for compatibility with solc's JSON input format. However, Foundry's foundry.toml config uses snake_case for field names (e.g., show_unproved = true).

This mismatch causes the following model_checker config fields to be silently ignored when parsing foundry.toml:

  • show_unproved
  • show_unsupported
  • show_proved_safe
  • div_mod_with_slacks

Solution

Add #[serde(alias = "snake_case_name")] to the affected fields. This allows deserialization from both:

  • camelCase (showUnproved) - for solc JSON input compatibility
  • snake_case (show_unproved) - for foundry.toml config compatibility

Serialization continues to produce camelCase output, maintaining solc compatibility.

Test Plan

Added model_checker_settings_snake_case_aliases test that verifies:

  1. snake_case field names deserialize correctly
  2. camelCase field names still work
  3. Serialization produces camelCase (for solc)

Fixes foundry-rs/foundry#12801

The ModelCheckerSettings struct uses camelCase for solc JSON compatibility,
but Foundry's foundry.toml uses snake_case. This adds serde aliases so both
formats work for deserialization while maintaining camelCase serialization.
@grandizzy grandizzy merged commit 5e0e04c into foundry-rs:main Jan 20, 2026
18 checks passed
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.

2 participants