Skip to content

[v2][contracts] Per-contract WASM size budgets enforced in CI #1229

Description

@Calebux

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

  • contracts/size-budgets.json holds a byte budget per contract.
  • CI fails when a contract exceeds its budget by more than the tolerance.
  • A PR that changes contract code shows a size delta table in the checks output.
  • Raising a budget requires an explicit edit to the budget file in the same PR.

Files / areas

.github/workflows/contracts.yml, contracts/size-budgets.json


Part of the SYNCRO v2 rewrite. Epic: A — Contract foundation.

Activity

  1. added
    performancePerformance issue or optimization
    ci/cdCI/CD and deployment pipeline
    contractsSoroban smart contracts
    v2-rewriteSYNCRO v2 rewrite program
    on Aug 24, 2026
  2. IjayAbby commented on Aug 28, 2026

    @IjayAbby
    Contributor

    @IjayAbby has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello, I would love to work on this issue.
    Max ETA to complete the task is 4 hours.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @IjayAbby to this issue.

  3. drips-wave commented on Aug 30, 2026

    @drips-wave

    Congratulations, @IjayAbby! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @IjayAbby: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programci/cdCI/CD and deployment pipelinecontractsSoroban smart contractsperformancePerformance issue or optimizationpriority:p2Medium priorityv2-rewriteSYNCRO v2 rewrite program

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions