ci(stellar): add ABI snapshot matching gate for contracts - #137
Open
odarome132 wants to merge 2 commits into
Open
ci(stellar): add ABI snapshot matching gate for contracts#137odarome132 wants to merge 2 commits into
odarome132 wants to merge 2 commits into
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! 🚀 |
Contributor
|
CI hasn't fired here yet. Push an empty commit or rebase on develop so the workflow picks it up. |
Contributor
|
Conflicts against develop. Rebase, force-push, and CI will kick off. |
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.
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.