Skip to content

Commit aa1350f

Browse files
Merge pull request #4321 from jtraglia/markdown-line-wrap
Enforce 80-character line limit in all markdown files
2 parents b28ad47 + 03c4ea2 commit aa1350f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5050
-2466
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ MARKDOWN_FILES = $(CURDIR)/README.md \
184184

185185
# Check for mistakes.
186186
lint: pyspec
187-
@$(MDFORMAT_VENV) --number $(MARKDOWN_FILES)
187+
@$(MDFORMAT_VENV) --number --wrap=80 $(MARKDOWN_FILES)
188188
@$(CODESPELL_VENV) . --skip "./.git,$(VENV),$(PYSPEC_DIR)/.mypy_cache" -I .codespell-whitelist
189189
@$(PYTHON_VENV) -m black $(CURDIR)/tests
190190
@$(PYTHON_VENV) -m pylint --rcfile $(PYLINT_CONFIG) $(PYLINT_SCOPE)

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
[![testgen](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml/badge.svg?branch=dev&event=schedule)](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml)
55

66
This repository hosts the current Ethereum
7-
[proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/) specifications.
8-
Discussions about design rationale and proposed changes can be brought up and discussed as issues.
9-
Solidified, agreed-upon changes to the specifications can be made through pull requests.
7+
[proof-of-stake](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/)
8+
specifications. Discussions about design rationale and proposed changes can be
9+
brought up and discussed as issues. Solidified, agreed-upon changes to the
10+
specifications can be made through pull requests.
1011

1112
## Specifications
1213

13-
Core specifications for Ethereum proof-of-stake clients can be found in [specs](specs). These are
14-
divided into features. Features are researched and developed in parallel, and then consolidated into
15-
sequential upgrades when ready.
14+
Core specifications for Ethereum proof-of-stake clients can be found in
15+
[specs](specs). These are divided into features. Features are researched and
16+
developed in parallel, and then consolidated into sequential upgrades when
17+
ready.
1618

1719
### Stable Specifications
1820

@@ -39,8 +41,8 @@ sequential upgrades when ready.
3941

4042
### External specifications
4143

42-
Additional specifications and standards outside of requisite client functionality can be found in
43-
the following repositories:
44+
Additional specifications and standards outside of requisite client
45+
functionality can be found in the following repositories:
4446

4547
- [Beacon APIs](https://github.com/ethereum/beacon-apis)
4648
- [Engine APIs](https://github.com/ethereum/execution-apis/tree/main/src/engine)
@@ -49,11 +51,11 @@ the following repositories:
4951

5052
### Reference tests
5153

52-
Reference tests built from the executable Python spec are available in the [Ethereum Proof-of-Stake
53-
Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests) repository. Compressed
54-
tarballs are available for each release
55-
[here](https://github.com/ethereum/consensus-spec-tests/releases). Nightly reference tests are
56-
available
54+
Reference tests built from the executable Python spec are available in the
55+
[Ethereum Proof-of-Stake Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests)
56+
repository. Compressed tarballs are available for each release
57+
[here](https://github.com/ethereum/consensus-spec-tests/releases). Nightly
58+
reference tests are available
5759
[here](https://github.com/ethereum/consensus-specs/actions/workflows/generate_vectors.yml).
5860

5961
## Contributors
@@ -80,12 +82,16 @@ make help
8082

8183
### Design goals
8284

83-
The following are the broad design goals for the Ethereum proof-of-stake consensus specifications:
85+
The following are the broad design goals for the Ethereum proof-of-stake
86+
consensus specifications:
8487

8588
- Minimize complexity, even at the cost of some losses in efficiency.
86-
- Remain live through major network partitions and when very large portions of nodes go offline.
87-
- Select components that are quantum secure or easily swappable for quantum-secure alternatives.
88-
- Utilize crypto and design techniques that allow for a large participation of validators.
89+
- Remain live through major network partitions and when very large portions of
90+
nodes go offline.
91+
- Select components that are quantum secure or easily swappable for
92+
quantum-secure alternatives.
93+
- Utilize crypto and design techniques that allow for a large participation of
94+
validators.
8995
- Minimize hardware requirements such that a consumer laptop can participate.
9096

9197
### Useful resources

specs/_deprecated/custody_game/beacon-chain.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@
5252

5353
## Introduction
5454

55-
This document details the beacon chain additions and changes of to support the shard data custody game,
56-
building upon the [Sharding](../sharding/beacon-chain.md) specification.
55+
This document details the beacon chain additions and changes of to support the
56+
shard data custody game, building upon the
57+
[Sharding](../sharding/beacon-chain.md) specification.
5758

5859
## Constants
5960

@@ -219,7 +220,9 @@ class CustodyKeyReveal(Container):
219220

220221
#### `EarlyDerivedSecretReveal`
221222

222-
Represents an early (punishable) reveal of one of the derived secrets, where derived secrets are RANDAO reveals and custody reveals (both are part of the same domain).
223+
Represents an early (punishable) reveal of one of the derived secrets, where
224+
derived secrets are RANDAO reveals and custody reveals (both are part of the
225+
same domain).
223226

224227
```python
225228
class EarlyDerivedSecretReveal(Container):
@@ -251,7 +254,9 @@ def replace_empty_or_append(l: List, new_element: Any) -> int:
251254

252255
### `legendre_bit`
253256

254-
Returns the Legendre symbol `(a/q)` normalizes as a bit (i.e. `((a/q) + 1) // 2`). In a production implementation, a well-optimized library (e.g. GMP) should be used for this.
257+
Returns the Legendre symbol `(a/q)` normalizes as a bit (i.e.
258+
`((a/q) + 1) // 2`). In a production implementation, a well-optimized library
259+
(e.g. GMP) should be used for this.
255260

256261
```python
257262
def legendre_bit(a: int, q: int) -> int:
@@ -280,7 +285,8 @@ def legendre_bit(a: int, q: int) -> int:
280285

281286
### `get_custody_atoms`
282287

283-
Given one set of data, return the custody atoms: each atom will be combined with one legendre bit.
288+
Given one set of data, return the custody atoms: each atom will be combined with
289+
one legendre bit.
284290

285291
```python
286292
def get_custody_atoms(bytez: bytes) -> Sequence[bytes]:

specs/_deprecated/custody_game/validator.md

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,47 +19,77 @@
1919

2020
## Introduction
2121

22-
This is an accompanying document to [Custody Game -- The Beacon Chain](./beacon-chain.md), which describes the expected actions of a "validator"
23-
participating in the shard data Custody Game.
22+
This is an accompanying document to
23+
[Custody Game -- The Beacon Chain](./beacon-chain.md), which describes the
24+
expected actions of a "validator" participating in the shard data Custody Game.
2425

2526
## Prerequisites
2627

27-
This document is an extension of the [Sharding -- Validator](../sharding/validator.md). All behaviors and definitions defined in the Sharding doc carry over unless explicitly noted or overridden.
28+
This document is an extension of the
29+
[Sharding -- Validator](../sharding/validator.md). All behaviors and definitions
30+
defined in the Sharding doc carry over unless explicitly noted or overridden.
2831

29-
All terminology, constants, functions, and protocol mechanics defined in the [Custody Game -- The Beacon Chain](./beacon-chain.md)
30-
docs are requisite for this document and used throughout. Please see the Custody Game docs before continuing and use them as a reference throughout.
32+
All terminology, constants, functions, and protocol mechanics defined in the
33+
[Custody Game -- The Beacon Chain](./beacon-chain.md) docs are requisite for
34+
this document and used throughout. Please see the Custody Game docs before
35+
continuing and use them as a reference throughout.
3136

3237
## Becoming a validator
3338

34-
Becoming a validator in Custody Game is unchanged from Phase 0. See the [Phase 0 validator guide](../../phase0/validator.md#becoming-a-validator) for details.
39+
Becoming a validator in Custody Game is unchanged from Phase 0. See the
40+
[Phase 0 validator guide](../../phase0/validator.md#becoming-a-validator) for
41+
details.
3542

3643
## Beacon chain validator assignments
3744

38-
Beacon chain validator assignments to beacon committees and beacon block proposal are unchanged from Phase 0. See the [Phase 0 validator guide](../../phase0/validator.md#validator-assignments) for details.
45+
Beacon chain validator assignments to beacon committees and beacon block
46+
proposal are unchanged from Phase 0. See the
47+
[Phase 0 validator guide](../../phase0/validator.md#validator-assignments) for
48+
details.
3949

4050
##### Custody slashings
4151

42-
Up to `MAX_CUSTODY_SLASHINGS`, [`CustodySlashing`](./beacon-chain.md#custodyslashing) objects can be included in the `block`. The custody slashings must satisfy the verification conditions found in [custody slashings processing](beacon-chain.md#custody-slashings). The validator receives a small "whistleblower" reward for each custody slashing included (THIS IS NOT CURRENTLY THE CASE BUT PROBABLY SHOULD BE).
52+
Up to `MAX_CUSTODY_SLASHINGS`,
53+
[`CustodySlashing`](./beacon-chain.md#custodyslashing) objects can be included
54+
in the `block`. The custody slashings must satisfy the verification conditions
55+
found in [custody slashings processing](beacon-chain.md#custody-slashings). The
56+
validator receives a small "whistleblower" reward for each custody slashing
57+
included (THIS IS NOT CURRENTLY THE CASE BUT PROBABLY SHOULD BE).
4358

4459
##### Custody key reveals
4560

46-
Up to `MAX_CUSTODY_KEY_REVEALS`, [`CustodyKeyReveal`](./beacon-chain.md#custodykeyreveal) objects can be included in the `block`. The custody key reveals must satisfy the verification conditions found in [custody key reveal processing](beacon-chain.md#custody-key-reveals). The validator receives a small reward for each custody key reveal included.
61+
Up to `MAX_CUSTODY_KEY_REVEALS`,
62+
[`CustodyKeyReveal`](./beacon-chain.md#custodykeyreveal) objects can be included
63+
in the `block`. The custody key reveals must satisfy the verification conditions
64+
found in [custody key reveal processing](beacon-chain.md#custody-key-reveals).
65+
The validator receives a small reward for each custody key reveal included.
4766

4867
##### Early derived secret reveals
4968

50-
Up to `MAX_EARLY_DERIVED_SECRET_REVEALS`, [`EarlyDerivedSecretReveal`](./beacon-chain.md#earlyderivedsecretreveal) objects can be included in the `block`. The early derived secret reveals must satisfy the verification conditions found in [early derived secret reveal processing](beacon-chain.md#custody-key-reveals). The validator receives a small "whistleblower" reward for each early derived secret reveal included.
69+
Up to `MAX_EARLY_DERIVED_SECRET_REVEALS`,
70+
[`EarlyDerivedSecretReveal`](./beacon-chain.md#earlyderivedsecretreveal) objects
71+
can be included in the `block`. The early derived secret reveals must satisfy
72+
the verification conditions found in
73+
[early derived secret reveal processing](beacon-chain.md#custody-key-reveals).
74+
The validator receives a small "whistleblower" reward for each early derived
75+
secret reveal included.
5176

5277
#### Construct attestation
5378

54-
`attestation.data`, `attestation.aggregation_bits`, and `attestation.signature` are unchanged from Phase 0. But safety/validity in signing the message is premised upon calculation of the "custody bit" [TODO].
79+
`attestation.data`, `attestation.aggregation_bits`, and `attestation.signature`
80+
are unchanged from Phase 0. But safety/validity in signing the message is
81+
premised upon calculation of the "custody bit" [TODO].
5582

5683
## How to avoid slashing
5784

58-
Proposer and Attester slashings described in Phase 0 remain in place with the addition of the following.
85+
Proposer and Attester slashings described in Phase 0 remain in place with the
86+
addition of the following.
5987

6088
### Custody slashing
6189

62-
To avoid custody slashings, the attester must never sign any shard transition for which the custody bit is one. The custody bit is computed using the custody secret:
90+
To avoid custody slashings, the attester must never sign any shard transition
91+
for which the custody bit is one. The custody bit is computed using the custody
92+
secret:
6393

6494
```python
6595
def get_custody_secret(state: BeaconState,
@@ -75,5 +105,7 @@ def get_custody_secret(state: BeaconState,
75105
return bls.Sign(privkey, signing_root)
76106
```
77107

78-
Note that the valid custody secret is always the one for the **attestation target epoch**, not to be confused with the epoch in which the shard block was generated.
79-
While they are the same most of the time, getting this wrong at custody epoch boundaries would result in a custody slashing.
108+
Note that the valid custody secret is always the one for the **attestation
109+
target epoch**, not to be confused with the epoch in which the shard block was
110+
generated. While they are the same most of the time, getting this wrong at
111+
custody epoch boundaries would result in a custody slashing.

specs/_deprecated/das/das-core.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ def das_fft_extension(data: Sequence[Point]) -> Sequence[Point]:
9191

9292
### Data recovery
9393

94-
See [Reed-Solomon erasure code recovery in `n*log^2(n)` time with FFTs](https://ethresear.ch/t/reed-solomon-erasure-code-recovery-in-n-log-2-n-time-with-ffts/3039) for theory.
95-
Implementations:
94+
See
95+
[Reed-Solomon erasure code recovery in `n*log^2(n)` time with FFTs](https://ethresear.ch/t/reed-solomon-erasure-code-recovery-in-n-log-2-n-time-with-ffts/3039)
96+
for theory. Implementations:
9697

9798
- [Original Python](https://github.com/ethereum/research/blob/master/mimc_stark/recovery.py)
9899
- [New optimized approach in python](https://github.com/ethereum/research/tree/master/polynomial_reconstruction)

specs/_deprecated/das/fork-choice.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@
1111

1212
## Introduction
1313

14-
This document is the beacon chain fork choice spec for Data Availability Sampling. The only change that we add from phase 0 is that we add a concept of "data dependencies";
15-
a block is only eligible for consideration in the fork choice after a data availability test has been successfully completed for all dependencies.
16-
The "root" of a shard block for data dependency purposes is considered to be a `DataCommitment` object, which is a pair of a Kate commitment and a length.
14+
This document is the beacon chain fork choice spec for Data Availability
15+
Sampling. The only change that we add from phase 0 is that we add a concept of
16+
"data dependencies"; a block is only eligible for consideration in the fork
17+
choice after a data availability test has been successfully completed for all
18+
dependencies. The "root" of a shard block for data dependency purposes is
19+
considered to be a `DataCommitment` object, which is a pair of a Kate commitment
20+
and a length.
1721

1822
## Dependency calculation
1923

0 commit comments

Comments
 (0)