Skip to content

chore: bump Foundry to 1.8.5 on v6 with bytecode-identical L1 builds - #25674

Closed
spalladino wants to merge 1 commit into
v6from
spl/v6-foundry-1.8.5
Closed

spalladino wants to merge 1 commit into
v6from
spl/v6-foundry-1.8.5

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Ports the tooling part of #25602 to v6, so the release line builds with Foundry 1.8.5 while the L1 contracts compile to exactly the bytecode they compiled to under 1.4.1, metadata hash included.

Context

v6 contracts are deployed, so a rebuild has to reproduce them byte for byte. A plain Foundry bump does not: under 1.8.5 every artifact's CBOR metadata hash changes. The executable code is unchanged. The cause is remapping auto-detection: 1.5+ adds context-scoped remappings for the nested forge-std copies in lib/circuits and lib/openzeppelin-contracts, some with absolute paths. Those land in settings.remappings in the metadata, so the bytecode would also vary between checkouts.

Approach

  • Taken from chore: bump Foundry to 1.8.5 #25602:
    • Foundry pinned to 1.8.5 in bootstrap.sh, the build image and setup-container.sh.
    • Build image 3.1. The image files now match next, where 3.1 is already published.
    • No forge install in the l1-contracts and barretenberg/sol builds.
    • A full forge build at the end of build_verifier.
    • isolate = false for the tests.
    • --slow in place of the removed --batch-size in forge_broadcast.js.
    • The tmnt331 revert-data fix.
    • Whitespace-only formatting of test/.
    • The labs viem-polling patch for anvil 1.8, renumbered 0003.
  • l1-contracts/foundry.toml sets auto_detect_remappings = false. Each profile lists the remappings 1.4.1 recorded, its explicit ones plus the six it auto-detected from lib/.
  • Not taken from chore: bump Foundry to 1.8.5 #25602 or its stack:
  • Files 1.8.5's formatter would rewrite but that must stay as deployed are in [fmt] ignore. That covers six src/ files and the pinned DeployRollupForUpgradeV6.s.sol in l1-contracts, and src/honk/{CommitmentScheme,Relations}.sol in barretenberg/sol, which feed the generated HonkVerifier.

Bytecode check: I built src/ from unmodified v6 with forge 1.4.1 and from this branch with 1.8.5. All 236 creation and runtime objects matched byte for byte in the default and production profiles, and 212/212 in coverage. The deploy scripts plus the generated HonkVerifier matched 262/262.

Locally with 1.8.5:

  • forge test: 1455 passed, 0 failed, 10 skipped.
  • forge fmt --check is clean in both projects.
  • check_contract_sizes.sh passes.
  • test_rollup_upgrade.sh completes.

@spalladino spalladino added the ci-draft Run CI on draft PRs. label Oct 21, 2026
@spalladino
spalladino marked this pull request as ready for review October 21, 2026 15:00
@spalladino spalladino removed the ci-draft Run CI on draft PRs. label Oct 21, 2026
@fcarreiro

Copy link
Copy Markdown
Contributor

Superseded by #25677

@fcarreiro fcarreiro closed this Oct 21, 2026
auto-merge was automatically disabled October 21, 2026 16:58

Pull request was closed

fcarreiro added a commit that referenced this pull request Oct 21, 2026
Combines #25673 and #25674 on `v6`, plus one commit that drops labs
patch `0003`:

- `a6d3060919`, `bf8aac88e5` (#25673): `labs` pinned to aztec-node
`ea00f1b0` (`v6.0.0-rc.4`), labs patch queue drained, labs' mainnet
compatibility test run.
- `b89b782a5e` (#25674): Foundry 1.8.5 with bytecode-identical L1
builds, cherry-picked with the same diff.
- `e6d3ed1248`: drops
`0003-fix-ethereum-default-viem-polling-to-1-s-and-let-tes.patch`. It
does not apply to `ea00f1b0`, which already polls anvil test chains
every 100 ms in `createExtendedL1Client`
(aztec-labs-eng/aztec-node#401). The labs patch series is empty, as on
#25673.

`ea00f1b0` targets Foundry 1.8.5 and contains
aztec-labs-eng/aztec-node#483, the fix for the `l1_fee_analyzer.test.ts`
failure #25674 hits on the old pin: block timestamps under anvil 1.8 are
whole seconds, so `timeBeforeBlockMs` is negative for a block mined in
the snapshot's second.
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