Context
The release profile already optimises for size (opt-level = "z", lto, strip), but nothing prevents a change from doubling a contract's WASM. Deployment cost and instruction limits on Soroban make silent size growth a real operational risk, and the shared-crate refactor makes it more likely.
Scope
- Record a baseline size per contract in
contracts/size-budgets.json.
- Add a CI step that builds release WASM and compares against the budget with a configurable tolerance.
- Report the delta as a PR comment so growth is visible in review.
- Document how to intentionally raise a budget.
Acceptance criteria
Files / areas
.github/workflows/contracts.yml, contracts/size-budgets.json
Part of the SYNCRO v2 rewrite. Epic: A — Contract foundation.
Context
The release profile already optimises for size (
opt-level = "z",lto,strip), but nothing prevents a change from doubling a contract's WASM. Deployment cost and instruction limits on Soroban make silent size growth a real operational risk, and the shared-crate refactor makes it more likely.Scope
contracts/size-budgets.json.Acceptance criteria
contracts/size-budgets.jsonholds a byte budget per contract.Files / areas
.github/workflows/contracts.yml,contracts/size-budgets.jsonPart of the SYNCRO v2 rewrite. Epic: A — Contract foundation.