Skip to content

core: stellar version check + feature probes re-run on every subprocess with no memoization #143

Description

@Dione-b

Summary

runCommand runs checkStellarCliVersion() before every stellar invocation unless skipStellarVersionCheck is set (packages/core/src/shell/run-command.ts:27-29). checkStellarCliVersion (packages/core/src/stellar-cli/check-stellar-cli-version.ts:42-44) then runs probeMissingStellarCliFeatures, which spawns 3 more stellar <subcommand> --help probes (probe-stellar-cli-features.ts:30-38). There is no memoization, and checkBinary (packages/core/src/shell/check-binary.ts) does not set skipStellarVersionCheck, so the cascade triggers again from deploy-contract.ts:63, upload-wasm.ts:36, etc. A single ctg deploy ends up spawning ~10 subprocesses (version + 3 probes, sometimes twice) plus git/rustc metadata calls from artifacts/metadata.ts:15-34.

Why it matters

Every command pays a 5-10x subprocess tax that dominates wall-clock time, and the version check is re-run per subprocess instead of once per process.

Suggested fix

  • Memoize checkStellarCliVersion results per process (keyed by cwd, invalidated only if the binary changes)
  • Have checkBinary use skipStellarVersionCheck: true, since the actual command run right after will validate anyway
  • Consider caching the probed features for the process lifetime

Priority: High | Release impact: Patch | Breaking: No

Activity

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programarea: stellar-cliStellar CLI version checking, compat, parsingenhancementNew feature or requestpriority: highHigh priority fix - data corruption, security, or recovery failure risk

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions