Skip to content

feat: add WASM optimization step with wasm-opt#1

Open
Markodiba wants to merge 1 commit into
mainfrom
feat/wasm-opt-optimization-step
Open

feat: add WASM optimization step with wasm-opt#1
Markodiba wants to merge 1 commit into
mainfrom
feat/wasm-opt-optimization-step

Conversation

@Markodiba
Copy link
Copy Markdown
Owner

Summary

Adds a spec for the WASM optimization build step using wasm-opt from the Binaryen toolchain. Optimizing the contract binary reduces its size and lowers Stellar deployment costs.

What's included

  • requirements.md — 5 requirements covering toolchain installation, the make optimize target, size reporting, correctness preservation, and README docs
  • design.md — 4-step pipeline architecture, 4 correctness properties, and a dual testing strategy (proptest + shell integration tests)
  • tasks.md — 6 incremental implementation tasks

Acceptance Criteria

  • make optimize completes successfully and exits 0
  • Optimized WASM (trustlink_opt.wasm) is strictly smaller than the unoptimized binary
  • Optimized WASM passes all existing cargo test unit tests
  • Build output reports pre/post sizes with absolute and percentage savings
  • wasm-opt missing from PATH produces a descriptive error with install instructions

Testing Strategy

  • Property-based tests (proptest) for size-reporting arithmetic accuracy, source file immutability, and deterministic output
  • Shell integration tests for end-to-end pipeline validation

Add spec for WASM optimization step using wasm-opt from the Binaryen
toolchain. The optimization reduces contract binary size and lowers
Stellar deployment costs.

Spec covers:
- Makefile optimize target running wasm-opt -Oz after cargo build
- Pre/post size reporting with absolute and percentage savings
- wasm-opt installation instructions in Makefile install target
- README documentation for the optimization workflow
- Correctness properties: size accuracy, source immutability, determinism
- Property-based tests using proptest + shell integration tests
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.

1 participant