Skip to content

Conversation

@ASuciuX
Copy link
Contributor

@ASuciuX ASuciuX commented Sep 12, 2025

[wip] to add prev_cursor

Fixes #2349 by adding cursor-based pagination for events. This provides stable iteration through results, unlike offset-based pagination where responses can shift as new events are added.

@github-actions
Copy link

github-actions bot commented Sep 12, 2025

Vercel deployment URL: https://stacks-blockchain-57uq2bbf2-hirosystems.vercel.app 🚀

@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 93.93939% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/datastore/pg-store.ts 92.15% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@pradel
Copy link
Contributor

pradel commented Sep 23, 2025

@ASuciuX thanks for giving a shot at this pr. With this cursor based approach, will it be possible to got from event 1 (the first one that happened) to the last one? My use case would be to index all the events from the start to a specific block.

@ASuciuX
Copy link
Contributor Author

ASuciuX commented Sep 23, 2025

Yes, with the cursor you can iterate forward from the very first event to the latest, page by page. It’s designed so you can start at genesis and stop at any specific block height.

@pradel
Copy link
Contributor

pradel commented Sep 23, 2025

Amazing, looking forward to be able to use this approach 🙏

@ASuciuX ASuciuX requested a review from rafaelcr September 24, 2025 09:45
@ASuciuX ASuciuX marked this pull request as ready for review September 30, 2025 12:19
@pradel
Copy link
Contributor

pradel commented Nov 3, 2025

@ASuciuX lmk if I can help to get the pr merged faster

@ASuciuX
Copy link
Contributor Author

ASuciuX commented Nov 18, 2025

@ASuciuX lmk if I can help to get the pr merged faster

The task got pushed to the backlog due to some internal priorities, but I’ll take care of it as soon as those wrap up.

ASuciuX and others added 2 commits January 6, 2026 08:51
Co-authored-by: ASuciuX <asuciu@hiro.so>
Co-authored-by: rmottley-hiro <rmottley@hiro.so>
@rmottley-hiro rmottley-hiro force-pushed the feat/sc-events-cursor-pagination branch from 891d308 to a89332e Compare January 7, 2026 23:19
@rmottley-hiro rmottley-hiro changed the base branch from develop to next January 8, 2026 02:56
@rmottley-hiro
Copy link
Contributor

rmottley-hiro commented Jan 8, 2026

I'm unsure why the test workflow isn't running for this PR, but I had the tests run manually to verify they're passing
Branch Test

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.

Add block-based filtering to prevent pagination issues in endpoints

5 participants