ci(stellar): add ABI snapshot matching gate for contracts - #137
Conversation
|
@odarome132 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! 🚀 |
|
CI hasn't fired here yet. Push an empty commit or rebase on develop so the workflow picks it up. |
|
Conflicts against develop. Rebase, force-push, and CI will kick off. |
|
Please confirm that this is sorted. |
|
No CI signal on this branch. It predates recent workflow fixes on develop (pnpm 10 corepack pin, ci.yml trigger updates, etc). Rebase against latest |
c18949b to
67a1bf6
Compare
… installed via curl
|
Merged. ABI snapshot gate is a nice defensive addition, future contract API changes will trip it automatically. Thanks. |
Closes #111
Summary
This adds a CI gate that extracts and commits Soroban contract ABIs as JSON snapshots. If a PR silently changes an ABI (functions, inputs, outputs)
without intentionally updating the snapshot, CI will fail the build, preventing downstream breakages for indexers and SDKs.
What Changed:
• Added stellar/abi/update.sh to extract ABIs into stellar/abi/*.json
• Commited initial ABI snapshots for all 4 stellar contracts
• Added stellar/abi/README.md to explain how contributors can intentionally update snapshots
• Updated .github/workflows/ci.yml to run the update script and fail if git diff --exit-code abi/ detects changes
Key Design Decisions & Discrepancies:
• Discrepancy Note: The issue description requested using stellar contract inspect to extract JSON. However, inspect is deprecated and does not support
JSON output natively. I used the replacement command stellar contract info interface --output json-formatted to cleanly fulfill the requirement.
• Dependencies: Bumped ethnum inside the stellar/Cargo.lock. Without this bump, the wasm32-unknown-unknown build fails on the latest Rust compiler due to
a known TryFromIntError size issue.
• CI Performance: Used the official stellar/actions/setup-cli@main action to install the stellar-cli instantly rather than waiting 10+ minutes for a
cargo install.
Acceptance Criteria:
[✓] Snapshot lands committed for all four contracts
[✓] PR that changes a signature without updating snapshot fails CI
[✓] stellar/abi/README.md explains the flow
Testing:
• Existing rust tests pass (cargo test --workspace)
• Adding a dummy function to stealth-announcer locally correctly triggered a CI failure via git diff.
Security Note:
No secrets are introduced. The Wasm build is reproducible and local to the runner.