Repository navigation
amberly-d: modern deploy script + initialize retries (#1429, #1430) - #1524
Merged
BigBen-7 merged 1 commit intoOct 17, 2026
Merged
Conversation
…, PinSpace-Org#1430) Implements the two contract-deploy-script issues selected for this branch. PinSpace-Org#1429 - stop calling the deprecated `stellar contract optimize`: - the separate `cargo build --target wasm32-unknown-unknown --release` + `stellar contract optimize --wasm ...` pair is replaced by the single supported `stellar contract build --optimize` - `stellar contract build` compiles for wasm32 in the release profile, so the artefact lands at the same path; the optimiser then writes gistpin_contracts.optimized.wasm and renames it back over gistpin_contracts.wasm - the artefact path the script later reads is therefore $WASM itself, so OPTIMIZED is now set to $WASM instead of the (now never-created) .optimized.wasm PinSpace-Org#1430 - retry initialize after deploying: - bounded loop, maximum 3 attempts, each preceded by a visible message - 10 second delay between attempts - exits non-zero with a clear error once all attempts are exhausted, instead of printing "Deployment complete" for a contract that was never initialised Validated with shellcheck and bash -n, plus a stubbed stellar/cargo harness running the whole script: init succeeding on attempt 3 -> exit 0 with exactly 3 attempts; init always failing -> exit 1 after exactly 3 attempts; init succeeding first time -> exit 0 with 1 attempt; and the deprecated `stellar contract optimize` subcommand was never invoked in any run. Closes PinSpace-Org#1429 Closes PinSpace-Org#1430 Closes PinSpace-Org#1431 Closes PinSpace-Org#1432
|
@amberly-d 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! 🚀 |
2 tasks
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 the two deploy-script issues selected for this branch: #1429 (the deprecated
stellar contract optimize) and #1430 (retryinitialize). All four issues assigned to this account are closed by this PR.#1429 - replace the deprecated
stellar contract optimizeThe old flow was two steps:
These are now one supported command:
Verified against
stellar-clisource (cmd/soroban-cli/src/commands/contract/build.rs):--profiledefaults toreleaseand the wasm32 target is used, so the artefact lands at the sametarget/wasm32-unknown-unknown/release/gistpin_contracts.wasm.--optimizedefaults to true, and the optimiser writes<name>.optimized.wasmthen renames it back over<name>.wasm.So there is no longer a separate
.optimized.wasmto read, and the artefact path the script later reads is adjusted accordingly:OPTIMIZED="$WASM".The deployed WASM is still optimised — it is now simply produced in-place by
build --optimize.#1430 - retry
initializeafter deployingA bounded loop (
INIT_ATTEMPTS=3,INIT_RETRY_DELAY=10):==> initialize attempt N/3)Deployment completefor a contract that was never initialisedValidation
shellcheckandbash -nare clean. I could not run a real testnet deploy, so I exercised the entire script end-to-end against stubstellar/cargo/sleepbinaries that record behaviour:initializefails twice, succeeds 3rdinitializealways failserror: initialize failed after 3 attempts.initializesucceeds first timestellar contract optimizenever invokedNote for maintainers (left unchanged as out of scope for this issue): the prerequisites block still says
cargo install --locked stellar-cli --features opt, but currentstellar-clihas nooptfeature —default = ["additional-libs"]andadditional-libs(which is what--optimizeneeds) is already on by default, so a plaincargo install --locked stellar-cliis what the script now expects.Closes #1429
Closes #1430
Closes #1431
Closes #1432