Skip to content

[Contracts] build.sh optimizes WASM to *.optimized.wasm but deploy-config.json uploads the unoptimized *.wasm #1155

Description

@grantfox-oss

Telegram (ask questions / claim the issue here first): https://t.me/+DOylgFv1jyJlNzM0

Why this matters

scripts/build.sh:18-31 runs stellar/soroban contract optimize and emits target/wasm32-unknown-unknown/release/.optimized.wasm, but scripts/deploy-config.json points every contract.wasm at the non-optimized release/.wasm. The optimization pass is wasted and deployments upload the larger, unoptimized bytecode, increasing instantiation cost and ongoing ledger rent.

Acceptance criteria

  • deploy-config.json (or deploy.ts) uploads the .optimized.wasm artifacts produced by build.sh
  • If the CLI is unavailable, deploy falls back to the unoptimized wasm with a logged warning
  • Document which artifact is canonical so on-chain hashes are predictable

Files to touch

  • scripts/build.sh
  • scripts/deploy-config.json
  • scripts/deploy.ts

Out of scope

  • Adding new optimization flags to the compiler profile

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcontractsIssues related to smart contractsdevopsIssues related to CI/CD and infrastructureoptimizationCode optimization

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions