Skip to content

BM-2430: Add status filter to list_requests and fix pagination cursor bug#1621

Open
willpote wants to merge 14 commits intomainfrom
willpote/expired-filter
Open

BM-2430: Add status filter to list_requests and fix pagination cursor bug#1621
willpote wants to merge 14 commits intomainfrom
willpote/expired-filter

Conversation

@willpote
Copy link
Copy Markdown
Contributor

@willpote willpote commented Feb 9, 2026

Adds a status query parameter to the GET /v1/market/requests endpoint allowing filtering by request status (submitted, locked, fulfilled, expired). Also fixes a pagination cursor bug that could cause records to be silently dropped during pagination.

Changes

  • Add status filter parameter to list_requests DB function and the /v1/market/requests API endpoint, with corresponding SQL queries for all cursor/status combinations
  • Fix RequestCursor.request_digest formatting: B256::to_string() produces 0x-prefixed hex but the DB stores plain hex, causing string comparison mismatches in the pagination WHERE request_digest < $cursor clause. This silently drops records when multiple entries share the same timestamp and their digests start with hex chars > 0. Fixed in all 3 cursor construction sites (market.rs, requestors.rs, provers.rs)
  • Add test_list_requests_pagination_same_timestamp DB unit test that reproduces the cursor formatting bug
  • Add test_list_requests_with_status_filter DB unit test for the new status filter
  • Add test_market_requests_pagination_completeness API integration test that verifies no records are lost during one-by-one pagination
  • Add DB index on (request_status, created_at) to support filtered queries

Made with Cursor

@github-actions github-actions bot changed the title Add status filter to list_requests and fix pagination cursor bug BM-2430: Add status filter to list_requests and fix pagination cursor bug Feb 10, 2026
@linear
Copy link
Copy Markdown

linear bot commented Feb 10, 2026

Co-authored-by: Cursor <cursoragent@cursor.com>
@willpote willpote enabled auto-merge (squash) February 19, 2026 21:11
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.

3 participants