You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR sets up Kani formal verification in stealth-registry/src/proofs/ to prove correctness-critical invariants.
Proved Invariants
Register-then-Resolve (proof_register_then_resolve): Proves that registering a 64-byte stealth meta-address payload and resolving it immediately returns the exact registered payload.
No Double-Registration / Key Uniqueness (proof_no_duplicate_keys): Proves that active storage entries maintain key uniqueness across mutations.
Expiry Monotonicity (proof_expiry_monotonicity): Proves that TTL extensions during registration and lookup operations result in monotonically non-decreasing expiry ledgers (new_expiry >= old_expiry).
CI & Documentation
Added stellar-kani job in .github/workflows/ci.yml using model-checking/kani-github-action@v1.
Documented proof claims and non-goals in stellar/stealth-registry/README.md.
stellar fails on cargo fmt --all --check (there is fmt drift somewhere in the stellar workspace). Run cargo fmt --all locally in stellar/ and commit the reformat.
stellar-kani fails on unresolved module 'std' in your mock_sdk. stealth-registry is a #![no_std] crate, so the Kani harness must be too. Replace use std::... with use core::... and use alloc::... in the mock file. If you need std for the harness only, gate the mock behind #[cfg(kani)] and use extern crate std; inside that cfg block.
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
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.
Summary
This PR sets up Kani formal verification in
stealth-registry/src/proofs/to prove correctness-critical invariants.Proved Invariants
proof_register_then_resolve): Proves that registering a 64-byte stealth meta-address payload and resolving it immediately returns the exact registered payload.proof_no_duplicate_keys): Proves that active storage entries maintain key uniqueness across mutations.proof_expiry_monotonicity): Proves that TTL extensions during registration and lookup operations result in monotonically non-decreasing expiry ledgers (new_expiry >= old_expiry).CI & Documentation
stellar-kanijob in.github/workflows/ci.ymlusingmodel-checking/kani-github-action@v1.stellar/stealth-registry/README.md.Closes #108