Create utility provider reliability score api#154
Merged
elizabetheonoja-art merged 3 commits intoUtility-Drip:mainfrom Apr 3, 2026
Merged
Conversation
- Add ReliabilityBadge enum (None/Bronze/Silver/Gold) - Add ProviderReliabilityScore contracttype tracking windows_online, windows_total, score_bps, badge, last_updated - Add DataKey::ReliabilityScore(Address) for per-provider storage - Add RELIABILITY_BADGE_GOLD/SILVER/BRONZE_BPS constants (9900/9500/9000) - Add compute_reliability_badge() helper - Implement report_provider_uptime(): oracle-gated uptime reporting, recalculates score and badge on every call - Implement get_reliability_score(): full score record query - Implement get_reliability_badge(): lightweight badge tier query - Add 6 tests: Gold/Silver/Bronze/None badge tiers, unknown provider no-op, and score accumulation across multiple report batches - Fix pre-existing bugs: gas_estimator f32/LargeScaleCostEstimate, billing group Soroban Vec API, symbol_short length limits, moved value errors, fuzz test imports and missing struct fields Closes: Create-Utility_Provider_Reliability_Score_API
|
@whiteghost0001 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.
Added an on-chain reputation system for utility providers. The oracle periodically calls report_provider_uptime(provider, was_online) to record whether a provider was reachable during an observation window. The contract accumulates those reports and derives a score in basis points (e.g. 9900 = 99% uptime), then automatically assigns a badge tier — Gold (≥99%), Silver (≥95%), Bronze (≥90%), or None.
Users can call get_reliability_score(provider) before starting a stream to see the full history, or get_reliability_badge(provider) for a quick tier check. This creates market transparency that rewards high-uptime providers with more customers and pressures low-quality ones to improve.
closes #116