Skip to content

Commit eba62db

Browse files
committed
Fix various nits
1 parent fd87b46 commit eba62db

Some content is hidden

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

80 files changed

+155
-152
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ Documentation on the different components used during spec writing can be found
8181

8282
Conformance tests built from the executable python spec are available in the [Ethereum Proof-of-Stake Consensus Spec Tests](https://github.com/ethereum/consensus-spec-tests) repo. Compressed tarballs are available in [releases](https://github.com/ethereum/consensus-spec-tests/releases).
8383

84-
8584
## Installation and Usage
8685
The consensus-specs repo can be used by running the tests locally or inside a docker container.
8786

docker/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
## Docker related information
22

33
This dockerfile sets up the dependencies required to run consensus-spec tests. The docker image can be locally built with:
4-
- `docker build ./ -t $IMAGE_NAME -f ./docker/Dockerfile`
54

5+
- `docker build ./ -t $IMAGE_NAME -f ./docker/Dockerfile`
66

77
Handy commands:
8+
89
- `docker run -it $IMAGE_NAME /bin/sh` will give you a shell inside the docker container to manually run any tests
910
- `docker run $IMAGE_NAME make test` will run the make test command inside the docker container
1011

@@ -13,6 +14,7 @@ Ideally manual running of docker containers is for advanced users, we recommend
1314
The `scripts/build_run_docker_tests.sh` script will cover most use cases. The script allows the user to configure the fork(altair/bellatrix/capella..), `$IMAGE_NAME` (specifies the container to use), preset type (mainnet/minimal), and test all forks flags. Ideally, this is the main way that users interact with the spec tests instead of running it locally with varying versions of dependencies.
1415

1516
E.g:
17+
1618
- `./build_run_docker_tests.sh --p mainnet` will run the mainnet preset tests
1719
- `./build_run_docker_tests.sh --a` will run all the tests across all the forks
1820
- `./build_run_docker_tests.sh --f deneb` will only run deneb tests

docs/docs/new-feature.md

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# How to add a new feature proposal in consensus-specs
22

3+
## Table of contents
4+
35
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
46
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5-
## Table of Contents
67

78
- [A. Make it executable for linter checks](#a-make-it-executable-for-linter-checks)
89
- [1. Create a folder under `./specs/_features`](#1-create-a-folder-under-specs_features)
@@ -23,7 +24,6 @@
2324

2425
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2526

26-
2727
## A. Make it executable for linter checks
2828

2929
### 1. Create a folder under `./specs/_features`
@@ -35,6 +35,7 @@ For example, if it's an `EIP-9999` CL spec, you can create a `./specs/_features/
3535
For example, if the latest fork is Capella, use `./specs/capella` content as your "previous fork".
3636

3737
### 3. Write down your proposed `beacon-chain.md` change
38+
3839
- You can either use [Beacon Chain Spec Template](./templates/beacon-chain-template.md), or make a copy of the latest fork content and then edit it.
3940
- Tips:
4041
- We use [`doctoc`](https://www.npmjs.com/package/doctoc) tool to generate the table of content.
@@ -50,8 +51,11 @@ For example, if the latest fork is Capella, use `./specs/capella` content as you
5051
- Use simple Python rather than the fancy Python dark magic.
5152

5253
### 4. Add `fork.md`
54+
5355
You can refer to the previous fork's `fork.md` file.
56+
5457
### 5. Make it executable
58+
5559
- Update Pyspec [`constants.py`](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/helpers/constants.py) with the new feature name.
5660
- Update helpers for [`setup.py`](https://github.com/ethereum/consensus-specs/blob/dev/setup.py) for building the spec:
5761
- Update [`pysetup/constants.py`](https://github.com/ethereum/consensus-specs/blob/dev/pysetup/constants.py) with the new feature name as Pyspec `constants.py` defined.
@@ -63,17 +67,21 @@ You can refer to the previous fork's `fork.md` file.
6367
## B: Make it executable for pytest and test generator
6468

6569
### 1. [Optional] Add `light-client/*` docs if you updated the content of `BeaconBlock`
70+
6671
- You can refer to the previous fork's `light-client/*` file.
6772
- Add the path of the new markdown files in [`pysetup/md_doc_paths.py`](https://github.com/ethereum/consensus-specs/blob/dev/pysetup/md_doc_paths.py)'s `get_md_doc_paths` function.
6873

6974
### 2. Add the mainnet and minimal presets and update the configs
75+
7076
- Add presets: `presets/mainnet/<new-feature-name>.yaml` and `presets/minimal/<new-feature-name>.yaml`
7177
- Update configs: `configs/mainnet.yaml` and `configs/minimal.yaml`
7278

7379
### 3. Update [`context.py`](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/context.py)
80+
7481
- [Optional] Add `with_<new-feature-name>_and_later` decorator for writing pytest cases. e.g., `with_capella_and_later`.
7582

7683
### 4. Update [`constants.py`](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/helpers/constants.py)
84+
7785
- Add `<NEW_FEATURE>` to `ALL_PHASES` and `TESTGEN_FORKS`
7886

7987
### 5. Update [`genesis.py`](https://github.com/ethereum/consensus-specs/blob/dev/tests/core/pyspec/eth2spec/test/helpers/genesis.py):
@@ -94,6 +102,7 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
94102
- If the given feature changes `ExecutionPayload` fields, you have to set the initial values by updating `get_sample_genesis_execution_payload_header` helper.
95103

96104
### 6. Update CI configurations
105+
97106
- Update [GitHub Actions config](https://github.com/ethereum/consensus-specs/blob/dev/.github/workflows/run-tests.yml)
98107
- Update `pyspec-tests.strategy.matrix.version` list by adding new feature to it
99108
- Update [CircleCI config](https://github.com/ethereum/consensus-specs/blob/dev/.circleci/config.yml)
@@ -102,7 +111,9 @@ def create_genesis_state(spec, validator_balances, activation_threshold):
102111
## Others
103112

104113
### Bonus
114+
105115
- Add `validator.md` if honest validator behavior changes with the new feature.
106116

107117
### Need help?
118+
108119
You can tag spec elves for cleaning up your PR. 🧚

docs/docs/templates/beacon-chain-template.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
# <FORK_NAME> -- The Beacon Chain
44

55
## Table of contents
6+
67
<!-- TOC -->
78
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
89
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
910

1011
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1112
<!-- /TOC -->
1213

13-
14-
1514
## Introduction
1615

1716
## Notation
@@ -28,7 +27,6 @@
2827

2928
## Preset
3029

31-
3230
### [CATEGORY OF PRESETS]
3331

3432
| Name | Value |
@@ -64,5 +62,4 @@ class CONTAINER_NAME(Container):
6462

6563
### Epoch processing
6664

67-
6865
### Block processing

fork_choice/safe-block.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Fork Choice -- Safe Block
22

33
## Table of contents
4+
45
<!-- TOC -->
56
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
67
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

solidity_deposit_contract/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ In August 2020, version `r2` was released with metadata modifications and relice
1414
## Compiling solidity deposit contract
1515

1616
In this directory run:
17+
1718
```sh
1819
make compile_deposit_contract
1920
```

specs/_features/custody_game/beacon-chain.md

-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
5656
<!-- /TOC -->
5757

58-
5958
## Introduction
6059

6160
This document details the beacon chain additions and changes of to support the shard data custody game,
@@ -101,7 +100,6 @@ building upon the [Sharding](../sharding/beacon-chain.md) specification.
101100
| `MAX_CUSTODY_CHUNK_CHALLENGE_RESPONSES` | `uint64(2**4)` (= 16) |
102101
| `MAX_CUSTODY_SLASHINGS` | `uint64(2**0)` (= 1) |
103102

104-
105103
### Size parameters
106104

107105
| Name | Value | Unit |
@@ -355,7 +353,6 @@ def get_custody_period_for_validator(validator_index: ValidatorIndex, epoch: Epo
355353
return (epoch + validator_index % EPOCHS_PER_CUSTODY_PERIOD) // EPOCHS_PER_CUSTODY_PERIOD
356354
```
357355

358-
359356
## Per-block processing
360357

361358
### Block processing

specs/_features/custody_game/validator.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Custody Game -- Honest Validator
22

33
**Notice**: This document is a work-in-progress for researchers and implementers.
4-
This is an accompanying document to [Custody Game -- The Beacon Chain](./beacon-chain.md), which describes the expected actions of a "validator"
5-
participating in the shard data Custody Game.
64

75
## Table of contents
86

@@ -24,9 +22,11 @@ participating in the shard data Custody Game.
2422
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2523
<!-- /TOC -->
2624

27-
2825
## Introduction
2926

27+
This is an accompanying document to [Custody Game -- The Beacon Chain](./beacon-chain.md), which describes the expected actions of a "validator"
28+
participating in the shard data Custody Game.
29+
3030
## Prerequisites
3131

3232
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.
@@ -58,7 +58,6 @@ Up to `MAX_EARLY_DERIVED_SECRET_REVEALS`, [`EarlyDerivedSecretReveal`](./beacon-
5858

5959
`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].
6060

61-
6261
## How to avoid slashing
6362

6463
Proposer and Attester slashings described in Phase 0 remain in place with the addition of the following.

specs/_features/das/das-core.md

-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2525
<!-- /TOC -->
2626

27-
2827
## Custom types
2928

3029
We define the following Python custom types for type hinting and readability:
@@ -33,7 +32,6 @@ We define the following Python custom types for type hinting and readability:
3332
| - | - | - |
3433
| `SampleIndex` | `uint64` | A sample index, corresponding to chunk of extended data |
3534

36-
3735
## Configuration
3836

3937
### Misc
@@ -42,7 +40,6 @@ We define the following Python custom types for type hinting and readability:
4240
| - | - | - |
4341
| `MAX_RESAMPLE_TIME` | `TODO` (= TODO) | Time window to sample a shard blob and put it on vertical subnets |
4442

45-
4643
## New containers
4744

4845
### `DASSample`

specs/_features/das/fork-choice.md

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1515
<!-- /TOC -->
1616

17-
1817
## Introduction
1918

2019
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";

specs/_features/das/p2p-interface.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ Since the messages are content-addressed (instead of origin-stamped),
9595
multiple publishers of the same samples on a vertical subnet do not hurt performance,
9696
but actually improve it by shortcutting regular propagation on the vertical subnet, and thus lowering the latency to a sample.
9797

98-
9998
### Vertical subnets
10099

101100
Vertical subnets propagate the samples to every peer that is interested.
@@ -161,7 +160,6 @@ Take `blob = signed_blob.blob`:
161160

162161
The [DAS participation spec](sampling.md#horizontal-subnets) outlines when and where to participate in DAS on horizontal subnets.
163162

164-
165163
#### Vertical subnets: `das_sample_{subnet_index}`
166164

167165
Shard blob samples can be verified with just a 48 byte KZG proof (commitment quotient polynomial),
@@ -185,7 +183,6 @@ The following validations MUST pass before forwarding the `sample` on the vertic
185183
Upon receiving a valid sample, it SHOULD be retained for a buffer period if the local node is part of the backbone that covers this sample.
186184
This is to serve other peers that may have missed it.
187185

188-
189186
## DAS in the Req-Resp domain: Pull
190187

191188
To pull samples from nodes, in case of network instability when samples are unavailable, a new query method is added to the Req-Resp domain.
@@ -201,13 +198,15 @@ Note that DAS networking uses a different protocol prefix: `/eth2/das/req`
201198
**Protocol ID:** `/eth2/das/req/query/1/`
202199

203200
Request Content:
201+
204202
```
205203
(
206204
sample_index: SampleIndex
207205
)
208206
```
209207

210208
Response Content:
209+
211210
```
212211
(
213212
DASSample

specs/_features/das/sampling.md

-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2323
<!-- /TOC -->
2424

25-
2625
## Data Availability Sampling
2726

2827
TODO: Summary of Data Availability problem
@@ -45,7 +44,6 @@ TODO
4544

4645
TODO
4746

48-
4947
### DAS during network instability
5048

5149
The GossipSub based retrieval of samples may not always work.

specs/_features/eip6800/beacon-chain.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# EIP6800 -- The Beacon Chain
22

3+
**Notice**: This document is a work-in-progress for researchers and implementers.
4+
35
## Table of contents
46

57
<!-- TOC -->

specs/_features/eip6800/fork.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# EIP-6800 -- Fork Logic
22

3+
**Notice**: This document is a work-in-progress for researchers and implementers.
4+
35
## Table of contents
46

7+
<!-- TOC -->
58
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
69
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
710

@@ -15,6 +18,7 @@
1518
- [Upgrading the state](#upgrading-the-state)
1619

1720
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
21+
<!-- /TOC -->
1822

1923
## Introduction
2024

@@ -29,7 +33,6 @@ Warning: this configuration is not definitive.
2933
| `EIP6800_FORK_VERSION` | `Version('0x05000000')` |
3034
| `EIP6800_FORK_EPOCH` | `Epoch(18446744073709551615)` **TBD** |
3135

32-
3336
## Helper functions
3437

3538
### Misc

specs/_features/eip6914/beacon-chain.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# EIP-6914 -- The Beacon Chain
22

3+
**Notice**: This document is a work-in-progress for researchers and implementers.
4+
35
## Table of contents
46

57
<!-- TOC -->

specs/_features/eip6914/fork-choice.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# EIP-6914 -- Fork Choice
22

3+
**Notice**: This document is a work-in-progress for researchers and implementers.
4+
35
## Table of contents
46

57
<!-- TOC -->

specs/_features/eip7732/beacon-chain.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# EIP-7732 -- The Beacon Chain
22

3+
**Notice**: This document is a work-in-progress for researchers and implementers.
4+
35
## Table of contents
46

57
<!-- TOC -->

specs/_features/eip7732/builder.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# EIP-7732 -- Honest Builder
22

3-
This is an accompanying document which describes the expected actions of a "builder" participating in the Ethereum proof-of-stake protocol.
3+
**Notice**: This document is a work-in-progress for researchers and implementers.
4+
5+
## Table of contents
46

7+
<!-- TOC -->
58
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
69
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
710

@@ -13,9 +16,12 @@ This is an accompanying document which describes the expected actions of a "buil
1316
- [Honest payload withheld messages](#honest-payload-withheld-messages)
1417

1518
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
19+
<!-- /TOC -->
1620

1721
## Introduction
1822

23+
This is an accompanying document which describes the expected actions of a "builder" participating in the Ethereum proof-of-stake protocol.
24+
1925
With the EIP-7732 Fork, the protocol includes new staked participants of the protocol called *Builders*. While Builders are a subset of the validator set, they have extra attributions that are optional. Validators may opt to not be builders and as such we collect the set of guidelines for those validators that want to act as builders in this document.
2026

2127
## Builders attributions
@@ -113,14 +119,17 @@ To construct the `execution_payload_envelope` the builder must perform the follo
113119
After setting these parameters, the builder should run `process_execution_payload(state, signed_envelope, verify=False)` and this function should not trigger an exception.
114120

115121
6. Set `state_root` to `hash_tree_root(state)`.
122+
116123
After preparing the `envelope` the builder should sign the envelope using:
124+
117125
```python
118126
def get_execution_payload_envelope_signature(
119127
state: BeaconState, envelope: ExecutionPayloadEnvelope, privkey: int) -> BLSSignature:
120128
domain = get_domain(state, DOMAIN_BEACON_BUILDER, compute_epoch_at_slot(state.slot))
121129
signing_root = compute_signing_root(envelope, domain)
122130
return bls.Sign(privkey, signing_root)
123131
```
132+
124133
The builder assembles then `signed_execution_payload_envelope = SignedExecutionPayloadEnvelope(message=envelope, signature=signature)` and broadcasts it on the `execution_payload` global gossip topic.
125134

126135
### Honest payload withheld messages

0 commit comments

Comments
 (0)