Skip to content

[High] Write a formal Quint (or TLA+) specification of the intent state machine and check conformance #414

Description

@james2177

Description:
Specify the intent lifecycle, solver bonding, slashing, escrow, and disputes in Quint. Model-check safety properties (no double payout, bond never negative, no stuck funds) and liveness properties (every intent eventually reaches a terminal state). Then add a conformance test that replays traces from the model against the real contract.

Problem Statement & Context:
The state machine now has 11 states and more than 20 transitions spread across 5,000 lines. A formal model is the only way to reason about it with confidence, and it's a strong signal to auditors.

Scope & Acceptance Criteria:

  • spec/vortex.qnt covering every IntentState transition documented in the README diagram.
  • At least 6 safety invariants and 2 liveness properties, checked with Apalache or the Quint simulator.
  • A trace-conformance harness: Rust tests consume ITF traces exported by Quint and replay them.
  • Document each property in plain English.
  • Out of scope: cross-chain proof semantics (abstracted as an oracle).

Implementation Guidelines:

  1. Key Files/Modules: new spec/, intent_settlement/tests/conformance.rs, docs/formal-spec.md.
  2. Design/Architecture: Abstract amounts to small domains, and model time as discrete ticks.
  3. Edge Cases/Constraints: State explosion (bound the actors to 2 users and 2 solvers).
  4. Testing: The model checker passes, and the conformance replay passes.

Definition of "Done":

  • Spec, doc, and conformance tests merged, with model-checker output in the PR.
  • Reviewed and approved.

Resources:

Complexity: High (200 points)

Activity

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programhigh (200 pts)Drips Wave complexity: high, 200 pointssecuritySecurity hardening or audit finding

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions