Skip to content

fix: deploy via_ir=true contracts without OOM recompilation#34

Merged
mikhaildobs merged 1 commit into
devfrom
fix/deploy-via-ir-prebuilt
Feb 24, 2026
Merged

fix: deploy via_ir=true contracts without OOM recompilation#34
mikhaildobs merged 1 commit into
devfrom
fix/deploy-via-ir-prebuilt

Conversation

@mikhaildobs
Copy link
Copy Markdown
Member

Summary

  • Rewrote deploy.sh to deploy via_ir=true optimized contracts without triggering forge's full recompilation (which OOMs at 16GB)
  • Step 1 uses a two-step build: ci profile for scripts (fast), default profile for contracts (via_ir=true, ~1.2GB peak)
  • Steps 2 & 5 deploy contracts via cast send --create with raw bytecode from out/, completely bypassing forge recompilation
  • Steps 3 & 4 run forge script with ci profile for admin operations (credential groups, app registration)
  • Rebuilds via_ir artifacts after steps 3-4 so out/ is correct for BaseScan verification
  • Removed the --prebuilt workflow (tarball + VPS build) and build-deploy-artifacts Makefile target since local builds work fine

Test plan

  • Dry run passes: ./script/deploy.sh sepolia --dry-run
  • Live deploy to Sepolia succeeded
  • Verified all 3 contracts (CredentialRegistry, DefaultScorer, ScorerFactory) have viaIR: true in metadata
  • On-chain bytecode matches local via_ir=true compiled artifacts

🤖 Generated with Claude Code

Rewrote deploy.sh to solve the forge via_ir recompilation problem:

- Step 1: Two-step build (ci scripts + via_ir contracts) keeps peak memory
  at ~1.2 GB instead of 16+ GB
- Steps 2 & 5: Deploy contracts via `cast send --create` with pre-built
  bytecode from out/, completely bypassing forge's recompilation
- Steps 3 & 4: Run forge script with ci profile (scripts already compiled)
- Rebuild via_ir artifacts after steps 3-4 for BaseScan verification

Removed the --prebuilt workflow (tarball + VPS build) since local builds
work fine with the two-step approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mikhaildobs mikhaildobs merged commit 4abe80c into dev Feb 24, 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.

2 participants