feat: WASM size optimization pipeline and Stellar asset compliance service#883
Open
Mirabliss wants to merge 1 commit into
Open
Conversation
…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
|
@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! 🚀 |
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
Implements two issues in a single branch:
#776 — Soroban WASM Binary Size Optimization Validation Pipeline
Adds
analyzeWasmOptimization(wasmBinary)topackages/stellar/src/soroban.ts:WasmSectionBreakdown: code, data, import, and custom section sizesdebug-section— name/.debug/producers custom sections that can be strippedunused-import— import section > 15% of binaryunoptimized-data— data section > 40% of binaryredundant-types— type count > 2× function countOptimizationActionsuggestions: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, propagatesCOMPLIANCE_ISSUER_BLOCKED,COMPLIANCE_JURISDICTION_RESTRICTED,COMPLIANCE_RESTRICTED_JURISDICTIONS,COMPLIANCE_KYC_REQUIREDas template env varsloadComplianceConfig()— loads blocklist/jurisdiction rules fromCOMPLIANCE_BLOCKLIST_JSON/COMPLIANCE_JURISDICTION_JSONenv vars (Supabase-stored config)canDeployis alwaystrue— compliance issues are warnings added to deployment log, never blockingTesting
24 new tests, all passing:
src/wasm-optimization.test.ts(10 tests)src/asset-compliance.test.ts(14 tests)Files Changed
packages/stellar/src/soroban.ts— WASM optimization pipeline appendedpackages/stellar/src/asset-compliance.ts— new compliance servicepackages/stellar/src/index.ts— export asset-compliancepackages/stellar/src/wasm-optimization.test.ts— newpackages/stellar/src/asset-compliance.test.ts— newcloses Design Stellar Asset Compliance Checking Service with Regulatory Flag Propagation #777
closes Implement Soroban Contract WASM Binary Size Optimization Validation Pipeline #776