feat: paged storage, O(1) lists, bucketed user intents, intent pruning - #449
Merged
james2177 merged 2 commits intoSep 30, 2026
Conversation
Resolves stellar-vortex-protocol#153, stellar-vortex-protocol#371, stellar-vortex-protocol#373, stellar-vortex-protocol#374. ## Issue stellar-vortex-protocol#153 — Bucketed UserIntents - Replace single UserIntents(Address) Vec with fixed-size buckets of 64 intent IDs: UserIntents(Address, u32) + UserIntentCount(Address). - list_intents_by_user(user, start, limit) is now paginated; pruned slots (None) are skipped. Backward-compatible list_intents_by_user_legacy kept. - submit_intent writes via user_intents_append(); bump_user_intents_ttl() keeps the active bucket live. ## Issue stellar-vortex-protocol#373 — Paged persistent SolverList + AllowedDstTokenList - Move both lists from instance storage (O(n) per-call deserialisation) to paged persistent storage: SolverListPage(u32) / SolverListCount / SolverListIdx(Address) and matching DstTokenList* variants. - add_to_solver_list / remove_from_solver_list and add_to_dst_token_list / remove_from_dst_token_list are now O(1) via append + index map (swap-remove on delete). - list_solvers and list_allowed_dst_tokens updated to walk pages. - Ordering is not insertion order after any swap-remove; documented. ## Issue stellar-vortex-protocol#374 — O(1) SolverIntents via index map - Add SolverIntentIdx(Address, BytesN<32>) -> u32 alongside SolverIntents. - solver_intents_add: O(1) push + index write; duplicate-add is a no-op. - solver_intents_remove: O(1) swap-remove + index update. - get_solver_intents(solver, start, limit) is now paginated. - Invariant: len(SolverIntents(solver)) == solver_record.active_intents. ## Issue stellar-vortex-protocol#371 — Permissionless close_intent + tombstone - Add terminal_at: Option<u64> field to IntentRecord; set on every terminal transition (Filled, Cancelled, Expired, Resolved). - close_intent(intent_id): permissionless; callable by anyone after terminal_at + retention_secs <= now (default 30 days). Deletes: Intent, IntentFillHistory, ExtensionGranted, BestBid, BackstopClaimed, UserIntents bucket slot, SolverIntents entry. Leaves IntentTombstone so IntentAlreadyExists still fires on id reuse. - set_intent_retention(secs) / get_intent_retention() for admin config. - New errors: IntentNotTerminal (36), RetentionPeriodNotElapsed (37). - Updated docs/145-ttl-bump-frequency-review.md §5. ## Housekeeping - Deduplicate accumulated duplicate constant definitions (leftover merges). - Update .gitignore: add *.snap, *.snap.new, coverage artifacts, criterion output, and other unnecessary files.
|
@villadel 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! 🚀 |
…ge-bounded-lists-pruning # Conflicts: # .gitignore # intent_settlement/src/lib.rs
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.
Resolves #153, #371, #373, #374.
Issue #153 — Bucketed UserIntents
Issue #373 — Paged persistent SolverList + AllowedDstTokenList
Issue #374 — O(1) SolverIntents via index map
Issue #371 — Permissionless close_intent + tombstone
Housekeeping
Summary
Related issue
Type of change
Component
vortex-contract)vortex-backend)vortex-frontend)Checklist
Screenshots / notes
CLOSES
closes #371
closes #372
closes #373
closes #374