Skip to content

Commit 3f16627

Browse files
dennis-traclaude
andauthored
docs: provider scoring methodology (#628)
* docs: provider scoring methodology * docs(provider-scoring): frame as a default strategy, not implemented code Clarify that the ranking methodology is a proposed default and is not currently used by any code in this repo. It is intended as a guide for dashboards that want to give a sort order for SPs. Addresses review feedback from @BigLep on PR #628. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(provider-scoring): rank approval by on-chain SP Registry status Base the top-level "approved" sort criterion on the SP's on-chain approved status in the SP Registry, rather than on whether dealbot observes them currently meeting the approval acceptance criteria. Addresses review feedback from @BigLep on PR #628. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(provider-scoring): fold data completeness into the Bayesian score Drop the separate "complete data" sort tier. A missing check now contributes a zero lower bound to the weighted Bayesian score, so providers with coverage gaps rank below fully-covered peers through the score itself rather than a dedicated criterion. This simplifies the sort to three tiers (approved, score, provider ID) and removes the standalone "Data Gap Criterion" section, whose premise no longer holds. Worked examples and the probing-outage scenario are updated accordingly. Also removes the semicolon/capitalization issue noted by Copilot, as that sentence lived in the deleted section. Addresses review feedback from @BigLep and @Copilot on PR #628. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(provider-scoring): correct the "not yet scored" checks section The section claimed three planned checks but listed two, and described them as future/unlaunched. Pull and Sampled Retrieval already run in dealbot, so link to their docs and explain the real reason they are not scored yet: they are not part of the SP approval criteria. Addresses review feedback from @BigLep and @Copilot on PR #628. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(provider-scoring): use American spelling consistently Change "recognises" to "recognizes" to match the American spelling used throughout the rest of the docs (e.g. "behavior", "optimize"). Addresses review feedback from @Copilot on PR #628. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(provider-scoring): custom wording changes * docs(provider-scoring): clarify approval is an on-chain decision Approval is decided by an on-chain process; the dealbot check data guides that decision rather than setting it. Make this explicit under the criteria table and soften scenario 6, which implied dealbot itself "gates"/"blocks" approval. Per follow-up from @dennis-tra on PR #628. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * docs(provider-scoring): remove sort position statement I don't think it adds much value. * docs(provider-scoring): tighten onchain approval wording --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 207db84 commit 3f16627

1 file changed

Lines changed: 123 additions & 0 deletions

File tree

docs/provider-scoring.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# FOC Provider Scoring
2+
3+
This document describes a default strategy for how storage providers (SPs) can be ranked. No code in this repo currently uses this methodology; it is intended as a guide for dashboards that want to give a sort order for SPs (e.g., https://probelab.io/filecoin/foc/).
4+
5+
## Overview
6+
7+
Providers are sorted by three criteria evaluated left-to-right. The first criterion that differs between two providers determines their relative position while later criteria only matter when earlier ones are tied.
8+
9+
| Priority | Criterion | Direction | What it means |
10+
|---|---|---|---|
11+
| 1 | Approved (yes/no) | Approved first | Providers marked as approved in the on-chain SP Registry appear above those that are not |
12+
| 2 | Bayesian score (0–100) | Higher first | Confidence-adjusted weighted quality signal; missing check data lowers it (see below) |
13+
| 3 | Provider ID | Lower first | Deterministic tiebreaker when everything else is equal |
14+
15+
Approval itself is an on-chain decision. The dealbot check data and the [approval criteria](checks/production-configuration-and-approval-methodology.md) guide that decision. The [scenarios below](#concrete-scenarios) note the check signals that would typically inform whether a provider is approved.
16+
17+
## Bayesian Score
18+
19+
### Why raw percentages aren't enough
20+
21+
A raw success rate treats 97 % from 200 checks identically to 97 % from 2 000 checks. A newly onboarded provider that happened to have a perfect first two weeks looks identical to an established one with years of data. This conflates certainty with quality.
22+
23+
The Bayesian score instead asks: *given what has actually been observed, what success rate can we be 95 % confident the provider truly sustains?* The answer is always lower than the observed rate but increasingly less so as the sample count grows.
24+
25+
### How the score is calculated
26+
27+
For each check type, the score is the **95 % Bayesian credible lower bound** on the provider's true success rate. The statistical model assumes no prior knowledge of the provider (a uniform prior), then updates based on the observed successes and failures:
28+
29+
```
30+
lower bound = 5th percentile of Beta(1 + successes, 1 + failures) × 100
31+
```
32+
33+
In plain terms: given the observed data, there is a 95 % probability that the provider's true long-run success rate is at least this high. The bound is conservative by design. It represents a floor we can be confident in and not the most likely value.
34+
35+
### Example Calculations
36+
37+
| Observed rate | Sample count | Bayesian lower bound |
38+
|---|---|---|
39+
| 97.0 % | 200 | ~94.2 % |
40+
| 97.0 % | 2 000 | ~96.3 % |
41+
| 99.0 % | 200 | ~96.9 % |
42+
| 99.0 % | 2 000 | ~98.6 % |
43+
| 100.0 % | 200 | ~98.5 % |
44+
| 100.0 % | 2 000 | ~99.9 % |
45+
46+
Notice that the 97 % provider with 2 000 checks (lower bound ~96.3 %) and the 99 % provider with 200 checks (lower bound ~96.9 %) score nearly identically — the scoring correctly recognizes them as about equally trustworthy despite the different observed rates.
47+
48+
### Check weights
49+
50+
The three active check types are combined as a weighted average of their individual lower bounds:
51+
52+
| Check | Weight | Rationale |
53+
|---|---|---|
54+
| Data retention | 40 % | Data loss is the worst outcome for a storage service; ongoing proof-of-custody is hard to fake and has no client-side recovery path |
55+
| Data retrieval | 35 % | Inability to serve stored data when a client needs it is an immediately user-visible failure with no retry on the client side |
56+
| Data storage | 25 % | Upload failures are retryable; important as the end-to-end ingest signal but lower stakes than the read path |
57+
58+
When a check type has no data at all (zero samples), its lower bound is treated as zero and it still contributes its full weight to the average. A provider missing data on a check therefore scores lower than an otherwise-equal provider with full coverage. This keeps the ranking simple as a single score handles both quality and data completeness.
59+
60+
### Checks not yet in the score
61+
62+
These additional check types already run in dealbot and could be incorporated into the score:
63+
64+
* [Pull](checks/pull-check.md)
65+
* [Sampled Retrieval](checks/sampled-retrievals.md)
66+
67+
They aren't included currently because they aren't part of the [SP approval criteria](checks/production-configuration-and-approval-methodology.md).
68+
69+
## Missing Check Data
70+
71+
Because a missing check contributes zero to the Bayesian score (see [Check weights](#check-weights)), data gaps are handled by the score itself rather than a separate sort criterion. A provider that genuinely has no data on a check, for example, a newly onboarded provider that has not yet accumulated enough retention periods, scores lower than peers with full coverage.
72+
73+
When dealbot itself encounters a probing outage, the gap typically affects all providers simultaneously. Every provider loses the same check contribution, so relative ordering within each group is unchanged even though absolute scores drop.
74+
75+
## Concrete Scenarios
76+
77+
### 1. Established approved provider
78+
79+
- Retention: 0 faults / 3 000 periods → lower bound ~99.8 %
80+
- Retrieval: 2 910 / 3 000 checks → lower bound ~96.2 %
81+
- Storage: 2 910 / 3 000 checks → lower bound ~96.2 %
82+
- **Bayesian score**: 0.40 × 99.8 + 0.35 × 96.2 + 0.25 × 96.2 ≈ **97.9**
83+
84+
### 2. New provider, good rates, low sample count
85+
86+
- Retention: 0 faults / 520 periods → lower bound ~98.5 %
87+
- Retrieval: 194 / 200 checks → lower bound ~92.8 %
88+
- Storage: 194 / 200 checks → lower bound ~92.8 %
89+
- **Bayesian score**: 0.40 × 98.5 + 0.35 × 92.8 + 0.25 × 92.8 ≈ **95.6**
90+
91+
### 3. Borderline provider, exactly at the approval thresholds
92+
93+
- Retention: 1 fault / 500 periods → lower bound ~97.9 % on the non-fault side
94+
- Retrieval: 194 / 200 checks (97 %) → lower bound ~92.8 %
95+
- Storage: 194 / 200 checks (97 %) → lower bound ~92.8 %
96+
- **Bayesian score**: 0.40 × 97.9 + 0.35 × 92.8 + 0.25 × 92.8 ≈ **94.9**
97+
98+
### 4. Dealbot probing outage (storage checks unavailable for all providers)
99+
100+
When dealbot cannot reach any provider for storage checks:
101+
102+
- The storage check contributes zero for every provider (its 25 % weight is applied to a zero lower bound), so every score drops by up to 25 points
103+
- Because the gap affects all providers equally, no one gains or loses ground relative to peers
104+
- The Bayesian score still reflects retention and retrieval performance
105+
- Relative ordering within each group remains unchanged
106+
107+
### 5. Poor retrieval performance, strong retention
108+
109+
A provider has reliable storage and retention but struggles to serve data back to clients.
110+
111+
- Retention: 0 faults / 2 000 periods → lower bound ~99.7 %
112+
- Retrieval: 1 600 / 2 000 checks (80 %) → lower bound ~78.3 %
113+
- Storage: 1 960 / 2 000 checks (98 %) → lower bound ~97.1 %
114+
- **Bayesian score**: 0.40 × 99.7 + 0.35 × 78.3 + 0.25 × 97.1 ≈ **91.2**
115+
116+
### 6. High fault rate, ample samples
117+
118+
A provider has accumulated many retention periods but consistently loses data.
119+
120+
- Retention: 30 faults / 1 000 periods (3 % fault rate) → lower bound on non-fault side ~95.6 %
121+
- Retrieval: 940 / 1 000 checks (94 %) → lower bound ~92.3 %
122+
- Storage: 960 / 1 000 checks (96 %) → lower bound ~94.6 %
123+
- **Bayesian score**: 0.40 × 95.6 + 0.35 × 92.3 + 0.25 × 94.6 ≈ **94.2**

0 commit comments

Comments
 (0)