Skip to content

[39] Add a wasm-size budget guard in CI #39

Description

@merlik787-droi

Problem Statement

The CI build step succeeds if stellar contract build produces wasm. There is no size assertion, so a regression that adds 50KB to a wasm artifact goes undetected. Soroban contracts have a 64KB wasm size limit near protocol-level; staying well under is essential.

Why It Matters

  • Larger wasm means higher deploy cost and lower gas-efficiency headroom.
  • Cross-contract deployment cost inflates with size.

Expected Outcome

  • New CI step after stellar contract build:
    for wasm in target/wasm32v1-none/release/*.wasm; do
      size=$(stat -c%s "$wasm")
      echo "$wasm: $size bytes"
      [ "$size" -lt 50000 ] || exit 1
    done
  • The threshold (default: 50KB) is configurable per contract.
  • README documents the budget.

Acceptance Criteria

  • CI fails when any contract exceeds its size threshold.
  • Reports historical size in a comment via PR bot.

Implementation Notes

  • Track size over time in reports/ or via GitHub Pages graph.

Files / Modules Affected

  • .github/workflows/ci.yml
  • README update per contract.

Dependencies

Issue #15 (per-contract CI matrix).

Difficulty

Easy.

Estimated Effort

1–2 hours.

Suggested Labels

ci, performance, P2


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions