Skip to content

Create utility provider reliability score api#154

Merged
elizabetheonoja-art merged 3 commits intoUtility-Drip:mainfrom
whiteghost0001:Create-Utility_Provider_Reliability_Score_API
Apr 3, 2026
Merged

Create utility provider reliability score api#154
elizabetheonoja-art merged 3 commits intoUtility-Drip:mainfrom
whiteghost0001:Create-Utility_Provider_Reliability_Score_API

Conversation

@whiteghost0001
Copy link
Copy Markdown
Contributor

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

- 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
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@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! 🚀

Learn more about application limits

@elizabetheonoja-art elizabetheonoja-art merged commit 73a0fe5 into Utility-Drip:main Apr 3, 2026
0 of 3 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.

84. Create Utility_Provider_Reliability_Score_API

2 participants