Skip to content

Commit fe6e1d6

Browse files
authored
Merge pull request #162 from daira/crosslink2
Crosslink 2
2 parents aabf489 + 11643ae commit fe6e1d6

40 files changed

+6099
-851
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
build/
22
src/**/*.generated.svg
33
result
4+
5+
*.swp
6+
*.save

README.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This repository is the source text and rendering configuration for the book. To
66

77
The `mdbook` tool renders the contents into a pretty format from `markdown` based source code
88

9-
## Github CI
9+
## GitHub CI
1010

11-
There are two github CI workflows:
11+
There are two GitHub CI workflows:
1212

13-
- `merge-acceptance.yaml`: triggers on `pull_request` to check that `mdbook build` succeeds and there aren't dangling `md` files (e.g. you remove an entry in `SUMMARY.md` but forget to rm the file.)
13+
- `merge-acceptance.yaml`: triggers on `pull_request` to check that `mdbook build` succeeds and there arent dangling `md` files (e.g. you remove an entry in `SUMMARY.md` but forget to rm the file.)
1414
- `render-site.yaml`: triggers on `push` to `main` to render the site to https://electric-coin-company.github.io/tfl-book/
15-
- **Warning:** this workflow relies on full read/write access to the `gh-pages` branch. Don't mess with that branch unless you're very confident in the impacts.
15+
- **Warning:** this workflow relies on full read/write access to the `gh-pages` branch. Dont mess with that branch unless you're very confident in the impacts.
1616

1717
## `git-hooks`
1818

@@ -46,38 +46,38 @@ Note: Nix users can rely on `flake.nix` which packages the final rendered HTML i
4646

4747
## Release Process
4848

49-
Releases are defined as distinct revisions that embody a consistent set of changes from the prior releases, identified by a version with `XXX.YYY.ZZZ` format. Releases serve a few purposes. They:
49+
Releases are defined as distinct revisions that embody a consistent set of changes from the prior releases, identified by a version with `XXX.YYY.ZZZ` format. Releases serve a few purposes. They
5050

51-
- ensure that readers can better notice changes or updates between readings or in discussions with others,
52-
- signify that the authors have converged after a period of editing onto a coherent integrated result,
53-
- signify an approximate maturity of the design, based on the version number, and
51+
- ensure that readers can better notice changes or updates between readings or in discussions with others;
52+
- signify that the authors have converged after a period of editing onto a coherent integrated result;
53+
- signify approximate maturity of the design, based on the version number; and
5454
- serve as a natural milestone for announcements on design updates.
5555

5656
### Versioning Schema
5757

58-
The versioning scheme isn't precise and roughly follows this rubrik:
58+
The versioning scheme isnt precise and roughly follows this rubrik:
5959

6060
When a version `X.Y.Z` increments, the scope of change since the prior release is implied by the new version:
6161

6262
- `<X+1>.0.0` - This release represents a complete, well analyzed design which the authors believe could be a suitable candidate for Zcash (or other crypto networks) to productionize by developing conforming implementations that activate in production.
6363
- `X.<Y+1>.0` - This release introduces or changes substantial design decisions or analyses, or it changes the presentation (such as the order or content of chapters) significantly. A reader of only the prior release may be missing essential details in understanding this new release.
64-
- `X.Y.<Z+1>` - This release improves the wording, layout, rendering, or other content in a manner that doesn't rise to the threshold of the previous case.
64+
- `X.Y.<Z+1>` - This release improves the wording, layout, rendering, or other content in a manner that doesnt rise to the threshold of the previous case.
6565

6666
### Release Process
6767

6868
To create a new release:
6969

7070
1. Decide that the `main` branch is in a coherent state without likely sources of confusion or self-inconsistency.
71-
2. Decide the new release's version as in [Versioning Schema](#versioning-schema) above.
71+
2. Decide the new releases version as in [Versioning Schema](#versioning-schema) above.
7272
3. Create a release branch named `release-<NEW VERSION>`.
7373
4. Update the release branch with these changes:
7474
- `book.toml`: Modify the `title` to end with `vX.Y.Z`. This ensures the version is visible to readers on all pages.
7575
- `src/version-history.md`: Introduce a new heading `## X.Y.Z - <RELEASE TITLE>` above all prior entries (i.e. reverse chronologically).
76-
- The `RELEASE TITLE` should be a short-hand title capturing the primary change of the release.
76+
- The `RELEASE TITLE` should be a shorthand title capturing the primary change of the release.
7777
- The release body should always begin with a link titled `Issue Tracking` that navigates to the GitHub milestone page of completed issues in this release.
7878
- The rest of the release body should be a one- to three-sentence summary of changes. Readers who need more detail can follow issue tracking.
79-
- `src/introduction.md`: The first paragraph says `This is <VERSION LINK> of the book.` Update that link to point to the new release's entry in `src/version-history.md`.
79+
- `src/introduction.md`: The first paragraph says `This is <VERSION LINK> of the book.` Update that link to point to the new releases entry in `src/version-history.md`.
8080
5. Submit those changes for GitHub pull-request review, resolve any blocking concerns, then merge to the `main` branch. Note: This step will render the release.
8181
6. Create a git tag on the git commit that merges into `main`: `git tag vX.Y.Z && git push --tags`
8282

83-
Note: We don't use GitHub "releases" since there's no release artifact other than the already published rendering.
83+
Note: We dont use GitHub "releases" since theres no release artifact other than the already published rendering.

book.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[book]
22
authors = [
33
"Nate Wilcox",
4-
"Daira Emma Hopwood",
4+
"Daira-Emma Hopwood",
55
]
66
language = "en"
77
multilingual = false
@@ -21,6 +21,8 @@ macros = "macros.txt"
2121
renderer = ["html"]
2222
# This is needed in order for \href and \url links to work.
2323
trust = true
24+
# Left-aligned displaymath
25+
fleqn = true
2426

2527
[output.html]
2628
default-theme = "light"

git-hooks/pre-commit

+4-16
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,14 @@
22
set -efuo pipefail
33

44
function main
5-
{
6-
log-run reject-unstaged-changes
7-
log-run require-render-success
8-
log-run ./util/find-orphaned-files.sh
9-
}
10-
11-
# Used to log which check is being executed, then execute it:
12-
function log-run
13-
{
14-
echo "$0: $1"
15-
eval "$@"
16-
}
17-
18-
function reject-unstaged-changes
195
{
206
if [ "$(unstaged-changes | wc -l)" -gt 0 ]
217
then
22-
echo 'Refusing to commit unstaged changes:'
8+
echo 'Warning: you have unstaged changes:'
239
unstaged-changes
24-
exit 1
10+
else
11+
require-render-success
12+
./util/find-orphaned-files.sh
2513
fi
2614
}
2715

macros.txt

+82-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,82 @@
1-
\yaykatex:{\mathsf{yay}\;\href{https://katex.org}{\KaTeX}}
1+
\TODO:\htmlStyle{background-color:yellow;color:black;}{\textsf{TODO:}}
2+
\typecolon:\mathrel{\raisebox{.3ex}{\tiny ⦂}}
3+
\intersection:\cap
4+
\union:\cup
5+
\trunc:\lceil
6+
\agrees:\preceq\hspace{-0.5em}\succeq
7+
\conflicts:\hspace{0.5em}\big/\hspace{-1.06em}\agrees
8+
\setof:\{\;#1\;\}
9+
\Origin:\mathcal{O}
10+
\dot:\mathsf{.}
11+
\null:\varnothing
12+
\tab:\hspace{2em}
13+
\gets:\leftarrow
14+
15+
\let:\text{let }
16+
\if:\text{if }
17+
\otherwise:\text{otherwise.}
18+
\then:\text{:}
19+
\else:\text{else:}
20+
\mut:\text{mut }
21+
\Time:\mathsf{Time}
22+
\Node:\mathsf{Node}
23+
\starchain:\star\textsf{-chain}
24+
\starblock:\star\textsf{-block}
25+
\LOG:\mathsf{LOG}
26+
\candidate:\mathsf{candidate}
27+
\snapshot:\mathsf{snapshot}
28+
\LF:\mathsf{LF}
29+
\snapshotlf:\snapshot(\LF(#1)\kern-0.1em)
30+
\checkpoint:\mathsf{checkpoint}
31+
\boolean:\mathsf{boolean}
32+
\true:\mathsf{true}
33+
\false:\mathsf{false}
34+
\len:\mathsf{len}
35+
\tailhead:\mathsf{tailhead}
36+
\proof:\mathsf{proof}
37+
\height:\mathsf{height}
38+
\score:\mathsf{score}
39+
\tip:\mathsf{tip}
40+
\besttip:\textsf{best-tip}
41+
\lastcommonancestor:\textsf{last-common-ancestor}
42+
\finalitydepth:\textsf{finality-depth}
43+
\bftlastfinal:\textsf{bft-last-final}
44+
\origbftlastfinal:\textsf{origbft-last-final}
45+
\bftblock:\textsf{bft-block}
46+
\bcblock:\textsf{bc-block}
47+
\bcchain:\textsf{bc-chain}
48+
\bcvalidchain:\textsf{bc-valid-chain}
49+
\bctransaction:\textsf{bc-transaction}
50+
\isstalledblock:\textsf{is-stalled-block}
51+
\iscoinbaseonlyblock:\textsf{is-coinbase-only-block}
52+
\updatefin:\textsf{update-fin}
53+
\headersbc:\mathsf{headers\_bc}
54+
\blockbc:\mathsf{block\_bc}
55+
\bcisforked:\mathsf{bc\_is\_forked}
56+
\contextbft:\mathsf{context\_bft}
57+
\consistent:\mathsf{consistent}
58+
\view:\mathsf{view}
59+
\lsf:\mathsf{lsf}
60+
\Score:\mathsf{Score}
61+
\Ch:\mathsf{Ch}
62+
\ch:\mathsf{ch}
63+
\localfin:\mathsf{fin}\kern0.04em
64+
\localba:\mathsf{ba}
65+
\candidate:\mathsf{candidate}
66+
\xlog:\mathsf{log}
67+
\GST:\mathsf{GST}
68+
\GAT:\mathsf{GAT}
69+
70+
\star:\mathrm{*}
71+
\starbft:\mathrm{*bft}
72+
\starbc:\mathrm{*bc}
73+
\origbft:\mathrm{origbft}
74+
\origbc:\mathrm{origbc}
75+
\bft:\mathrm{bft}
76+
\bc:\mathrm{bc}
77+
\lc:\mathrm{lc}
78+
79+
\confirm:\mathrm{lc}
80+
\fin:\mathrm{fin}
81+
\ba:\mathrm{ba}
82+
\da:\mathrm{da}

src/SUMMARY.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
- [Get Involved](./introduction/get-involved.md)
99
- [Terminology](./terminology.md)
1010
- [Design](./design.md)
11-
- [Overview](./design/overview.md)
12-
- [Design at a Glance](./design/overview/design-at-a-glance.md)
11+
- [Design at a Glance](./design/design-at-a-glance.md)
1312
- [Design Goals](./design/goals.md)
1413
- [Crosslink](./design/crosslink.md)
15-
- [The Arguments for Bounded Dynamic Availability and Finality Overrides](./design/crosslink/the-arguments-for-bounded-dynamic-availability-and-finality-overrides.md)
16-
- [Notes On Snap And Chat](./design/crosslink/notes-on-snap-and-chat.md)
17-
- [The Crosslink Construction](./design/crosslink/construction.md)
18-
- [Security Analysis of Crosslink](./design/crosslink/security-analysis.md)
14+
- [The Arguments for Bounded Availability and Finality Overrides](./design/crosslink/the-arguments-for-bounded-availability-and-finality-overrides.md)
15+
- [Notes On Snap‑and‑Chat](./design/crosslink/notes-on-snap-and-chat.md)
16+
- [The Crosslink 2 Construction](./design/crosslink/construction.md)
17+
- [Security Analysis of Crosslink 2](./design/crosslink/security-analysis.md)
1918
- [Questions About Crosslink](./design/crosslink/questions.md)
2019
- [Potential Changes to Crosslink](./design/crosslink/potential-changes.md)
2120
- [Model Code Architecture]()

src/design.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# Design
1+
# Design Overview
2+
3+
This design augments the existing Zcash Proof‑of‑Work (PoW) network with a new consensus layer which provides *trailing finality*, called the *Trailing Finality Layer (TFL)*.
4+
5+
This layer enables blocks produced via PoW to become *final* which ensures they may never be rolled back. This enables safer and simpler wallets and other infrastructure, and aids trust-minimized cross-chain bridges.
6+
7+
This consensus layer uses a finalizing *Proof-of-Stake (PoS)* consensus protocol, and enables ZEC holders to earn protocol rewards for contributing to the security of the Zcash network. By integrating a PoS layer with the current PoW Zcash protocol, this design specifies a *hybrid consensus protocol*.
8+
9+
The integration of the current PoW consensus with the TFL produces a new top-level consensus protocol referred to as *PoW+TFL*.
10+
11+
In the following subchapters we introduce the [Design at a Glance](./design/design-at-a-glance.md), then provide an overview of the major components of the design.
12+
13+
Following this overview chapter, we proceed into a detailed [Protocol Specification (TODO)]().
14+

src/design/crosslink.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Crosslink
22

3-
Crosslink is the proposed [hybrid construction](../terminology.md#definition-hybrid-construction) for the Trailing Finality Layer.
3+
Crosslink is the proposed [hybrid construction](../terminology.md#definition-hybrid-construction) for the Trailing Finality Layer. The current version is Crosslink 2.
44

55
## Contents
66

7-
- [The Arguments for Bounded Dynamic Availability and Finality Overrides](./crosslink/the-arguments-for-bounded-dynamic-availability-and-finality-overrides.md)
8-
- [Notes On Snap And Chat](./crosslink/notes-on-snap-and-chat.md)
9-
- [The Crosslink Construction](./crosslink/construction.md)
10-
- [Security Analysis of Crosslink](./crosslink/security-analysis.md)
7+
- [The Arguments for Bounded Availability and Finality Overrides](./crosslink/the-arguments-for-bounded-availability-and-finality-overrides.md)
8+
- [Notes On Snap‑and‑Chat](./crosslink/notes-on-snap-and-chat.md)
9+
- [The Crosslink 2 Construction](./crosslink/construction.md)
10+
- [Security Analysis of Crosslink 2](./crosslink/security-analysis.md)
1111
- [Questions About Crosslink](./crosslink/questions.md)
1212
- [Potential Changes to Crosslink](./crosslink/potential-changes.md)

0 commit comments

Comments
 (0)