8000 fix: fix katex shortcode and EC, leader election and Poisson sortitio… · filecoin-project/specs@8bf3e43 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 8bf3e43

Browse files
fix: fix katex shortcode and EC, leader election and Poisson sortition update (#1066)
This PR is applying all the latest changes in the Expected Consensus, Leader Election and the rationale behind Poisson Sortition of WinCount. It builds on top of the changes merged from #967 Tooling: - katex shortcode documented and working - markdown linter actually fails now Co-authored-by: Hugo Dias <hugomrdias@gmail.com>
1 parent d2f3a5b commit 8bf3e43

File tree

10 files changed

+304
-64
lines changed

10 files changed

+304
-64
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[{*.yml}]
12+
indent_style = space
13+
indent_size = 2
14+
15+
[*.md]
16+
indent_style = space
17+
indent_size = 2
18+
trim_trailing_whitespace = false

.remarkrc.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins:
22
# make remark aware of fontmatter.
33
remark-frontmatter:
4+
remark-math:
45
# sensible linter defaults see: https://github.com/remarkjs/remark-lint/tree/main/packages/remark-preset-lint-recommended#rules
56
remark-preset-lint-recommended:
67
# add extra rules
@@ -12,4 +13,4 @@ plugins:
1213
remark-lint-list-item-indent: false
1314
remark-lint-final-newline: false
1415
remark-lint-no-literal-urls: false
15-
remark-lint-list-item-bullet-indent: false
16+
remark-lint-list-item-bullet-indent: false

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,22 @@ stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
231231
{{< /hint >}}
232232
```
233233

234+
### `katex`
235+
236+
```md
237+
238+
<!-- Use $$ math $$ for display mode-->
239+
{{<katex>}}
240+
$$SectorInitialConsensusPledge = \\[0.2cm] 30\% \times FILCirculatingSupply \times \frac{SectorQAP}{max(NetworkBaseline, NetworkQAP)}$$
241+
{{</katex >}}
242+
243+
244+
<!-- Use $ math $ for inline mode-->
245+
{{<katex>}}
246+
$SectorInitialConsensusPledge = \\[0.2cm] 30\% \times FILCirculatingSupply \times \frac{SectorQAP}{max(NetworkBaseline, NetworkQAP)}$
247+
{{</katex >}}
248+
```
249+
234250
## Math mode
235251

236252
For short snippets of math text you can just use the `{{<katex>}}` shortcode, but if you need to write lots of math in a page you can just use `math-mode` and avoid writting the katex shortcode everywhere.
@@ -380,4 +396,4 @@ hugo mod get github.com/filecoin-project/specs-actors@v0.7.2
380396
- [config](https://github.com/mermaid-js/mermaid/blob/master/docs/mermaidAPI.md#mermaidapi-configuration-defaults)
381397
- [editor](https://mermaid-js.github.io/mermaid-live-editor)
382398
- [Pan/Zoom for SVG](https://github.com/anvaka/panzoom)
383-
- [Icons](https://css.gg/)
399+
- [Icons](https://css.gg/)

content/algorithms/expected_consensus/_index.md

Lines changed: 259 additions & 43 deletions
Large diffs are not rendered by default.

content/systems/filecoin_files/piece/_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dashboardTests: 0
99
---
1010

1111
# The Filecoin Piece
12-
---
1312

1413
The _Filecoin Piece_ is the main _unit of negotiation_ for data that users store on the Filecoin network. The Filecoin Piece is _not a unit of storage_, it is not of a specific size, but is upper-bounded by the size of the _Sector_. A Filecoin Piece can be of any size, but if a Piece is larger than the size of a Sector that the miner supports it has to be split into more Pieces so that each Piece fits into a Sector.
1514

content/systems/filecoin_markets/onchain_storage_market/storage_market_actor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ This collateral is returned to the storage provider when all deals in the sector
2929

3030

3131
{{<katex>}}
32-
MinimumProviderDealCollateral = \\[0.2cm] \ \ \ \ \ \ \ \ 5\% \times FILCirculatingSupply \times \frac{DealRawByte}{max(NetworkBaseline, NetworkRawBytePower)}
32+
$MinimumProviderDealCollateral = \\[0.2cm] \ \ \ \ \ \ \ \ 5\% \times FILCirculatingSupply \times \frac{DealRawByte}{max(NetworkBaseline, NetworkRawBytePower)}$
3333
{{</katex>}}

content/systems/filecoin_mining/miner_collaterals.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ Hence, the initial pledge function consists of two components: a _storage pledge
2424

2525
{{<katex>}}
2626

27-
SectorInitialPledge = SectorInitialStoragePledge + SectorInitialConsensusPledge \\[0.3cm]
27+
$$SectorInitialPledge = SectorInitialStoragePledge + SectorInitialConsensusPledge \\[0.3cm]$$
2828

2929
{{</katex>}}
3030

3131
The storage pledge protects the networkʼs quality-of-service for clients by providing starting collateral for the sector in the event of slashing. The storage pledge must be small enough to be feasible for miners joining the network, and large enough to collateralize storage against early faults, penalties, and fees. The vesting of block rewards and the use of unvested rewards as additional collateral reduces initial storage pledge without compromising the incentive alignment of the network. This is discussed in more depth in the following subsection. A balance is achieved by using an initial storage pledge amount approximately sufficient to cover 7 days worth of Sector fault fee and 1 Sector fault detection fee. This is denominated in the number of days of future rewards that a sector is expected to earn.
3232

3333
{{<katex>}}
3434

35-
SectorInitialStoragePledge = Estimated20DaysSectorBlockReward \\[0.3cm]
35+
$$SectorInitialStoragePledge = Estimated20DaysSectorBlockReward \\[0.3cm]$$
3636

3737
{{</katex>}}
3838

3939
Since the storage pledge per sector is based on the expected block reward that sector will win, the storage pledge is independent of the networkʼs total storage. As a result, the total network storage pledge depends solely on future block reward. Thus, while the storage pledge provides a clean way to reason about the rationality of adding a sector, it does not provide sufficient long-term security guarantees to the network, making consensus takeovers less costly as the block reward decreases. As such, the second half of the initial pledge function, the consensus pledge, depends on both the amount of quality-adjusted power (QAP) added by the sector and the network circulating supply. The network targets approximately 30% of the network's circulating supply locked up in initial consensus pledge when it is at or above the baseline. This is achieved with a small pledge share allocated to sectors based on their share of the networkʼs quality-adjusted power. Given an exponentially growing baseline, initial pledge per unit QAP should decrease over time, as should other mining costs.
4040

4141
{{<katex>}}
4242

43-
SectorInitialConsensusPledge = \\[0.2cm] 30\% \times FILCirculatingSupply \times \frac{SectorQAP}{max(NetworkBaseline, NetworkQAP)}
43+
$$SectorInitialConsensusPledge = \\[0.2cm] 30\% \times FILCirculatingSupply \times \frac{SectorQAP}{max(NetworkBaseline, NetworkQAP)}$$
4444

4545
{{</katex>}}
4646

@@ -56,4 +56,4 @@ In general, fault fees are slashed first from the soonest-to-vest unvested block
5656

5757
## Storage Deal Collateral
5858

59-
The third form of collateral is provided by the storage provider to collateralize deals. See the [Storage Market Actor](storage_market_actor) for further details on the Storage Deal Collateral.
59+
The third form of collateral is provided by the storage provider to collateralize deals. See the [Storage Market Actor](storage_market_actor) for further details on the Storage Deal Collateral.

content/systems/filecoin_mining/sector/_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ dashboardTests: 0
99
---
1010

1111
# Sector
12-
---
1312

1413
Sectors are the basic units of storage on Filecoin. They have standard sizes, as well as well-defined time-increments for commitments. The size of a sector balances security concerns against usability. A sectorʼs lifetime is determined in the storage market, and sets the promised duration of the sector.
1514

layouts/shortcodes/katex.html

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
{{- if not (.Page.Scratch.Get "katex") -}}
2-
<!-- Include katext only first time -->
3-
<link rel="stylesheet" href="{{ "katex/katex.min.css" | relURL }}" />
4-
<script defer src="{{ "katex/katex.min.js" | relURL }}"></script>
5-
<script defer src="{{ "katex/auto-render.min.js" | relURL }}" class=pl-s>renderMathInElement(document.body);"></script>
6-
{{- .Page.Scratch.Set "katex" true -}}
7-
{{- end -}}
8-
9-
<span {{- with .Get "class" }} class="{{ . }}"{{ end }}>
10-
{{ cond (in .Params "display") "\\[" "\\(" -}}
1+
<span class="math-mode">
112
{{- trim .Inner "\n" -}}
12-
{{- cond (in .Params "display") "\\]" "\\)" }}
133
</span>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "The Filecoin protocol specification",
55
"main": "index.js",
66
"scripts": {
7-
"test": "remark content --quiet",
7+
"test": "remark content --frail --quiet",
88
"start": "concurrently npm:watch-*",
99
"serve": "npm start",
1010
"watch-hugo": "npm run build-diagrams && hugo server --bind=0.0.0.0 --disableFastRender --renderToDisk",
@@ -44,6 +44,7 @@
4444
"remark-lint-heading-increment": "^2.0.1",
4545
"remark-lint-no-hr-after-heading": "^1.0.0",
4646
"remark-lint-no-multiple-toplevel-headings": "^2.0.1",
47+
"remark-math": "^3.0.1",
4748
"remark-preset-lint-recommended": "^4.0.1",
4849
"remark-toc": "^7.0.0",
4950
"to-vfile": "^6.1.0"

0 commit comments

Comments
 (0)
0