Skip to content

feat: bench get_schedules_paginated and verify cursor monotonicity#796

Merged
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
ekwe7:add-gas-benchmarks-and-cursor-monotonicity-tests-for-get-schedules-paginated-at-scale
Jun 19, 2026
Merged

feat: bench get_schedules_paginated and verify cursor monotonicity#796
Baskarayelu merged 1 commit into
Remitwise-Org:mainfrom
ekwe7:add-gas-benchmarks-and-cursor-monotonicity-tests-for-get-schedules-paginated-at-scale

Conversation

@ekwe7

@ekwe7 ekwe7 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Closes #777

Description

This PR adds performance benchmarks and correctness tests for RemittanceSplit::get_schedules_paginated, ensuring schedule pagination remains efficient and behaves correctly at scale.

Since schedule listing is frequently used by clients polling upcoming remittances, these additions help guarantee that gas consumption stays bounded as cursor positions advance and that pagination terminates without duplicates or missing entries.

Gas Benchmarks

  • Added gas benchmarks for get_schedules_paginated with:

    • 1 schedule
    • 25 schedules
    • MAX_SCHEDULES_PER_OWNER (50 schedules)
  • Verified that per-page gas cost remains bounded as the cursor advances.

Pagination Correctness Tests

Added tests to ensure:

  • The union of all returned pages equals the complete schedule set.
  • No schedules are duplicated or missed across pages.
  • Pagination cursor strictly advances and eventually terminates.
  • Returned schedules are ordered by ascending schedule ID.
  • Requested limits are properly clamped.
  • Schedules belonging to different owners remain isolated.

Edge Cases Covered

  • Cursor positioned past the end of the schedule list.
  • Single-schedule owners.
  • Owners with exactly MAX_SCHEDULES_PER_OWNER schedules.

Documentation

  • Updated SCHEDULE_GAS_BENCHMARKS_SUMMARY.md with benchmark results.

@Baskarayelu

Copy link
Copy Markdown
Contributor

gas benchmarks plus a cursor-monotonicity check on get_schedules_paginated - exactly the kind of perf + correctness guard we want on the paginated query paths. merging 👍

@Baskarayelu Baskarayelu merged commit f431ba0 into Remitwise-Org:main Jun 19, 2026
2 of 6 checks passed
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.

Remittance Split: add gas benchmarks and cursor-monotonicity tests for get_schedules_paginated at scale

2 participants