Skip to content

Enable the optimizer - #117

Merged
MathisGD merged 1 commit into
mainfrom
devin/1793638331-monitor-conventions
Nov 2, 2026
Merged

MathisGD merged 1 commit into
mainfrom
devin/1793638331-monitor-conventions

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Sets optimizer = true (and spells via_ir) so that the build matches the deployed implementations again: since forge 1.0 the optimizer is off by default.

@devin-ai-integration

devin-ai-integration Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Author

Does the optimizer setting change the deployed bytecode? Yes: with the current foundry.toml, forge ≥ 1.0 builds without the optimizer and the result no longer matches what is deployed.

I built MorphoTokenEthereum and MorphoTokenOptimism from main with forge 1.8.7 and compared them with the deployed implementations, ignoring the metadata:

Ethereum 0x4364fd2371b6318159366abfa51f190df5c24852 Base 0xa860498f8a299526174b539fcc49f13cc082fb18
optimizer off (main) 15768 bytes vs 14162 deployed 16390 bytes vs 15175 deployed
optimizer on (this PR) same size; only the UUPS self-address immutable differs same size; only immutables differ (UUPS self address, bridge, remoteToken)

So this PR restores a build reproducing the deployment.

@MathisGD
MathisGD merged commit ddfeaa6 into main Nov 2, 2026
16 checks passed
@MathisGD
MathisGD deleted the devin/1793638331-monitor-conventions branch November 2, 2026 21:50
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.

3 participants