Skip to content

fix: cap number of public reviews per milestone (#808) - #834

Merged
Samuel1505 merged 2 commits into
PhasoraLabs:mainfrom
chiscookeke11:fix/issue-808-open-review-cap
Jul 29, 2026
Merged

fix: cap number of public reviews per milestone (#808)#834
Samuel1505 merged 2 commits into
PhasoraLabs:mainfrom
chiscookeke11:fix/issue-808-open-review-cap

Conversation

@chiscookeke11

Copy link
Copy Markdown
Contributor

Summary

I added a MAX_PUBLIC_REVIEWS_PER_MILESTONE cap (50) to open_review::submit_review to prevent unbounded review list growth per milestone and protect gas/CPU costs on ledger state updates.

Scope

I only worked on issue #808 (open_review::submit_review unbounded review list growth). I am not claiming any other issues in this PR.

Changes

  • Added MAX_PUBLIC_REVIEWS_PER_MILESTONE constant (50) in constants.rs.
  • Added TooManyPublicReviews error variant to ContractError in errors.rs.
  • Updated submit_review in open_review.rs to reject new reviewers exceeding the cap while allowing existing reviewers to update their entries.
  • Added unit test submit_review_rejects_when_cap_reached in open_review.rs.

Test Plan

  • Ran cargo test --lib and verified all 165 tests pass (including submit_review_rejects_when_cap_reached).
  • Ran cargo fmt to ensure clean formatting.

Closes #808

@drips-wave

drips-wave Bot commented Jul 28, 2026

Copy link
Copy Markdown

@chiscookeke11 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Samuel1505
Samuel1505 merged commit c855a9e into PhasoraLabs:main Jul 29, 2026
4 of 5 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.

Fix open_review::submit_review Allowing Unbounded Review List Growth Per Milestone

2 participants