Skip to content

feat(job_registry,reputation): SC-REG-037, SC-REG-039, SC-REP-050#600

Merged
soomtochukwu merged 2 commits into
DXmakers:mainfrom
Feyisara2108:feat/budget-bounds-bids-pagination-auth-gating
May 28, 2026
Merged

feat(job_registry,reputation): SC-REG-037, SC-REG-039, SC-REP-050#600
soomtochukwu merged 2 commits into
DXmakers:mainfrom
Feyisara2108:feat/budget-bounds-bids-pagination-auth-gating

Conversation

@Feyisara2108
Copy link
Copy Markdown
Contributor

@Feyisara2108 Feyisara2108 commented May 27, 2026

Summary

  • SC-REG-037 (contracts/job_registry/src/lib.rs): Add MIN_BUDGET_STROOPS (100,000 = 0.01 XLM) and MAX_BUDGET_STROOPS (100,000,000,000,000 = 10M XLM) constants enforced in validate_job_input. Rejects dust spam and unrealistic values at the input boundary. Existing tests updated to use MIN_BUDGET_STROOPS so they reach their intended assertions.
  • SC-REG-039 (contracts/job_registry/src/lib.rs): Add get_bids_page(job_id, offset, limit) paginated getter and get_bids_count(job_id) length-only reader. The paginator slices the bids vector without loading entries outside the window; the counter reads only the vector length, keeping cost O(1) per key lookup.
  • SC-REP-050 (contracts/reputation/src/lib.rs): Add require_authorized_contract guard that validates the caller is the registered AuthorizedUpdater contract address. update_score, slash, and blacklist_profile all go through this guard. Tests prove arbitrary public keys and unregistered contracts are rejected with Error(Contract, #2).

Test plan

  • cargo test -p job_registry — 27/27 pass (includes 5 budget-bounds tests and 5 pagination tests)
  • cargo test -p reputation — 15/15 pass (includes 5 new auth-gating tests)
  • All new test snapshots committed

Closes #391
Closes #393
Closes #404

@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

@Feyisara2108 is attempting to deploy a commit to the mAzI's projects Team on Vercel.

A member of the Team first needs to authorize it.

- SC-REG-037: Add MIN/MAX budget bounds (100k–100T stroops) enforced in
  validate_job_input; update pre-existing tests to use MIN_BUDGET_STROOPS
  so they reach their intended assertions rather than hitting budget guard
- SC-REG-039: Add get_bids_page(offset, limit) paginator and get_bids_count
  for O(1) length reads without deserialising the full bid vector
- SC-REP-050: Add contract-to-contract auth gating via require_authorized_contract;
  update_score, slash, and blacklist_profile now reject any caller that is
  not the registered authorized contract; tests prove arbitrary public key
  reviews and rogue contract adjustments are blocked

Closes DXmakers#391, DXmakers#393, DXmakers#404

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Feyisara2108 Feyisara2108 force-pushed the feat/budget-bounds-bids-pagination-auth-gating branch from e4550b8 to 23d3119 Compare May 27, 2026 18:04
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@Feyisara2108 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

@soomtochukwu soomtochukwu merged commit 8bb05b0 into DXmakers:main May 28, 2026
2 of 7 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

2 participants