feat(job_registry,reputation): SC-REG-037, SC-REG-039, SC-REP-050#600
Merged
soomtochukwu merged 2 commits intoMay 28, 2026
Conversation
|
@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>
e4550b8 to
23d3119
Compare
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
contracts/job_registry/src/lib.rs): AddMIN_BUDGET_STROOPS(100,000 = 0.01 XLM) andMAX_BUDGET_STROOPS(100,000,000,000,000 = 10M XLM) constants enforced invalidate_job_input. Rejects dust spam and unrealistic values at the input boundary. Existing tests updated to useMIN_BUDGET_STROOPSso they reach their intended assertions.contracts/job_registry/src/lib.rs): Addget_bids_page(job_id, offset, limit)paginated getter andget_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.contracts/reputation/src/lib.rs): Addrequire_authorized_contractguard that validates the caller is the registeredAuthorizedUpdatercontract address.update_score,slash, andblacklist_profileall go through this guard. Tests prove arbitrary public keys and unregistered contracts are rejected withError(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)Closes #391
Closes #393
Closes #404