Skip to content

fix: enable solidity optimizer to resolve EIP-170 contract size limit#24

Merged
seanmcgary merged 3 commits into
masterfrom
sm-createWithoutDeploy
Jun 3, 2026
Merged

fix: enable solidity optimizer to resolve EIP-170 contract size limit#24
seanmcgary merged 3 commits into
masterfrom
sm-createWithoutDeploy

Conversation

@seanmcgary

Copy link
Copy Markdown
Member

Summary

  • Enables the Solidity optimizer (optimizer = true, optimizer_runs = 200) in foundry.toml
  • Resolves AppController exceeding the EIP-170 contract size limit (24,576 bytes)

Problem

After merging createEmptyApp (#23), the AppController runtime bytecode reached 26,188 bytes — 1,612 bytes over the EIP-170 limit. This causes deployment failures on any EVM chain enforcing the Spurious Dragon size check.

Fix

Enabling the optimizer with 200 runs reduces AppController from 26,188 → 15,594 bytes (40% reduction), leaving 8,982 bytes of headroom for future additions.

Contract Before After Margin
AppController 26,188 B 15,594 B +8,982 B

Test plan

  • Full test suite passes (131 tests, 0 failures)
  • forge build --sizes confirms all contracts within limits
  • Deploy script (v1.5.0-create-empty-app/1-deployAppControllerImpl.s.sol) compiles successfully

@seanmcgary seanmcgary requested review from a team May 28, 2026 03:10
@seanmcgary seanmcgary force-pushed the sm-createWithoutDeploy branch from 0c9c07a to 2a5e31a Compare May 28, 2026 03:26
crypt0fairy
crypt0fairy previously approved these changes May 28, 2026

@crypt0fairy crypt0fairy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

@seanmcgary seanmcgary force-pushed the sm-createWithoutDeploy branch from 11b3329 to a5f24b4 Compare June 3, 2026 15:34

@mpjunior92 mpjunior92 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mmurrs mmurrs self-requested a review June 3, 2026 15:37
@seanmcgary seanmcgary merged commit b839499 into master Jun 3, 2026
2 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.

4 participants