Skip to content

ci(stellar): add ABI snapshot matching gate for contracts - #137

Merged
truthixify merged 3 commits into
wraith-protocol:developfrom
odarome132:feat/abi-compat-ci-gate
Jul 30, 2026
Merged

ci(stellar): add ABI snapshot matching gate for contracts#137
truthixify merged 3 commits into
wraith-protocol:developfrom
odarome132:feat/abi-compat-ci-gate

Conversation

@odarome132

Copy link
Copy Markdown
Contributor

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.

@drips-wave

drips-wave Bot commented Jul 24, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@truthixify

Copy link
Copy Markdown
Contributor

CI hasn't fired here yet. Push an empty commit or rebase on develop so the workflow picks it up.

@truthixify

Copy link
Copy Markdown
Contributor

Conflicts against develop. Rebase, force-push, and CI will kick off.

@odarome132

Copy link
Copy Markdown
Contributor Author

Please confirm that this is sorted.

@truthixify

Copy link
Copy Markdown
Contributor

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 develop and force-push; CI will fire on the new commit and I'll see the real state.

@odarome132
odarome132 force-pushed the feat/abi-compat-ci-gate branch from c18949b to 67a1bf6 Compare July 30, 2026 12:58
@truthixify
truthixify merged commit 4027a07 into wraith-protocol:develop Jul 30, 2026
8 checks passed
@truthixify

Copy link
Copy Markdown
Contributor

Merged. ABI snapshot gate is a nice defensive addition, future contract API changes will trip it automatically. Thanks.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Contract ABI compatibility CI gate

2 participants