[ANCHOR-1016] Move testnet reset scripts into Anchor Platform repo - #1757
Conversation
422f479 to
4b125da
Compare
|
The PR looks fine to me overall. I don't see the script where we check the circle USDC balance though. (here) Is it no longer needed in our tests? |
|
Can we add a GH action to run the testnet reset? |
b0811f9 to
4402839
Compare
…lip/testnet-reset
* add new github actions workflow for manual testnet resets * update workflow to install rust, stellar cli, and stellar sdk dependencies * add environment variables for various testnet accounts and secrets
* add python3 and stellar-sdk prerequisites * update .env loading to be optional, relying on environment variables if not present * add public_key helper function to derive stellar public keys from secret keys * refactor all script sections to use dynamically derived public keys from secret keys * update usdc funding amount
…ntain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* delete `CLIENT_WALLET_PK_BYTES` environment variable * add `pk_bytes` helper function to derive raw public key bytes * update contract deployment to derive signer public key from a secret * delete unused public keys from `.env.example` * add `OTHER_SEP10_SIGNING_SECRET` for testing purposes * update `TESTANCHOR_DISTRIBUTION_SECRET` to `TESTANCHOR_RECEIVE_SECRET`
There was a problem hiding this comment.
⚠️ Not ready to approve
There are critical correctness and security issues in the reset script (payment amounts and set -e deploy handling) and the workflow currently passes secret seeds via non-secret GitHub Actions variables.
Pull request overview
This PR expands the testnet reset automation so it does more than contract deployment, and adds a manual GitHub Actions workflow to run the reset from CI.
Changes:
- Reworks
scripts/testnet_reset.shto fund accounts, set up trustlines, issue test assets, and deploy Soroban contracts. - Adds a
workflow_dispatchGitHub Actions workflow to run the reset script on demand. - Updates
.env.examplewith additional environment variables used by the reset process.
File summaries
| File | Description |
|---|---|
| scripts/testnet_reset.sh | Adds end-to-end testnet setup logic (funding, trustlines, asset issuance, contract deploy). |
| .github/workflows/on_testnet_reset.yml | Introduces a manual CI workflow to execute the reset script. |
| .env.example | Updates the sample environment variables to match the new reset flow. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 9
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* refactor secrets in ci workflow * update rust wasm target * refactor secret key handling in script * update friendbot funding to handle errors * refactor contract deployment for robustness
* update usdc funding logic * update TESTANCHOR_DISTRIBUTION_SECRET usdc amount to 10000 * update other accounts usdc amount to 0.1
There was a problem hiding this comment.
⚠️ Not ready to approve
The reset script currently has multiple correctness and reliability issues (notably amount/log mismatches and deploy error handling that masks real failures) that could cause incorrect funding and false-success runs.
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 11
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* delete unused recipient variables from testnet funding list * add specific funding amount (100 USDC) for TEST_CLIENT_WALLET_SECRET
Description
Updates
testnet_reset.sh.Context
It previously only deployed the contracts.
Testing
Documentation
N/A
Known limitations
N/A