Skip to content

Feat/solver extensions and batch - #166

Open
aji70 wants to merge 3 commits into
stellar-vortex-protocol:mainfrom
aji70:feat/solver-extensions-and-batch
Open

Feat/solver extensions and batch#166
aji70 wants to merge 3 commits into
stellar-vortex-protocol:mainfrom
aji70:feat/solver-extensions-and-batch

Conversation

@aji70

@aji70 aji70 commented Jul 27, 2026

Copy link
Copy Markdown

Summary

This PR adds three interconnected features for the vortex protocol:

  1. Add get_solver_count view backed by the existing TotalSolvers stat #55 - Add get_solver_count view backed by the existing TotalSolvers stat
  2. Add batch_submit_intent / batch_accept_intent for gas-conscious callers #56 - Add batch_submit_intent / batch_accept_intent for gas-conscious callers
  3. Add a grace-period extension mechanism for solvers close to missing the fill window #57 - Add grace-period extension mechanism for solvers close to missing the fill window

Changes

#55 — Add get_solver_count view

  • Added get_solver_count() view returning total registered solvers
  • Backed by existing TotalSolvers stat already tracked in register_solver/deregister_solver
  • Added test verifying count increments and decrements correctly

#56 — Batch intent operations

  • Added batch_submit_intent() accepting vec of intent parameters
  • Added batch_accept_intent() accepting vec of intent IDs
  • Both bounded by MAX_BATCH_SIZE (100) to prevent resource exhaustion
  • Full batch reverts on any item failure (transaction atomicity)
  • Added tests for:
    • Multiple intents submitted/accepted successfully
    • Batch size limit enforcement
    • Partial failure behavior (all-or-nothing)

#57 — Fill window extension mechanism

  • Added request_extension() entrypoint for Accepted intents
  • Grants exactly one extension per intent (abuse limit)
  • Extends deadline by MAX_EXTENSION_DURATION (5 minutes)
  • Only the assigned solver can request
  • Only on Accepted intents
  • Added tests for:
    • Extension granted once and tracked
    • Second request rejected
    • Authorization checks (wrong solver)
    • State validation (must be Accepted)
    • Practical test: extension allows late fill within extended window

Notes

  • Code-only delivery: no install/build/test/scripts run during implementation
  • Committer: aji70 (Ajidokwu Sabo)
  • Three separate commits, one per issue, for clear attribution
  • All features follow existing code patterns and conventions

Closes #54, Closes #55, Closes #56, Closes #57

@drips-wave

drips-wave Bot commented Jul 27, 2026

Copy link
Copy Markdown

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