Skip to content

ci: add contract WASM size guard#862

Merged
Ejirowebfi merged 1 commit into
Favourorg:mainfrom
YfengJ:codex/wasm-size-748
Jun 24, 2026
Merged

ci: add contract WASM size guard#862
Ejirowebfi merged 1 commit into
Favourorg:mainfrom
YfengJ:codex/wasm-size-748

Conversation

@YfengJ

@YfengJ YfengJ commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Closes #748.

Summary:

  • add a CI guard that checks the optimized token factory WASM size after the release build
  • add a small Node script with a default 64 KiB Soroban limit and a workflow_dispatch override
  • cover the size checker with node:test cases for default limits, invalid limits, pass, and fail paths

Validation:

  • node --test scripts/check-wasm-size.test.mjs
  • cargo build --target wasm32v1-none --release (from contracts/)
  • node scripts/check-wasm-size.mjs --file contracts/target/wasm32v1-none/release/token_factory.wasm --max-bytes 65536
  • cargo test (from contracts/token-factory/)
  • ruby -e 'require "yaml"; YAML.load_file(".github/workflows/ci.yml"); puts "workflow yaml parsed"'\n- npx --yes prettier@3.3.3 --check .github/workflows/ci.yml scripts/check-wasm-size.mjs scripts/check-wasm-size.test.mjs\n- git diff --check\n\nNote: the Rust commands still emit existing deprecation warnings, but tests/build pass and the optimized token_factory.wasm is currently 49,973 bytes under the 65,536 byte limit.

@YfengJ

YfengJ commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

CI note for reviewers:

  • The new contract WASM size guard is running in the Contract Build job, and that job passed. The contract test job also passed.
  • The optimized token_factory.wasm is currently 49,973 bytes under the 65,536 byte limit.
  • The red checks appear to be existing repo/workflow-level issues outside this diff:
    • Frontend fails on repo-wide Prettier warnings in 53 existing files.
    • Rust Formatting reports existing formatting diffs in contracts/token-factory/src/lib.rs and src/test.rs; this PR does not touch those files.
    • Storybook fails because esbuild cannot be resolved while evaluating .storybook/main.ts.
    • End-to-End Tests fail because docker-compose is not available on the runner.
    • npm audit reports existing dependency advisories.

No follow-up code change appears needed for the WASM size check unless you want this PR to also address one of those broader workflow issues.

@Ejirowebfi Ejirowebfi merged commit b928b9b into Favourorg:main Jun 24, 2026
4 of 9 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.

CI: add contract WASM size check to prevent exceeding Soroban limits

2 participants