Skip to content

Commit 28a3fa8

Browse files
authored
docs: remove broken links and update references to proof of work. (#919)
1 parent 71f165d commit 28a3fa8

File tree

6 files changed

+91
-19
lines changed

6 files changed

+91
-19
lines changed

Diff for: docs/specs/beacon-chain.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143

144144
This document represents the specification for Phase 0 -- The Beacon Chain.
145145

146-
At the core of Ethereum proof-of-stake is a system chain called the "beacon chain". The beacon chain stores and manages the registry of validators. In the initial deployment phases of proof-of-stake, the only mechanism to become a validator is to make a one-way ETH transaction to a deposit contract on the Ethereum proof-of-work chain. Activation as a validator happens when deposit receipts are processed by the beacon chain, the activation balance is reached, and a queuing process is completed. Exit is either voluntary or done forcibly as a penalty for misbehavior.
146+
At the core of Ethereum proof-of-stake is a system chain called the "beacon chain". The beacon chain stores and manages the registry of validators. In the initial deployment phases of proof-of-stake, the only mechanism to become a validator is to make a one-way ETH transaction to a deposit contract on the Ethereum execution chain. Activation as a validator happens when deposit receipts are processed by the beacon chain, the activation balance is reached, and a queuing process is completed. Exit is either voluntary or done forcibly as a penalty for misbehavior.
147147
The primary source of load on the beacon chain is "attestations". Attestations are simultaneously availability votes for a shard block (in a later upgrade) and proof-of-stake votes for a beacon block (Phase 0).
148148

149149
## Notation
@@ -253,7 +253,7 @@ The following values are (non-configurable) constants used throughout the specif
253253

254254
*Note*: The below configuration is bundled as a preset: a bundle of configuration variables which are expected to differ
255255
between different modes of operation, e.g. testing, but not generally between different networks.
256-
Additional preset configurations can be found in the [`configs`](../../configs) directory.
256+
Additional preset configurations can be found in the `configs` directory.
257257

258258
### Misc
259259

@@ -416,7 +416,7 @@ Testnets and other types of chain instances may use a different configuration.
416416

417417
## Containers
418418

419-
The following types are [SimpleSerialize (SSZ)](../../ssz/simple-serialize.md) containers.
419+
The following types are SimpleSerialize (SSZ) containers.
420420

421421
*Note*: The definitions are ordered topologically to facilitate execution of the spec.
422422

@@ -993,7 +993,7 @@ def saturating_sub(a: int, b: int) -> int:
993993

994994
#### `hash_tree_root`
995995

996-
`def hash_tree_root(object: SSZSerializable) -> Root` is a function for hashing objects into a single root by utilizing a hash tree structure, as defined in the [SSZ spec](../../ssz/simple-serialize.md#merkleization).
996+
`def hash_tree_root(object: SSZSerializable) -> Root` is a function for hashing objects into a single root by utilizing a hash tree structure, as defined in the SSZ spec.
997997

998998
#### BLS signatures
999999

@@ -1860,13 +1860,13 @@ Modified in altair to use `MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX` instead of `
18601860

18611861
## Genesis
18621862

1863-
Before the Ethereum beacon chain genesis has been triggered, and for every Ethereum proof-of-work block, let `candidate_state = initialize_beacon_state_from_eth1(eth1_block_hash, eth1_timestamp, deposits)` where:
1863+
Before the Ethereum beacon chain genesis has been triggered, and for every Ethereum execution block, let `candidate_state = initialize_beacon_state_from_eth1(eth1_block_hash, eth1_timestamp, deposits)` where:
18641864

1865-
- `eth1_block_hash` is the hash of the Ethereum proof-of-work block
1865+
- `eth1_block_hash` is the hash of the Ethereum execution block
18661866
- `eth1_timestamp` is the Unix timestamp corresponding to `eth1_block_hash`
18671867
- `deposits` is the sequence of all deposits, ordered chronologically, up to (and including) the block with hash `eth1_block_hash`
18681868

1869-
Proof-of-work blocks must only be considered once they are at least `SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE` seconds old (i.e. `eth1_timestamp + SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE <= current_unix_time`). Due to this constraint, if `GENESIS_DELAY < SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE`, then the `genesis_time` can happen before the time/state is first known. Values should be configured to avoid this case.
1869+
execution blocks must only be considered once they are at least `SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE` seconds old (i.e. `eth1_timestamp + SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE <= current_unix_time`). Due to this constraint, if `GENESIS_DELAY < SECONDS_PER_ETH1_BLOCK * ETH1_FOLLOW_DISTANCE`, then the `genesis_time` can happen before the time/state is first known. Values should be configured to avoid this case.
18701870

18711871
```python
18721872
def initialize_beacon_state_from_eth1(eth1_block_hash: Hash32,

Diff for: docs/specs/deposit-contract.md

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Phase 0 -- Deposit Contract
2+
3+
## Table of contents
4+
<!-- TOC -->
5+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
6+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
7+
8+
- [Introduction](#introduction)
9+
- [Constants](#constants)
10+
- [Configuration](#configuration)
11+
- [Staking deposit contract](#staking-deposit-contract)
12+
- [`deposit` function](#deposit-function)
13+
- [Deposit amount](#deposit-amount)
14+
- [Withdrawal credentials](#withdrawal-credentials)
15+
- [`DepositEvent` log](#depositevent-log)
16+
- [Solidity code](#solidity-code)
17+
18+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
19+
<!-- /TOC -->
20+
21+
## Introduction
22+
23+
This document represents the specification for the beacon chain deposit contract, part of Phase 0.
24+
25+
## Constants
26+
27+
The following values are (non-configurable) constants used throughout the specification.
28+
29+
| Name | Value |
30+
| - | - |
31+
| `DEPOSIT_CONTRACT_TREE_DEPTH` | `2**5` (= 32) |
32+
33+
## Configuration
34+
35+
*Note*: The default mainnet configuration values are included here for spec-design purposes.
36+
The different configurations for mainnet, testnets, and YAML-based testing can be found in the `configs/constant_presets` directory.
37+
These configurations are updated for releases and may be out of sync during `dev` changes.
38+
39+
| Name | Value |
40+
| - | - |
41+
| `DEPOSIT_CHAIN_ID` | `1` |
42+
| `DEPOSIT_NETWORK_ID` | `1` |
43+
| `DEPOSIT_CONTRACT_ADDRESS` | `0x00000000219ab540356cBB839Cbe05303d7705Fa` |
44+
45+
## Staking deposit contract
46+
47+
The initial deployment phases of Ethereum proof-of-stake are implemented without consensus changes to the existing Ethereum execution chain. A deposit contract at address `DEPOSIT_CONTRACT_ADDRESS` is added to the Ethereum execution chain defined by the [chain-id](https://eips.ethereum.org/EIPS/eip-155) -- `DEPOSIT_CHAIN_ID` -- and the network-id -- `DEPOSIT_NETWORK_ID` -- for deposits of ETH to the beacon chain.
48+
49+
_Note_: See [here](https://chainid.network/) for a comprehensive list of public Ethereum chain chain-id's and network-id's.
50+
51+
### `deposit` function
52+
53+
The deposit contract has a public `deposit` function to make deposits. It takes as arguments `bytes calldata pubkey, bytes calldata withdrawal_credentials, bytes calldata signature, bytes32 deposit_data_root`. The first three arguments populate a [`DepositData`](./beacon-chain.md#depositdata) object, and `deposit_data_root` is the expected `DepositData` root as a protection against malformatted calldata.
54+
55+
#### Deposit amount
56+
57+
The amount of ETH (rounded down to the closest Gwei) sent to the deposit contract is the deposit amount, which must be of size at least `MIN_DEPOSIT_AMOUNT` Gwei.
58+
59+
#### Withdrawal credentials
60+
61+
One of the `DepositData` fields is `withdrawal_credentials` which constrains validator withdrawals.
62+
The first byte of this 32-byte field is a withdrawal prefix which defines the semantics of the remaining 31 bytes.
63+
The withdrawal prefixes currently supported are `BLS_WITHDRAWAL_PREFIX` and `ETH1_ADDRESS_WITHDRAWAL_PREFIX`.
64+
Read more in the [validator guide](./validator.md#withdrawal-credentials).
65+
66+
*Note*: The deposit contract does not validate the `withdrawal_credentials` field.
67+
Support for new withdrawal prefixes can be added without modifying the deposit contract.
68+
69+
#### `DepositEvent` log
70+
71+
Every deposit emits a `DepositEvent` log for consumption by the beacon chain. The deposit contract does little validation, pushing most of the validator onboarding logic to the beacon chain. In particular, the proof of possession (a BLS12-381 signature) is not verified by the deposit contract.
72+

Diff for: docs/specs/fork-choice.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Any of the above handlers that trigger an unhandled exception (e.g. a failed ass
8080

8181
1) **Leap seconds**: Slots will last `SECONDS_PER_SLOT + 1` or `SECONDS_PER_SLOT - 1` seconds around leap seconds. This is automatically handled by [UNIX time](https://en.wikipedia.org/wiki/Unix_time).
8282
2) **Honest clocks**: Honest nodes are assumed to have clocks synchronized within `SECONDS_PER_SLOT` seconds of each other.
83-
3) **Eth1 data**: The large `ETH1_FOLLOW_DISTANCE` specified in the [honest validator document](./validator.md) should ensure that `state.latest_eth1_data` of the canonical beacon chain remains consistent with the canonical Ethereum proof-of-work chain. If not, emergency manual intervention will be required.
83+
3) **Eth1 data**: The large `ETH1_FOLLOW_DISTANCE` specified in the [honest validator document](./validator.md) should ensure that `state.latest_eth1_data` of the canonical beacon chain remains consistent with the canonical Ethereum execution chain. If not, emergency manual intervention will be required.
8484
4) **Manual forks**: Manual forks may arbitrarily change the fork choice rule but are expected to be enacted at epoch transitions, with the fork details reflected in `state.fork`.
8585
5) **Implementation**: The implementation found in this specification is constructed for ease of understanding rather than for optimization in computation, space, or any other resource. A number of optimized alternatives can be found [here](https://github.com/protolambda/lmd-ghost).
8686

@@ -892,7 +892,7 @@ As per EIP-3675, before a post-transition block is finalized, `notify_forkchoice
892892
##### `safe_block_hash`
893893

894894
The `safe_block_hash` parameter MUST be set to return value of
895-
[`get_safe_execution_payload_hash(store: Store)`](../../fork_choice/safe-block.md#get_safe_execution_payload_hash) function.
895+
`get_safe_execution_payload_hash(store: Store)` function.
896896

897897
##### `should_override_forkchoice_update`
898898

Diff for: docs/specs/p2p-interface.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -840,15 +840,15 @@ Clients MUST treat as valid any byte sequences.
840840
The token of the negotiated protocol ID specifies the type of encoding to be used for the req/resp interaction.
841841
Only one value is possible at this time:
842842

843-
- `ssz_snappy`: The contents are first [SSZ-encoded](../../ssz/simple-serialize.md)
843+
- `ssz_snappy`: The contents are first SSZ-encoded
844844
and then compressed with [Snappy](https://github.com/google/snappy) frames compression.
845845
For objects containing a single field, only the field is SSZ-encoded not a container with a single field.
846846
For example, the `BeaconBlocksByRoot` request is an SSZ-encoded list of `Root`'s.
847847
This encoding type MUST be supported by all clients.
848848

849849
##### SSZ-snappy encoding strategy
850850

851-
The [SimpleSerialize (SSZ) specification](../../ssz/simple-serialize.md) outlines how objects are SSZ-encoded.
851+
The SimpleSerialize (SSZ) specification outlines how objects are SSZ-encoded.
852852

853853
To achieve snappy encoding on top of SSZ, we feed the serialized form of the object to the Snappy compressor on encoding.
854854
The inverse happens on decoding.

Diff for: docs/specs/validator.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ This is an accompanying document to [The Beacon Chain](./beacon-chain.md), which
7373

7474
## Introduction
7575

76-
This document represents the expected behavior of an "honest validator" with respect to Phase 0 of the Ethereum proof-of-stake protocol. This document does not distinguish between a "node" (i.e. the functionality of following and reading the beacon chain) and a "validator client" (i.e. the functionality of actively participating in consensus). The separation of concerns between these (potentially) two pieces of software is left as a design decision that is out of scope.
76+
This document represents the expected behavior of an "honest validator" of the Ethereum proof-of-stake protocol. This document does not distinguish between a "node" (i.e. the functionality of following and reading the beacon chain) and a "validator client" (i.e. the functionality of actively participating in consensus). The separation of concerns between these (potentially) two pieces of software is left as a design decision that is out of scope.
7777

7878
A validator is an entity that participates in the consensus of the Ethereum proof-of-stake protocol. This is an optional role for users in which they can post ETH as collateral and verify and attest to the validity of blocks to seek financial returns in exchange for building and securing the protocol. This is similar to proof-of-work networks in which miners provide collateral in the form of hardware/hash-power to seek returns in exchange for building and securing the protocol.
7979

@@ -84,7 +84,7 @@ Block proposers incorporate the (aggregated) sync committee signatures into each
8484

8585
## Prerequisites
8686

87-
All terminology, constants, functions, and protocol mechanics defined in the [The Beacon Chain](./beacon-chain.md) and [Deposit Contract](./deposit-contract.md) doc are requisite for this document and used throughout. Please see the Phase 0 doc before continuing and use as a reference throughout.
87+
All terminology, constants, functions, and protocol mechanics defined in the [The Beacon Chain](./beacon-chain.md) and [Deposit Contract](./deposit-contract.md) doc are requisite for this document and used throughout.
8888

8989
## Constants
9090

@@ -308,7 +308,7 @@ withdrawals to `eth1_withdrawal_address` will simply be increases to the account
308308

309309
### Submit deposit
310310

311-
In Phase 0, all incoming validator deposits originate from the Ethereum proof-of-work chain defined by `DEPOSIT_CHAIN_ID` and `DEPOSIT_NETWORK_ID`. Deposits are made to the [deposit contract](./deposit-contract.md) located at `DEPOSIT_CONTRACT_ADDRESS`.
311+
Deposits are made to the [deposit contract](./deposit-contract.md) located at `DEPOSIT_CONTRACT_ADDRESS`.
312312

313313
To submit a deposit:
314314

@@ -320,13 +320,13 @@ To submit a deposit:
320320
- Let `deposit_message` be a `DepositMessage` with all the `DepositData` contents except the `signature`.
321321
- Let `signature` be the result of `bls.Sign` of the `compute_signing_root(deposit_message, domain)` with `domain=compute_domain(DOMAIN_DEPOSIT)`. (*Warning*: Deposits *must* be signed with `GENESIS_FORK_VERSION`, calling `compute_domain` without a second argument defaults to the correct version).
322322
- Let `deposit_data_root` be `hash_tree_root(deposit_data)`.
323-
- Send a transaction on the Ethereum proof-of-work chain to `DEPOSIT_CONTRACT_ADDRESS` executing `def deposit(pubkey: bytes[48], withdrawal_credentials: bytes[32], signature: bytes[96], deposit_data_root: bytes32)` along with a deposit of `amount` Gwei.
323+
- Send a transaction on the Ethereum execution chain to `DEPOSIT_CONTRACT_ADDRESS` executing `def deposit(pubkey: bytes[48], withdrawal_credentials: bytes[32], signature: bytes[96], deposit_data_root: bytes32)` along with a deposit of `amount` Gwei.
324324

325325
*Note*: Deposits made for the same `pubkey` are treated as for the same validator. A singular `Validator` will be added to `state.validators` with each additional deposit amount added to the validator's balance. A validator can only be activated when total deposits for the validator pubkey meet or exceed `MAX_EFFECTIVE_BALANCE`.
326326

327327
### Process deposit
328328

329-
Deposits cannot be processed into the beacon chain until the proof-of-work block in which they were deposited or any of its descendants is added to the beacon chain `state.eth1_data`. This takes *a minimum* of `ETH1_FOLLOW_DISTANCE` Eth1 blocks (~8 hours) plus `EPOCHS_PER_ETH1_VOTING_PERIOD` epochs (~6.8 hours). Once the requisite proof-of-work block data is added, the deposit will normally be added to a beacon chain block and processed into the `state.validators` within an epoch or two. The validator is then in a queue to be activated.
329+
Deposits cannot be processed into the beacon chain until the execution block in which they were deposited or any of its descendants is added to the beacon chain `state.eth1_data`. This takes *a minimum* of `ETH1_FOLLOW_DISTANCE` Eth1 blocks (~8 hours) plus `EPOCHS_PER_ETH1_VOTING_PERIOD` epochs (~6.8 hours). Once the requisite execution block data is added, the deposit will normally be added to a beacon chain block and processed into the `state.validators` within an epoch or two. The validator is then in a queue to be activated.
330330

331331
### Validator index
332332

@@ -605,7 +605,7 @@ Up to `MAX_ATTESTATIONS`, aggregate attestations can be included in the `block`.
605605

606606
If there are any unprocessed deposits for the existing `state.eth1_data` (i.e. `state.eth1_data.deposit_count > state.eth1_deposit_index`), then pending deposits *must* be added to the block. The expected number of deposits is exactly `min(MAX_DEPOSITS, eth1_data.deposit_count - state.eth1_deposit_index)`. These [`deposits`](./beacon-chain.md#deposit) are constructed from the `Deposit` logs from the [deposit contract](./deposit-contract.md) and must be processed in sequential order. The deposits included in the `block` must satisfy the verification conditions found in [deposits processing](./beacon-chain.md#deposits).
607607

608-
The `proof` for each deposit must be constructed against the deposit root contained in `state.eth1_data` rather than the deposit root at the time the deposit was initially logged from the proof-of-work chain. This entails storing a full deposit merkle tree locally and computing updated proofs against the `eth1_data.deposit_root` as needed. See [`minimal_merkle.py`](https://github.com/ethereum/research/blob/master/spec_pythonizer/utils/merkle_minimal.py) for a sample implementation.
608+
The `proof` for each deposit must be constructed against the deposit root contained in `state.eth1_data` rather than the deposit root at the time the deposit was initially logged from the execution chain. This entails storing a full deposit merkle tree locally and computing updated proofs against the `eth1_data.deposit_root` as needed. See [`minimal_merkle.py`](https://github.com/ethereum/research/blob/master/spec_pythonizer/utils/merkle_minimal.py) for a sample implementation.
609609

610610
##### Voluntary exits
611611

@@ -1151,7 +1151,7 @@ def get_contribution_and_proof_signature(state: BeaconState,
11511151

11521152
## How to avoid slashing
11531153

1154-
"Slashing" is the burning of some amount of validator funds and immediate ejection from the active validator set. In Phase 0, there are two ways in which funds can be slashed: [proposer slashing](#proposer-slashing) and [attester slashing](#attester-slashing). Although being slashed has serious repercussions, it is simple enough to avoid being slashed all together by remaining *consistent* with respect to the messages a validator has previously signed.
1154+
"Slashing" is the burning of some amount of validator funds and immediate ejection from the active validator set. There are two ways in which funds can be slashed: [proposer slashing](#proposer-slashing) and [attester slashing](#attester-slashing). Although being slashed has serious repercussions, it is simple enough to avoid being slashed all together by remaining *consistent* with respect to the messages a validator has previously signed.
11551155

11561156
*Note*: Signed data must be within a sequential `Fork` context to conflict. Messages cannot be slashed across diverging forks. If the previous fork version is 1 and the chain splits into fork 2 and 102, messages from 1 can be slashable against messages in forks 1, 2, and 102. Messages in 2 cannot be slashable against messages in 102, and vice versa.
11571157

Diff for: native/ssz_nif/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ After implementing everything, check that spec-tests pass by running `make spec-
2727

2828
## Containers with constants
2929

30-
Some SSZ containers depend on variable configuration, for example `HistoricalBatch`. In these cases, we should implement the functionality for the "minimal" and "mainnet" presets, and map the test handlers with their corresponding structs inside the config modules from [`test/spec/configs`](../../test/spec/configs).
30+
Some SSZ containers depend on variable configuration, for example `HistoricalBatch`. In these cases, we should implement the functionality for the "minimal" and "mainnet" presets, and map the test handlers with their corresponding structs inside the config modules from `test/spec/configs`.

0 commit comments

Comments
 (0)