Skip to content

[SC-37] Harden the release profile for smaller deployable WASM #1201

Description

@yusuftomilola

Overview

contracts/Cargo.toml sets only:

[profile.release]
opt-level = "z"
overflow-checks = true

Missing are lto, strip, codegen-units, and panic — all of which materially reduce WASM size. Soroban charges by resource usage and enforces size limits, and assetsup at 8,894 lines is the crate most at risk.

Tasks

  • Add lto = true, codegen-units = 1, strip = "symbols", debug = 0, and panic = "abort".
  • Keep overflow-checks = true — it is a safety property worth its cost in value-handling contracts.
  • Add a release-with-logs profile inheriting release with debug-assertions = true for debugging on testnet.
  • Measure and record WASM size per contract before and after in the PR.
  • Verify all tests still pass and behaviour is unchanged under panic = "abort".

Acceptance Criteria

  • Release profile includes the size optimizations.
  • Measured WASM size reduction is documented per contract.
  • cargo test --all passes unchanged.

Dependencies

Pairs with [SC-34] and [SC-46].

Notes for Contributors

Requires Rust + Soroban. Workspace: contracts/ (soroban-sdk 22, members: assetsup, contrib, multisig-wallet, multisig_transfer, asset-maintenance). Run cargo test --all, cargo fmt --all -- --check, and cargo clippy --all-targets --all-features -- -D warnings before opening a PR — CI enforces all three. Comment below to be assigned.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions