Open
Labels
bugSomething isn't workingdifficulty: hardHard difficulty issueinfrastructurepriority: mediumMedium priority issueweb3
Description
Bug Description
Cursor-based pagination assumes monotonically increasing ledger sequence, but if the indexer backfills historical events after already indexing recent ones, the cursor can skip or repeat entries.
Component
- Backend
- Frontend
- Smart Contract
- SDK
- Documentation
- Other:
Steps to Reproduce
- Index a batch of recent events.
- Trigger a historical backfill for older events.
- Page through
/events/sorobanusing the returned cursor. - Check for skipped or duplicated entries across pages.
Expected Behavior
Pagination should remain correct regardless of indexing order, typically by using a stable, globally ordered key rather than insertion order.
Actual Behavior
Pages can skip or duplicate entries once a backfill has run after live indexing began.
Environment
- Node Version: 20.x
- OS: Linux / macOS
- Browser (if applicable): N/A
- Network (Testnet/Mainnet): Testnet
Error Messages/Logs
N/A — no error output; behavior is incorrect but silent.
Screenshots
N/A — backend/API issue, not applicable.
Additional Context
The cursor is derived from Redis's natural ordering (insertion order) rather than an explicit sort key.
Possible Solution
Use a sorted set keyed by (ledgerSeq, eventIndex) for pagination rather than relying on insertion order.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingdifficulty: hardHard difficulty issueinfrastructurepriority: mediumMedium priority issueweb3
Activity
maxx-GENIUS commentedon Nov 1, 2026
Hi @trustflow-protocol maintainers,
I can resolve this. Looking at the requirements, /events/soroban pagination cursor breaks when events are indexed out of chronological order. My plan is to implement a targeted fix for this following project standards, accompanied by tests to reproduce the scenario and confirm the fix passes all checks.
Please assign this to me and I will put together a clean PR.
ranjan1969x commentedon Nov 2, 2026
Hello maintainers,
I reviewed the issue for /events/soroban pagination cursor breaks when events are indexed out of chronological order. Governance authorization checks, boundary caps, or state validation need to be enforced across contract invocations.
Proposed Implementation:
require_auth) and state transition validations.Testing & Verification:
I will write contract integration tests verifying both authorized state updates and unauthorized invocation rejections.
Looking forward to working on it if assigned. Ready to implement the fix.
GangDev6707 commentedon Nov 3, 2026
Hello @trustflow-protocol team,
I'd like to help resolve this issue. Governance authorization checks, boundary caps, or state validation need to be enforced across contract invocations. I plan to implement strict administrative authorization checks (
require_auth) and state transition validations and enforce boundary rules and prevent state corruption or reentrancy hazards, followed by emit comprehensive audit events upon successful state modifications.I'll write contract integration tests verifying both authorized state updates and unauthorized invocation rejections to verify everything passes cleanly.
Happy to take this on if you can assign it over. Will get a clean PR ready promptly.