Skip to content

fix(checkpoint): limit span of checkpoint TTL range bumps (#1203) - #1384

Closed
lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1203-checkpoint-ttl-range-cap
Closed

lienhoatienphung-svg wants to merge 1 commit into
CalloraOrg:mainfrom
lienhoatienphung-svg:feature/1203-checkpoint-ttl-range-cap

Conversation

@lienhoatienphung-svg

Copy link
Copy Markdown

Closes #1203

Summary

Bounds CalloraCheckpoint::bump_checkpoints_ttl_range(start_id, end_id) so that any inclusive span end_id - start_id + 1 exceeding MAX_PAGE_SIZE (100) — including 0..=u64::MAX — is rejected upfront with CheckpointError::InvalidPageSize before iterating over persistent storage.

Acceptance Criteria Mapping

  • Span above the cap is rejected or clamped with a returned cursor: Rejected with CheckpointError::InvalidPageSize when end_id - start_id + 1 > MAX_PAGE_SIZE (test_bump_checkpoints_ttl_range_rejects_span_above_max_page_size).
  • Span within the cap bumps all existing ids: Verified at the exact MAX_PAGE_SIZE boundary (test_bump_checkpoints_ttl_range_allows_exact_max_page_size_span) and test_bump_checkpoints_ttl_range_succeeds.
  • Missing ids are skipped without error: Verified in test_bump_checkpoints_ttl_range_skips_missing_ids and test_bump_checkpoints_ttl_range_allows_exact_max_page_size_span.
  • Non-admin callers still receive Unauthorized: Verified in test_bump_checkpoints_ttl_range_fails_for_non_admin.

Validation

  • cargo test -p callora-checkpoint ttl

Payout Wallet (Base Mainnet USDC / EVM): 0x3806cd592a508d1992Ed007C2F53de251C2E7452

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.

Limit span of checkpoint TTL range bumps

2 participants