Skip to content

Commit

Permalink
Merge pull request #370 from Chia-Network/space_factor
Browse files Browse the repository at this point in the history
Update constant space factor
  • Loading branch information
danieljperry committed Aug 23, 2023
2 parents ae92edb + 7e70e22 commit dcae93a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
16 changes: 11 additions & 5 deletions docs/farming/pool-farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,20 @@ If it's your first time writing pool code, we recommend you look at established
- launcher_id: unique ID of the singleton.
- points: represent the amount of farming that a farmer has done. It is calculated by number of proofs submitted, weighted by difficulty. One k32 farms 10 points per day. To accumulate 1000 points you need 10 TiB farming for a day. This is equivalent to shares in PoW pools.

### How does one calculate a farmer's netspace?
### How does one calculate a farmer's space?

A farmer's netspace can be estimated by the number of points submitted over each unit of time, or points/second. Each k32 gets on average 10 points per day. So `10 / 86400 = 0.0001157 points/second` for each plot. Per byte, that is `L = 0.0001157 / 106364865085 = 1.088 * 10^-15`. To calculate total space `S`, take the total number of points found `P`, and the time period in seconds `T` and do `S = P / (L*T)`.
For example for 340 points in 6 hours, use `P=340, T=21600, L=1.088e-15`, `S = 340/(21600*1.088e-15) = 14465621651619 bytes`. Dividing by `1024^4` we get `13.15 TiB`.
A farmer's space can be estimated by the number of points submitted over each unit of time, or points/second. Each k32 gets on average 10 points per day. So `10 / 86400 = 0.0001157 points/second` for each plot. Per byte, that is `L = 0.0001157 / 108884400275 = 1.06259482265 * 10^-15`. To calculate total space `S`, take the total number of points found `P`, and the time period in seconds `T` and do `S = P / (L*T)`.
For example for 340 points in 6 hours, use `P=340, T=21600, L=1.06259482265e-15`, `S = 340/(21600*1.06259482265e-15) = 14,813,492,786,900 bytes`. Dividing by `1024^4` we get `13.4727932044 TiB`.

### How does difficulty affect farmer's netspace calculation?
:::info

Note that this calculation is based on the new constant space factor estimation of 0.78005, as detailed in the [space factor table](/k-sizes#new-constant-space-factor).

:::

### How does difficulty affect farmer's space calculation?

As difficulty goes up, a farmer does less lookups and finds less proofs, but does not receive more points per unit of time. Imagine this scenario: Obtaining 10 proofs a day with difficulty 1 for a k32, is equivalent to obtaining 1 proof a day with difficulty 10. As a pool server, you prefer to receive 1 proof a day per K32 with difficulty 10. This is why we allow pool servers to set a minimum difficulty level to reduce the number of proofs each farmer needs to send to prove their netspace.
As difficulty goes up, a farmer does less lookups and finds less proofs, but does not receive more points per unit of time. Imagine this scenario: Obtaining 10 proofs a day with difficulty 1 for a k32, is equivalent to obtaining 1 proof a day with difficulty 10. As a pool server, you prefer to receive 1 proof a day per K32 with difficulty 10. This is why we allow pool servers to set a minimum difficulty level to reduce the number of proofs each farmer needs to send to prove their space.

### How do you identify the farmer that submitted partial proofs?

Expand Down
8 changes: 7 additions & 1 deletion docs/resources/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ XCH is the currency symbol for Chia. TXCH is the currency symbol currently being

### What is k?

"k" is the space parameter that controls the size of plots. It is an integer for the following equation: `plot_size_bytes = C1 * 2^k(k + C2)` where C1 is constant 1 and C2 is constant 2. In practice this means that final size is roughly `((2 * k) + 1) * (2 ** (k - 1)) * 0.762` though that constant is estimated. You can examine the [Space Required section](https://www.chia.net/assets/Chia_Proof_of_Space_Construction_v1.1.pdf#page=15) of the [Chia Proof of Space Construction document](https://www.chia.net/assets/Chia_Proof_of_Space_Construction_v1.1.pdf) for the calculation of how much space is required for a given k.
"k" is the space parameter that controls the size of plots. It is an integer for the following equation: `plot_size_bytes = C1 * 2^k(k + C2)` where C1 is constant 1 and C2 is constant 2. In practice this means that final size is roughly `((2 * k) + 1) * (2 ** (k - 1)) * 0.78005` though that constant is estimated. You can examine the [Space Required section](https://www.chia.net/assets/Chia_Proof_of_Space_Construction_v1.1.pdf#page=15) of the [Chia Proof of Space Construction document](https://www.chia.net/assets/Chia_Proof_of_Space_Construction_v1.1.pdf) for the calculation of how much space is required for a given k.

:::note

Prior to Chia 2.0, the estimated space constant factor of 0.762 slightly incorrect. This led to a netspace calculation that was lower than the actual netspace. To correct this, we have [updated the constant factor](https://github.com/Chia-Network/chia-blockchain/pull/15771) to 0.78005.

:::

### How big are plot sizes (k)?

Expand Down
22 changes: 21 additions & 1 deletion docs/resources/k-sizes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ When planning on how much plotting space is required, only calculate the tempora

If stagger plotting, disk size requirement may change depending on which Phase the plotting is at.

## New constant space factor

For a given _k_, the plot size is roughly `((2 * k) + 1) * (2 ** (k - 1)) * 0.78005`.
In previous versions of Chia's documentation and code, the constant at the end of this equation was estimated to be 0.762.
Our documentation and code now use a closer estimation of 0.78005.

The following table shows the old size estimation of C0 plots, along with the new estimations:

| k | Old est. size (GB) | New est. size (GB) |
| -: | -----------------: | -----------------: |
| 32 | 106.3648651 | 108.8844003 |
| 33 | 219.2752603 | 224.469379 |
| 34 | 451.641581 | 462.339915 |
| 35 | 929.4652826 | 951.4821439 |
| 36 | 1911.294806 | 1956.568916 |
| 37 | 3927.318095 | 4020.347087 |
| 38 | 8064.093156 | 8255.112685 |
| 39 | 16547.10024 | 16939.06239 |


## Plots larger than k=32

Although not required, plots larger than k=32 may be created. There is not a great benefit to using larger plot sizes as the chance of winning is proportional to final plot file size. There are advanced tactics to using a larger `k` value to reduce unused storage space or optimize drive idle states, but these are not recommended for the majority of people
Although not required, plots larger than k=32 may be created. There is not a great benefit to using larger plot sizes as the chance of winning is proportional to final plot file size. There are advanced tactics to using a larger `k` value to reduce unused storage space or optimize drive idle states, but these are not recommended for the majority of people.

0 comments on commit dcae93a

Please sign in to comment.