Skip to content

spec: extend formal model with solver tiers, fee routing, and traces - #618

Merged
techisigu merged 5 commits into
stellar-vortex-protocol:mainfrom
gabrielujelistic-collab:fix/issue-530-extend-formal-model
Oct 24, 2026
Merged

techisigu merged 5 commits into
stellar-vortex-protocol:mainfrom
gabrielujelistic-collab:fix/issue-530-extend-formal-model

Conversation

@gabrielujelistic-collab

Copy link
Copy Markdown
Contributor

Summary

Extends the Quint formal specification (spec/vortex.qnt) for issue #530 to backstop the routing logic with solver tiers, fee routing, and additional safety invariants and traces.

Changes

Solver Tier System

  • Added tier field to Solver type (0 = Unranked, 5 = Platinum)
  • Added tier-based fill window bonus: fillDeadlineFor(acceptTick, tier) = acceptTick + FILL_WINDOW + tier * TIER_FILL_BONUS
  • Added tier-based slash reduction: slash = base_slash - tier * TIER_SLASH_BPS * bond / 100
  • Added setTier action for admin tier management
  • Added MAX_TIER, TIER_SLASH_BPS, TIER_FILL_BONUS constants

Safety Invariants (4 new)

  1. inv_tierBounds - All solver tiers within [0, MAX_TIER]
  2. inv_fillWindowMonotone - Fill deadline monotonic in tier
  3. inv_slashNeverExceedsBond - Slash amount never exceeds solver's bond
  4. inv_slashFloorOne - Minimum slash of 1 when bond > 0

New Traces (4 new)

  1. tierFillWindowBonus - Verifies tier-based fill window extension
  2. tierSlashReduction - Verifies tier-based slash reduction
  3. partialThenFullFill - Verifies partial fill accumulation to Filled
  4. disputeDismissedThenTimeout - Verifies dispute dismissal then timeout path

Other Improvements

  • Updated registerSolver to initialize tier to 0
  • Updated acceptIntent to use tier-based fill deadline
  • Updated slashSolver and resolveDispute to use tier-adjusted slash

Testing

All traces are executable with quint run --main=traces spec/vortex.qnt and safety invariants are checkable with Apalache.

Closes #530

Addresses issue stellar-vortex-protocol#530 by extending the Quint specification:

- Added solver tier system (0-5) with tier-based fill window bonus and slash reduction
- Added tier field to Solver type
- Added setTier action for admin tier management
- Updated computeSlash to use tier-adjusted formula
- Updated fillDeadlineFor to include tier bonus
- Added 4 new safety invariants:
  - inv_tierBounds: tier within [0, MAX_TIER]
  - inv_fillWindowMonotone: fill deadline monotonic in tier
  - inv_slashNeverExceedsBond: slash capped at bond
  - inv_slashFloorOne: minimum slash of 1 when bond > 0
- Added 4 new traces:
  - tierFillWindowBonus: verifies tier-based fill window extension
  - tierSlashReduction: verifies tier-based slash reduction
  - partialThenFullFill: verifies partial fill accumulation
  - disputeDismissedThenTimeout: verifies dispute resolution paths

Closes stellar-vortex-protocol#530
@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@gabrielujelistic-collab 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

techisigu and others added 4 commits October 24, 2026 10:40
… (Simple agent)

- governor/src/lib.rs: merged [markers] — model resolved the conflict markers

Co-authored-by: Simple Agent <agent@simple.dev>
… (Simple agent)

- README.md: merged [markers] — model resolved the conflict markers
- governor/src/lib.rs: merged [markers] — model resolved the conflict markers

Co-authored-by: Simple Agent <agent@simple.dev>
… (Simple agent)

- governor/src/lib.rs: merged [markers] — model resolved the conflict markers

Co-authored-by: Simple Agent <agent@simple.dev>
… (Simple agent)

- governor/src/lib.rs: merged [markers] — model resolved the conflict markers

Co-authored-by: Simple Agent <agent@simple.dev>
@techisigu
techisigu merged commit ff85808 into stellar-vortex-protocol:main Oct 24, 2026
0 of 32 checks passed
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.

[High] Extend spec/vortex.qnt's formal model to backstop routing, outbound intents, and bid-window bidding

2 participants