Skip to content

Wasm binary size budget#39

Open
Lynndabel wants to merge 1 commit into
wraith-protocol:developfrom
Lynndabel:Wasm
Open

Wasm binary size budget#39
Lynndabel wants to merge 1 commit into
wraith-protocol:developfrom
Lynndabel:Wasm

Conversation

@Lynndabel
Copy link
Copy Markdown

I have completed the Stellar contract Wasm size optimization.

Key results:

Major Size Reductions: Wasm binaries were reduced by 55% to 68% across all contracts through build profile optimizations.
Monitoring Established: contracts/stellar/SIZE.md now tracks sizes and defines a 110 KB budget per contract.
CI Gate Integrated: A new CI job ensures that future changes staying within the budget.

Closes #18

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@Lynndabel Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@truthixify truthixify changed the base branch from main to develop June 1, 2026 15:14
@truthixify
Copy link
Copy Markdown
Contributor

The release profile changes (opt-level=z, lto=fat, codegen-units=1, panic=abort, strip=symbols) are exactly right, and the SIZE.md baseline table with the "what to do if you exceed budget" runbook is the right shape for the issue.

Two things to fix before merge:

  1. Rebase against develop. This PR was opened against an older main and the CI diff currently replaces the stellar-nightly job that landed in Add Stellar Soroban property tests #13. We need both jobs to coexist: keep stellar-nightly (the 16,384-case proptest schedule) AND add stellar-size-check. After git rebase origin/develop, the CI file should have both jobs side by side.

  2. Run a full optimization pass. SIZE.md notes that stellar contract optimize was unavailable due to missing wasm-opt, so the "optimized" column is just the release profile, not actually post-wasm-opt. Install binaryen (brew install binaryen or apt install binaryen), rerun stellar contract optimize on each crate, and update the table. Realistic optimized sizes for these contracts should be smaller than what's currently shown.

Once the rebase is clean and the optimize step has actually run, this is ready. Thanks @Lynndabel.

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.

Wasm binary size budget + link-time optimization audit

2 participants