feat: formal Quint spec and Kani proofs (#414, #415) - #456
Merged
james2177 merged 1 commit intoOct 2, 2026
Conversation
…tellar-vortex-protocol#415) Issue stellar-vortex-protocol#414 — Formal Quint specification of the intent state machine: - spec/vortex.qnt: covers all 11 IntentState variants and every transition documented in the README lifecycle diagram (submit, accept, fill, partial fill, cancel, expire, slash, begin_fill, release_fill, open_dispute, resolve_dispute, arbiter timeout) - 8 safety invariants (INV-1..INV-8) checked with Apalache / Quint simulator: no double payout, bond never negative, no stuck intents, accepted has solver, filled amount sufficient, treasury monotone, cancel only from Open, resolved has outcome - 2 liveness properties: every intent eventually reaches a terminal state; a solver can always eventually accept an open intent - 6 named traces (happyPath, cancelPath, expirePath, slashPath, disputeUpheldPath, disputeDismissedPath) exported as ITF witnesses - intent_settlement/tests/conformance.rs: Rust integration tests replay each trace against the real contract, asserting the safety invariants on-chain - docs/formal-spec.md: plain-English property documentation and usage guide - Bounding strategy: 2 users, 2 solvers, 2 intents, ticks 0..30 - spec/traces/README.md + .gitignore entry for *.itf.json Issue stellar-vortex-protocol#415 — Kani proofs for pure arithmetic helpers: - intent_settlement/src/math.rs: Env-free pure functions extracted from lib.rs (compute_slash_amount, compute_slash_amount_tiered, tier_fill_window, compute_fee, apply_discount, dutch_decay, slash_bps_for_tier, fill_window_bonus_bps_for_tier, decode_i128_be, decode_u32_be, decode_u16_be, decode_payload_chain_id, decode_payload_src_amount) with 25 unit tests (no Soroban env required) - intent_settlement/src/kani_proofs.rs: 12 Kani harnesses with documented properties (slash never negative, slash never exceeds bond, slash floor 1, fill window monotone, fill window no overflow, fee never exceeds amount, fee rounds down, dutch decay bounds, discount in range, decode payload roundtrip, slash bps monotone, decode bounds safe) - Makefile: make kani target runs all 12 harnesses - lib.rs: pub mod math and #[cfg(kani)] mod kani_proofs declarations Closes stellar-vortex-protocol#414 Closes stellar-vortex-protocol#415
|
@shemaiahdelia03-cmd 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! 🚀 |
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.
Issue #414 — Formal Quint specification of the intent state machine:
Issue #415 — Kani proofs for pure arithmetic helpers:
Closes #414
Closes #415
Summary
Related issue
Type of change
Component
vortex-contract)vortex-backend)vortex-frontend)Checklist
Screenshots / notes