Skip to content

feat: WASM size optimization pipeline and Stellar asset compliance service#883

Open
Mirabliss wants to merge 1 commit into
StellerCraft:mainfrom
Mirabliss:feat/stellar-asset-compliance-and-wasm-optimization
Open

feat: WASM size optimization pipeline and Stellar asset compliance service#883
Mirabliss wants to merge 1 commit into
StellerCraft:mainfrom
Mirabliss:feat/stellar-asset-compliance-and-wasm-optimization

Conversation

@Mirabliss

@Mirabliss Mirabliss commented Jun 29, 2026

Copy link
Copy Markdown

Summary

Implements two issues in a single branch:

#776 — Soroban WASM Binary Size Optimization Validation Pipeline

Adds analyzeWasmOptimization(wasmBinary) to packages/stellar/src/soroban.ts:

  • Parses WASM section table in a single O(n) pass (well under 2s for 64 KB)
  • Reports WasmSectionBreakdown: code, data, import, and custom section sizes
  • Detects 4 issue types:
    • debug-section — name/.debug/producers custom sections that can be stripped
    • unused-import — import section > 15% of binary
    • unoptimized-data — data section > 40% of binary
    • redundant-types — type count > 2× function count
  • Produces typed OptimizationAction suggestions: strip-debug-info, enable-wasm-opt, remove-unused-imports

#777 — Stellar Asset Compliance Checking Service

Adds packages/stellar/src/asset-compliance.ts:

  • checkAssetCompliance(assetCode, issuer, config?) — checks issuer blocklist and jurisdiction rules, propagates COMPLIANCE_ISSUER_BLOCKED, COMPLIANCE_JURISDICTION_RESTRICTED, COMPLIANCE_RESTRICTED_JURISDICTIONS, COMPLIANCE_KYC_REQUIRED as template env vars
  • loadComplianceConfig() — loads blocklist/jurisdiction rules from COMPLIANCE_BLOCKLIST_JSON / COMPLIANCE_JURISDICTION_JSON env vars (Supabase-stored config)
  • canDeploy is always true — compliance issues are warnings added to deployment log, never blocking

Testing

24 new tests, all passing:

  • src/wasm-optimization.test.ts (10 tests)
  • src/asset-compliance.test.ts (14 tests)

Files Changed

…nce service (StellerCraft#777)

- analyzeWasmOptimization(): parses WASM section table, detects debug
  sections, unused imports, unoptimized data, redundant types; suggests
  strip-debug-info / enable-wasm-opt / remove-unused-imports actions
- checkAssetCompliance(): checks issuer blocklist and jurisdiction rules,
  propagates COMPLIANCE_* env vars as warnings (never blocks deployment)
- loadComplianceConfig(): loads from env vars or inline override
- Export asset-compliance from packages/stellar index
- 24 new tests, all passing
@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@Mirabliss Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant