Description
CalloraSettlement::get_all_developer_balances iterates the entire developer Map and its own docs warn that >100 entries can exhaust gas. A single unbounded admin view that can hit the transaction budget is a denial-of-service vector for operators. Add pagination (offset/limit) or a hard cap so the call cannot exceed Soroban resource limits.
Requirements and Context
- Add
get_developer_balances_page(caller, start, limit) with a documented max limit.
- Keep the legacy full call but reject when entry count exceeds a safe threshold, pointing operators to the paginated API and off-chain indexing.
- Document gas implications in
docs/SETTLEMENT_IMPLEMENTATION.md.
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b feature/settlement-paginated-balances
- Implement changes
contracts/settlement/src/lib.rs — paginated view + cap
docs/SETTLEMENT_IMPLEMENTATION.md — gas/pagination notes
- Test and commit
cargo test -p callora-settlement
- Test pagination boundaries and over-cap rejection
- Include test output and notes in the PR
Example commit message
feat: add paginated developer balance query to settlement
Acceptance Criteria
Guidelines
.rs under contracts/settlement/src/, cargo test, /// docs, minimum 95% line coverage, no unwrap() in prod paths
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
CalloraSettlement::get_all_developer_balancesiterates the entire developerMapand its own docs warn that >100 entries can exhaust gas. A single unbounded admin view that can hit the transaction budget is a denial-of-service vector for operators. Add pagination (offset/limit) or a hard cap so the call cannot exceed Soroban resource limits.Requirements and Context
get_developer_balances_page(caller, start, limit)with a documented maxlimit.docs/SETTLEMENT_IMPLEMENTATION.md.Suggested Execution
contracts/settlement/src/lib.rs— paginated view + capdocs/SETTLEMENT_IMPLEMENTATION.md— gas/pagination notescargo test -p callora-settlementExample commit message
Acceptance Criteria
Guidelines
.rsundercontracts/settlement/src/,cargo test,///docs, minimum 95% line coverage, nounwrap()in prod paths