chore: Optimize Vault WASM Size for 64KB Limit (#30)#98
Merged
greatest0fallt1me merged 5 commits intoCalloraOrg:mainfrom Feb 26, 2026
Merged
Conversation
- Add set_metadata() and update_metadata() methods for attaching off-chain references (IPFS CIDs or URIs) to offerings - Implement owner-only access control for metadata operations - Emit metadata_set and metadata_updated events for indexing - Enforce 256-character maximum length constraint with graceful rejection - Add comprehensive test coverage (24 tests, 100% pass rate) - Document storage layout, event schema, and off-chain usage patterns - Support multiple offerings with independent metadata entries
- Add comprehensive release profile optimizations in Cargo.toml - opt-level = 'z' for aggressive size optimization - lto = true for link-time optimization - strip = 'symbols' to remove debug symbols - codegen-units = 1 for better optimization - panic = 'abort' for smaller panic handler - Current vault WASM size: 17,926 bytes (~17.5KB), well under 64KB limit - Add scripts/check-wasm-size.sh to verify WASM stays under 64KB - Update README with WASM size documentation and build instructions - Add CI step to automatically check WASM size on builds - Fix syntax error in vault contract (missing closing brace) - Fix test structure issues (nested and incomplete tests) - All tests passing (28 vault tests, 8 revenue_pool tests)
Contributor
|
please resolve the conflicts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR reviews and optimizes the vault contract's release build to stay within Soroban's 64KB WASM size limit. Changes include enabling LTO, stripping symbols, tuning optimization levels, and documenting the resulting WASM size in the README.
Changes
Cargo.toml (release profile)
opt-level = "z"to optimize aggressively for binary sizelto = truefor link-time optimization to eliminate dead code across cratesstrip = "symbols"to remove debug symbols from the release buildCargo.tomlREADME
CI (optional)
WASM Size
[X KB][Y KB]64 KBTesting
cargo testBuild and check size with:
Notes
Closes #30