Skip to content

Commit 78f754d

Browse files
Merge pull request #782 from ethersphere/fix-calculators
fix: update calculators to use new utilisation tables, add encryption…
2 parents fe41555 + 1bee7b5 commit 78f754d

8 files changed

Lines changed: 952 additions & 510 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.docusaurus
2+
.claude
23
node_modules
34
.DS_Store
45
build
@@ -12,4 +13,4 @@ test
1213
*.zip
1314
*.csv
1415
# Tools
15-
.claude
16+
.claude

docs/concepts/DISC/erasure-coding.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ For an 8KB image, if we set **m = 2** and **k = 1**, we create 3 chunks (2 origi
2020

2121
### Levels of Protection
2222

23-
In Swarm's implementation of erasure coding, there are four named levels of protection, Medium, Strong, Insane, and Paranoid. For each level, the **m** and **k** values have been adjusted in order to meet a certain level of data protection:
23+
In Swarm's implementation of erasure coding, there are five levels of protection, None, Medium, Strong, Insane, and Paranoid. For each level, the **m** and **k** values have been adjusted in order to meet a certain level of data protection:
2424

2525
***Table A:***
2626
| Redundancy Level Value | Level Name | Chunk Loss Tolerance |
2727
| ---------------- | --------- | ----------------------------------- |
28+
| 0 | None | 0% |
2829
| 1 | Medium | 1% |
2930
| 2 | Strong | 5% |
3031
| 3 | Insane | 10% |
@@ -40,17 +41,18 @@ For usage instructions, see the [erasure coding page in the "Develop" section](.
4041

4142
## Cost Calculation
4243

43-
In Swarm's implementation of erasure coding, there are four levels of protection: Medium, Strong, Insane, and Paranoid. Each level adds additional parity chunks for a corresponding increase in data protection (and also cost).
44+
In Swarm's implementation of erasure coding, there are five levels of protection: None, Medium, Strong, Insane, and Paranoid. Each level adds additional parity chunks for a corresponding increase in data protection (and also cost).
4445

4546
The table below shows the number of parities and data chunks for each level, as well as the percent increase in cost vs a non-erasure coded upload.
4647

4748
***Table B:***
4849
| Redundancy | Parities | Data Chunks | Percent | Chunks Encrypted | Percent Encrypted |
4950
|----------|----------|--------|---------|------------------|-------------------|
50-
| Medium | 9 | 119 | *7.6%* | 59 | 15% |
51-
| Strong | 21 | 107 | *19.6%* | 53 | 40% |
52-
| Insane | 31 | 97 | 32% | 48 | 65% |
53-
| Paranoid | 90 | 38 | 240.5% | 18 | 494% |
51+
| None | 0 | 128 | *0%* | 64 | 0% |
52+
| Medium | 9 | 119 | *7.6%* | 59 | 15.3% |
53+
| Strong | 21 | 107 | *19.6%* | 53 | 39.6% |
54+
| Insane | 31 | 97 | 32% | 48 | 64.6% |
55+
| Paranoid | 90 | 38 | 236.8% | 19 | 473.7% |
5456

5557
For each redundancy level, there are **m + k** = 128 chunks, where **m** are the data chunks (shown in column "Data Chunks") and **k** are the parity chunks (shown in column "Parities"). The "Percent" and "Percent Encrypted" columns show percent of "parity overhead" cost increase from using erasure coding for normal and encrypted uploads respectively.
5658

@@ -152,6 +154,7 @@ To find the percent increase in cost for uploads of less than 128 chunks, refer
152154
| Paranoid | 86 | 35 | 245.7% | 17 | 505.9% |
153155
| Paranoid | 87 | 36 | 241.7% | 18 | 483.3% |
154156
| Paranoid | 89 | 37 | 240.5% | 18 | 494.4% |
157+
| Paranoid | 90 | 38 | 236.8% | 19 | 473.7% |
155158

156159
### Example Cost Calculation
157160

0 commit comments

Comments
 (0)