Skip to content

foundry.toml compiler settings sit inside [soldeer], so forge ignores every one of them #37

Description

@thedavidmeister

foundry.toml declares its compiler settings after the [soldeer] header, so TOML assigns them to [soldeer] and forge never reads them. The repo builds — and publishes — on foundry defaults instead.

13 [soldeer]14 recursive_deps = false1516 # See more config options https://github.com/foundry-rs/foundry/tree/master/config1718 solc = "0.8.25"...28 optimizer = true29 optimizer_runs = 10000003031 bytecode_hash = "none"32 cbor_metadata = false3334 evm_version = "cancun"

Everything from line 18 to line 34 is inside [soldeer]. [profile.default] ends at line 8 with src/out/libs.

What forge actually uses

forge config on main reports optimizer = false, optimizer_runs = 200, bytecode_hash = "ipfs", cbor_metadata = true, and an evm_version of the toolchain's default rather than cancun — the foundry defaults, not this file's values. Moving solc and evm_version under [profile.default] on a scratch copy makes forge config report 0.8.25 and cancun, which confirms the cause is the section, not the values.

Why it matters

  • Every published Soldeer revision is compiled unoptimised on a default solc and EVM version, not the pinned 0.8.25/cancun this file believes it sets.
  • bytecode_hash = "none" and cbor_metadata = false are likewise inert, so the artifacts carry an IPFS metadata hash and are not byte-reproducible across machines.
  • The comment at line 27 — "These settings should be used for snapshots" — describes settings that have never been in effect.

Fix

Move lines 18–34 into [profile.default], above [dependencies]. Then verify with forge config that solc, optimizer, optimizer_runs, bytecode_hash, cbor_metadata and evm_version all report the file's values rather than the defaults — the check that would have caught this.

Worth sweeping the sibling repos for the same shape: any foundry.toml with profile keys sitting after a [dependencies] or [soldeer] header has the same silent bug. (rain.solmem's ordering is correct — its settings sit under [profile.default] before [dependencies].)

Found while implementing #35; independent of that change, and #36 neither causes nor fixes it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions