Skip to content

Commit

Permalink
Update constant space factor
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljperry committed Aug 23, 2023
1 parent 798aa52 commit abc2cb4
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 4 deletions.
10 changes: 8 additions & 2 deletions docs/farming/pool-farming.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,14 @@ If it's your first time writing pool code, we recommend you look at established

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

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 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 / 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`.

:::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 netspace calculation?

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 abc2cb4

Please sign in to comment.