Repository navigation
Fix: 2 issues (#1795, #1797) - #1879
Merged
famvilianity-eng merged 1 commit intoOct 23, 2026
Merged
Conversation
Co-authored-by: Simple Agent <agent@simple.dev>
famvilianity-eng
merged commit Oct 23, 2026
75031a5
into
StellarCheckMate:main
12 of 20 checks passed
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 #1795
Closes #1797
Issues
#1795 CI: ABI snapshot check does not run on forks, so ABI regressions are not caught on PRs
#1797 Security:
migrate_statehas no version guard, allowing downgrade migrationsSummary
Issue 1797's guard and tests appear largely present already; the work is to verify the guard is the first check after auth in
migrate_state, confirmError::InvalidVersionexists, and ensure a downgrade-rejection test asserts both the error and that the stored version is unchanged. For issue 1795, the key change is decoupling the read-only comparison (pull_request, no secrets, contents: read) from the baseline push (push to main only, uses secret). Do not reference secrets in the pull_request job so fork PRs run the comparison.Changes
comparejob triggered onpull_requestwithpermissions: contents: readthat checks out the PR, builds the escrow WASM, installs the Stellar CLI, extracts current function names, extracts baseline function names, and diffs them (failing on mismatch) — no secrets referenced; (2) anupdate-baselinejob triggered only onpushto main/master that regenerates the snapshot and commits/pushes the updatedcontracts/escrow/contract-spec.jsonusing the secret token. Keep the existing path filters and build/extract steps, moving the secret-dependent push logic into the push-only job. (.github/workflows/abi-snapshot.yml)migrate_statein the escrow contract enforces the version guard: after loading the admin and the storedcurrentversion (defaulting toCONTRACT_VERSION), it must returnError::InvalidVersionwhentarget_version <= currentbefore any storage mutation or migration is applied. The guard is already present in the shown code; confirm it is intact and thatError::InvalidVersionexists in the error enum. No behavioural change is expected here, but ensure the guard remains the first check after auth. (contracts/escrow/src/lib.rs)Error::InvalidVersionis defined in the escrow error enum (it is currentlyInvalidVersion = 49). If it were missing, add it with a stable unused discriminant and updatedocs/error-codes.mdaccordingly. No change is expected if the variant already exists. (contracts/escrow/src/errors.rs)migrate_stateto a higher value (e.g. 1_001), then calltry_migrate_statewith a lower target (e.g.crate::CONTRACT_VERSION/ 1_000) and assert it returnsErr(Ok(Error::InvalidVersion)); also assertget_version()is unchanged after the rejected call. Ensure the existing same-version and lower-version rejection tests remain and cover the guard. (contracts/escrow/src/tests/upgrade.rs)