Skip to content

feat: add solver views for slash cooldown, active intents, per-token stats, routes - #321

Open
had3sgames wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
had3sgames:feature/245-246-255-256-solver-views
Open

feat: add solver views for slash cooldown, active intents, per-token stats, routes#321
had3sgames wants to merge 1 commit into
stellar-vortex-protocol:mainfrom
had3sgames:feature/245-246-255-256-solver-views

Conversation

@had3sgames

Copy link
Copy Markdown
Contributor

Summary

Implements the 4 open issues assigned to @had3sgames as one combined PR:

docs/solver-integration-guide.md (recovery flow, crash recovery, route declaration) and the README.md error table are updated to match.

Important note on validation

This environment has no Rust/cargo toolchain, so cargo check/cargo test could not be run. While reviewing, I also found that the intent_settlement crate on main currently fails to build independently of this change: several constants and Error variants referenced throughout lib.rs and test.rs — e.g. CANCEL_COOLDOWN, MAX_PROTOCOL_FEE_BPS, MIN_FILL_WINDOW_SECS, MIN_INTENT_EXPIRY_SECS, MIN_BOND_FLOOR, MAX_BATCH_SIZE, MAX_EXTENSION_DURATION, DEFAULT_MIN_BOND/DEFAULT_FILL_WINDOW/DEFAULT_INTENT_EXPIRY/DEFAULT_PROTOCOL_FEE_BPS, Error::InvalidConfig, Error::AmountTooLarge — are used but never defined. They appear to have been dropped from main in a prior merge (they exist in commit 2e36dee but not in the current tree). This predates and is unrelated to these 4 issues, so I left it untouched per scope, with one exception: SLASH_COOLDOWN was restored (as a const) since get_slash_cooldown_remaining (#256) directly depends on it and the issue text assumes it already exists.

Please run CI on this PR to confirm, and consider a separate fix for the missing-constants regression on main.

Test plan

  • CI build/test (no local toolchain available to pre-validate)
  • Manual review of accept_intent/fill_intent/slash_solver bookkeeping changes for SolverIntents and per-token stats

Closes: #245
Closes: #246
Closes: #255
Closes: #256

… routes

Adds four solver/integrator convenience views to intent_settlement:
- get_slash_cooldown_remaining: seconds left in a solver's post-slash
  SLASH_COOLDOWN, sharing the exact comparison accept_intent uses via a
  new slash_cooldown_remaining helper.
- get_solver_intents: enumerates a solver's currently Accepted intent
  ids via a new SolverIntents list, kept in sync in accept_intent,
  fill_intent (both branches), and slash_solver.
- get_token_stats: per-dst-token cumulative volume/fees, tracked
  alongside the existing global TotalVolume counter in fill_intent.
- set_solver_routes / get_solver_routes: optional, purely advisory
  per-solver src_chain/dst_token route declaration, bounded by a new
  MAX_ROUTE_ENTRIES cap; accept_intent behavior is unaffected.

docs/solver-integration-guide.md and README's error table are updated
to match.

Note: the intent_settlement crate on main currently fails to build
independently of this change -- several constants and Error variants
referenced throughout lib.rs and test.rs (e.g. CANCEL_COOLDOWN,
MAX_PROTOCOL_FEE_BPS, DEFAULT_MIN_BOND, InvalidConfig, AmountTooLarge)
are used but never defined, apparently dropped in a prior merge. This
predates and is unrelated to these 4 issues, so it was left untouched
per scope; SLASH_COOLDOWN was restored since get_slash_cooldown_remaining
(stellar-vortex-protocol#256) directly depends on it. No Rust toolchain was available in this
environment to run cargo check/test, so these changes are unverified by
CI locally -- please confirm CI passes on the PR.

Closes: stellar-vortex-protocol#245
Closes: stellar-vortex-protocol#246
Closes: stellar-vortex-protocol#255
Closes: stellar-vortex-protocol#256
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@had3sgames 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

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

Labels

None yet

Projects

None yet

1 participant