Skip to content

Limit span of checkpoint TTL range bumps #1203

Closed

Description

@greatest0fallt1me

Summary

bump_checkpoints_ttl_range(start_id, end_id) loops over every id in start_id..=end_id with no maximum span.

Why this matters

An admin passing a wide range (or u64::MAX) will exceed CPU limits and fail; worse, tooling may repeatedly retry. Other range views cap at MAX_PAGE_SIZE.

Scope

Reject spans larger than MAX_PAGE_SIZE with InvalidPageSize, or clamp and return the last processed id so callers can continue.

Relevant code in CalloraOrg/Callora-Contracts:

  • contracts/checkpoint/src/lib.rs

Priority

Medium

Acceptance criteria

  • Span above the cap is rejected or clamped with a returned cursor
  • Span within the cap bumps all existing ids
  • Missing ids are skipped without error
  • Non-admin callers still receive Unauthorized

Validation

cargo test -p callora-checkpoint ttl

Non-goals

  • Typo-only, formatting-only, or cosmetic changes.
  • Unrelated refactors, dependency upgrades, or broad rewrites.
  • Removing safeguards or weakening validation to make tests pass.

Contributor application

Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.

PR requirements

Use a feature branch and include Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.

Quality review

A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.


Generated by Claude Code

Activity

  1. changed the title [-]Keep leaderboard rank pages deterministic[/-] [+]Add focused test coverage for contracts/revenue_pool/src/test_invariant.rs[/+] on Sep 27, 2026
  2. changed the title [-]Add focused test coverage for contracts/revenue_pool/src/test_invariant.rs[/-] [+]Limit span of checkpoint TTL range bumps[/+] on Sep 27, 2026
  3. AkpakaProsper commented on Sep 29, 2026

    @AkpakaProsper

    @AkpakaProsper has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Can I contribute to this issue?

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @AkpakaProsper to this issue.

  4. boluxx123 commented on Sep 30, 2026

    @boluxx123
    Contributor

    @boluxx123 has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi Maintainer, would like to work on this issue and make PR immediately today
    Kindly assign.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @boluxx123 to this issue.

  5. babatundealao407-alt commented on Sep 30, 2026

    @babatundealao407-alt

    @babatundealao407-alt has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Interested in working on this issue. I understand the requirements and can deliver a solution that meets the expected outcome.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @babatundealao407-alt to this issue.

  6. kingsrichie79-cmyk commented on Sep 30, 2026

    @kingsrichie79-cmyk

    @kingsrichie79-cmyk has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I’m available to work on this issue and can start right away

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @kingsrichie79-cmyk to this issue.

  7. Rodrigoue9 commented on Oct 3, 2026

    @Rodrigoue9

    Hi @maintainers! I'd like to work on this issue. Here is my proposed technical approach:

    Proposed Technical Approach:

    1. Contract Logic Implementation: Implement the required Soroban smart contract logic in Rust, ensuring strict validation, authorization checks (require_auth), and gas optimization.
    2. Storage Layout & State Management: Maintain safe data key patterns, TTL management, and prevent state inconsistency or unauthorized state mutations.
    3. Events & Error Encoding: Emit strongly typed contract events and return descriptive custom errors for all failure modes.
    4. Comprehensive Test Vectors: Implement Rust unit and integration tests using soroban-sdk::Env verifying both success and failure execution paths.

    Key Files:

    • contracts/**/src/lib.rs (contract entrypoints and interface implementations)
    • contracts/**/src/types.rs or storage.rs (types, data keys, and state)
    • contracts/**/src/test.rs (unit tests and integration vectors)

    Verification & Testing:

    • Run cargo test across all contract crates verifying 100% pass rate.
    • Run cargo clippy --all-targets -- -D warnings and cargo fmt --check.
    • Verify Soroban WASM build: soroban contract build.

    Relevant Track Record:

    I have successfully implemented and merged multiple production PRs across the Stellar ecosystem and Web3 open-source projects (e.g., Bitcoindefi/OpenAO #218, cybermax4200/stellar-did-credit #898 & #900, and FindMalek/sonaraem #416).

    Please feel free to assign this issue to me so I can proceed with the implementation. Thank you!

  8. shobhamerabacha-star commented on Oct 7, 2026

    @shobhamerabacha-star

    Hi maintainers,

    I reviewed this issue and would like to contribute the fix.

    Technical outline:

    1. Audit storage layout and state invariants ensuring strict auth guards.
    2. Implement deterministic state transitions with safe checked arithmetic.
    3. Add hermetic unit and regression tests covering authorized, unauthorized, and boundary edge cases.
    4. Profile instruction and CPU/gas limits under Soroban host environment.

    Let me know if this aligns with the repository guidelines and assign when convenient.

  9. lienhoatienphung-svg commented on Oct 16, 2026

    @lienhoatienphung-svg

    Hi! I have implemented and verified this in #1384 with full unit test coverage and rustfmt compliance.

  10. Holer8 commented on Oct 16, 2026

    @Holer8

    @Holer8 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’ve reviewed the issue and have a solid understanding of what needs to be addressed. I’d like to take responsibility for the implementation and ensure the resulting changes are reliable, well-tested, and easy to maintain.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Holer8 to this issue.

  11. itzsoftwaredevops-sys commented on Oct 18, 2026

    @itzsoftwaredevops-sys

    @itzsoftwaredevops-sys has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I’ve reviewed this issue and I’m confident I can contribute effectively. My experience in software engineering and Web3 development aligns with the requirements, and I’m ready to take ownership, follow the project’s conventions, and deliver a clean, tested solution.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @itzsoftwaredevops-sys to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveStellar Wave Program issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions