Minor copyediting corrections to 0_beacon-chain.md
A handful of minor editing changes made to non-code text for the purposes of improved clarity, consistency, and accuracy.
This commit is contained in:
parent
c978bb4a67
commit
b5bf56376b
|
@ -1,6 +1,6 @@
|
||||||
# Ethereum 2.0 Phase 0 -- The Beacon Chain
|
# Ethereum 2.0 Phase 0 -- The Beacon Chain
|
||||||
|
|
||||||
**NOTICE**: This document is a work-in-progress for researchers and implementers. It reflects recent spec changes and takes precedence over the Python proof-of-concept implementation [[python-poc]](#ref-python-poc).
|
**NOTICE**: This document is a work in progress for researchers and implementers. It reflects recent spec changes and takes precedence over the Python proof-of-concept implementation [[python-poc]](#ref-python-poc).
|
||||||
|
|
||||||
## Table of contents
|
## Table of contents
|
||||||
<!-- TOC -->
|
<!-- TOC -->
|
||||||
|
@ -149,9 +149,9 @@
|
||||||
|
|
||||||
This document represents the specification for Phase 0 of Ethereum 2.0 -- The Beacon Chain.
|
This document represents the specification for Phase 0 of Ethereum 2.0 -- The Beacon Chain.
|
||||||
|
|
||||||
At the core of Ethereum 2.0 is a system chain called the "beacon chain". The beacon chain stores and manages the registry of [validators](#dfn-validator). In the initial deployment phases of Ethereum 2.0 the only mechanism to become a [validator](#dfn-validator) is to make a one-way ETH transaction to a deposit contract on Ethereum 1.0. Activation as a [validator](#dfn-validator) happens when Ethereum 1.0 deposit receipts are processed by the beacon chain, the activation balance is reached, and after a queuing process. Exit is either voluntary or done forcibly as a penalty for misbehavior.
|
At the core of Ethereum 2.0 is a system chain called the "beacon chain". The beacon chain stores and manages the registry of [validators](#dfn-validator). In the initial deployment phases of Ethereum 2.0, the only mechanism to become a [validator](#dfn-validator) is to make a one-way ETH transaction to a deposit contract on Ethereum 1.0. Activation as a [validator](#dfn-validator) happens when Ethereum 1.0 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.
|
||||||
|
|
||||||
The primary source of load on the beacon chain is "attestations". Attestations are availability votes for a shard block, and simultaneously proof of stake votes for a beacon block. A sufficient number of attestations for the same shard block create a "crosslink", confirming the shard segment up to that shard block into the beacon chain. Crosslinks also serve as infrastructure for asynchronous cross-shard communication.
|
The primary source of load on the beacon chain is "attestations". Attestations are simultaneously availability votes for a shard block and proof-of-stake votes for a beacon block. A sufficient number of attestations for the same shard block create a "crosslink", confirming the shard segment up to that shard block into the beacon chain. Crosslinks also serve as infrastructure for asynchronous cross-shard communication.
|
||||||
|
|
||||||
## Notation
|
## Notation
|
||||||
|
|
||||||
|
@ -159,20 +159,20 @@ Code snippets appearing in `this style` are to be interpreted as Python code.
|
||||||
|
|
||||||
## Terminology
|
## Terminology
|
||||||
|
|
||||||
* **Validator** <a id="dfn-validator"></a> - a registered participant in the beacon chain. You can become one by sending Ether into the Ethereum 1.0 deposit contract.
|
* **Validator** <a id="dfn-validator"></a> - a registered participant in the beacon chain. You can become one by sending ether into the Ethereum 1.0 deposit contract.
|
||||||
* **Active validator** <a id="dfn-active-validator"></a> - an active participant in the Ethereum 2.0 consensus invited to, among other things, propose and attest to blocks and vote for crosslinks.
|
* **Active validator** <a id="dfn-active-validator"></a> - an active participant in the Ethereum 2.0 consensus invited to, among other things, propose and attest to blocks and vote for crosslinks.
|
||||||
* **Committee** - a (pseudo-) randomly sampled subset of [active validators](#dfn-active-validator). When a committee is referred to collectively, as in "this committee attests to X", this is assumed to mean "some subset of that committee that contains enough [validators](#dfn-validator) that the protocol recognizes it as representing the committee".
|
* **Committee** - a (pseudo-) randomly sampled subset of [active validators](#dfn-active-validator). When a committee is referred to collectively, as in "this committee attests to X", this is assumed to mean "some subset of that committee that contains enough [validators](#dfn-validator) that the protocol recognizes it as representing the committee".
|
||||||
* **Proposer** - the [validator](#dfn-validator) that creates a beacon chain block
|
* **Proposer** - the [validator](#dfn-validator) that creates a beacon chain block.
|
||||||
* **Attester** - a [validator](#dfn-validator) that is part of a committee that needs to sign off on a beacon chain block while simultaneously creating a link (crosslink) to a recent shard block on a particular shard chain.
|
* **Attester** - a [validator](#dfn-validator) that is part of a committee that needs to sign off on a beacon chain block while simultaneously creating a link (crosslink) to a recent shard block on a particular shard chain.
|
||||||
* **Beacon chain** - the central PoS chain that is the base of the sharding system.
|
* **Beacon chain** - the central PoS chain that is the base of the sharding system.
|
||||||
* **Shard chain** - one of the chains on which user transactions take place and account data is stored.
|
* **Shard chain** - one of the chains on which user transactions take place and account data is stored.
|
||||||
* **Block root** - a 32-byte Merkle root of a beacon chain block or shard chain block. Previously called "block hash".
|
* **Block root** - a 32-byte Merkle root of a beacon chain block or shard chain block. Previously called "block hash".
|
||||||
* **Crosslink** - a set of signatures from a committee attesting to a block in a shard chain, which can be included into the beacon chain. Crosslinks are the main means by which the beacon chain "learns about" the updated state of shard chains.
|
* **Crosslink** - a set of signatures from a committee attesting to a block in a shard chain that can be included into the beacon chain. Crosslinks are the main means by which the beacon chain "learns about" the updated state of shard chains.
|
||||||
* **Slot** - a period during which one proposer has the ability to create a beacon chain block and some attesters have the ability to make attestations
|
* **Slot** - a period during which one proposer has the ability to create a beacon chain block and some attesters have the ability to make attestations.
|
||||||
* **Epoch** - an aligned span of slots during which all [validators](#dfn-validator) get exactly one chance to make an attestation
|
* **Epoch** - an aligned span of slots during which all [validators](#dfn-validator) get exactly one chance to make an attestation.
|
||||||
* **Finalized**, **justified** - see Casper FFG finalization [[casper-ffg]](#ref-casper-ffg)
|
* **Finalized**, **justified** - see Casper FFG finalization [[casper-ffg]](#ref-casper-ffg).
|
||||||
* **Withdrawal period** - the number of slots between a [validator](#dfn-validator) exit and the [validator](#dfn-validator) balance being withdrawable
|
* **Withdrawal period** - the number of slots between a [validator](#dfn-validator) exit and the [validator](#dfn-validator) balance being withdrawable.
|
||||||
* **Genesis time** - the Unix time of the genesis beacon chain block at slot 0
|
* **Genesis time** - the Unix time of the genesis beacon chain block at slot 0.
|
||||||
|
|
||||||
## Constants
|
## Constants
|
||||||
|
|
||||||
|
@ -871,7 +871,7 @@ def compute_committee(validator_indices: List[ValidatorIndex],
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
**Note**: this definition and the next few definitions are highly inefficient as algorithms as they re-calculate many sub-expressions. Production implementations are expected to appropriately use caching/memoization to avoid redoing work.
|
**Note**: this definition and the next few definitions are highly inefficient as algorithms, as they re-calculate many sub-expressions. Production implementations are expected to appropriately use caching/memoization to avoid redoing work.
|
||||||
|
|
||||||
### `get_current_epoch_committee_count`
|
### `get_current_epoch_committee_count`
|
||||||
|
|
||||||
|
@ -1426,7 +1426,7 @@ Every Ethereum 1.0 deposit, of size between `MIN_DEPOSIT_AMOUNT` and `MAX_DEPOSI
|
||||||
|
|
||||||
### `Eth2Genesis` log
|
### `Eth2Genesis` log
|
||||||
|
|
||||||
When sufficiently many full deposits have been made the deposit contract emits the `Eth2Genesis` log. The beacon chain state may then be initialized by calling the `get_genesis_beacon_state` function (defined below) where:
|
When a sufficient amount of full deposits have been made, the deposit contract emits the `Eth2Genesis` log. The beacon chain state may then be initialized by calling the `get_genesis_beacon_state` function (defined below) where:
|
||||||
|
|
||||||
* `genesis_time` equals `time` in the `Eth2Genesis` log
|
* `genesis_time` equals `time` in the `Eth2Genesis` log
|
||||||
* `latest_eth1_data.deposit_root` equals `deposit_root` in the `Eth2Genesis` log
|
* `latest_eth1_data.deposit_root` equals `deposit_root` in the `Eth2Genesis` log
|
||||||
|
@ -1557,13 +1557,13 @@ def get_genesis_beacon_state(genesis_validator_deposits: List[Deposit],
|
||||||
|
|
||||||
## Beacon chain processing
|
## Beacon chain processing
|
||||||
|
|
||||||
The beacon chain is the system chain for Ethereum 2.0. The main responsibilities of the beacon chain are:
|
The beacon chain is the system chain for Ethereum 2.0. The main responsibilities of the beacon chain are as follows:
|
||||||
|
|
||||||
* Store and maintain the registry of [validators](#dfn-validator)
|
* Store and maintain the registry of [validators](#dfn-validator)
|
||||||
* Process crosslinks (see above)
|
* Process crosslinks (see above)
|
||||||
* Process its per-block consensus, as well as the finality gadget
|
* Process its per-block consensus, as well as the finality gadget
|
||||||
|
|
||||||
Processing the beacon chain is similar to processing the Ethereum 1.0 chain. Clients download and process blocks, and maintain a view of what is the current "canonical chain", terminating at the current "head". However, because of the beacon chain's relationship with Ethereum 1.0, and because it is a proof-of-stake chain, there are differences.
|
Processing the beacon chain is similar to processing the Ethereum 1.0 chain. Clients download and process blocks and maintain a view of what is the current "canonical chain", terminating at the current "head". However, because of the beacon chain's relationship with Ethereum 1.0, and because it is a proof-of-stake chain, there are differences.
|
||||||
|
|
||||||
For a beacon chain block, `block`, to be processed by a node, the following conditions must be met:
|
For a beacon chain block, `block`, to be processed by a node, the following conditions must be met:
|
||||||
|
|
||||||
|
@ -1573,7 +1573,7 @@ For a beacon chain block, `block`, to be processed by a node, the following cond
|
||||||
|
|
||||||
If these conditions are not met, the client should delay processing the beacon block until the conditions are all satisfied.
|
If these conditions are not met, the client should delay processing the beacon block until the conditions are all satisfied.
|
||||||
|
|
||||||
Beacon block production is significantly different because of the proof of stake mechanism. A client simply checks what it thinks is the canonical chain when it should create a block, and looks up what its slot number is; when the slot arrives, it either proposes or attests to a block as required. Note that this requires each node to have a clock that is roughly (i.e. within `SECONDS_PER_SLOT` seconds) synchronized with the other nodes.
|
Beacon block production is significantly different because of the proof-of-stake mechanism. A client simply checks what it thinks is the canonical chain when it should create a block and looks up what its slot number is; when the slot arrives, it either proposes or attests to a block as required. Note that this dynamic requires each node to have a clock that is roughly (i.e. within `SECONDS_PER_SLOT` seconds) synchronized with the other nodes.
|
||||||
|
|
||||||
### Beacon chain fork choice rule
|
### Beacon chain fork choice rule
|
||||||
|
|
||||||
|
@ -1635,7 +1635,7 @@ def lmd_ghost(store: Store, start_state: BeaconState, start_block: BeaconBlock)
|
||||||
|
|
||||||
## Beacon chain state transition function
|
## Beacon chain state transition function
|
||||||
|
|
||||||
We now define the state transition function. At a high level the state transition is made up of four parts:
|
We now define the state transition function. At a high level, the state transition is made up of four parts:
|
||||||
|
|
||||||
1. State caching, which happens at the start of every slot.
|
1. State caching, which happens at the start of every slot.
|
||||||
2. The per-epoch transitions, which happens at the start of the first slot of every epoch.
|
2. The per-epoch transitions, which happens at the start of the first slot of every epoch.
|
||||||
|
@ -1643,7 +1643,7 @@ We now define the state transition function. At a high level the state transitio
|
||||||
4. The per-block transitions, which happens at every block.
|
4. The per-block transitions, which happens at every block.
|
||||||
|
|
||||||
Transition section notes:
|
Transition section notes:
|
||||||
* The state caching, caches the state root of the previous slot.
|
* The state caching caches the state root of the previous slot.
|
||||||
* The per-epoch transitions focus on the [validator](#dfn-validator) registry, including adjusting balances and activating and exiting [validators](#dfn-validator), as well as processing crosslinks and managing block justification/finalization.
|
* The per-epoch transitions focus on the [validator](#dfn-validator) registry, including adjusting balances and activating and exiting [validators](#dfn-validator), as well as processing crosslinks and managing block justification/finalization.
|
||||||
* The per-slot transitions focus on the slot counter and block roots records updates.
|
* The per-slot transitions focus on the slot counter and block roots records updates.
|
||||||
* The per-block transitions generally focus on verifying aggregate signatures and saving temporary records relating to the per-block activity in the `BeaconState`.
|
* The per-block transitions generally focus on verifying aggregate signatures and saving temporary records relating to the per-block activity in the `BeaconState`.
|
||||||
|
@ -1876,7 +1876,7 @@ def get_inactivity_penalty(state: BeaconState, index: ValidatorIndex, epochs_sin
|
||||||
return get_base_reward(state, index) + extra_penalty
|
return get_base_reward(state, index) + extra_penalty
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: When applying penalties in the following balance recalculations implementers should make sure the `uint64` does not underflow.
|
Note: When applying penalties in the following balance recalculations, implementers should make sure the `uint64` does not underflow.
|
||||||
|
|
||||||
##### Justification and finalization
|
##### Justification and finalization
|
||||||
|
|
||||||
|
@ -2430,7 +2430,7 @@ def verify_block_state_root(state: BeaconState, block: BeaconBlock) -> None:
|
||||||
|
|
||||||
# References
|
# References
|
||||||
|
|
||||||
This section is divided into Normative and Informative references. Normative references are those that must be read in order to implement this specification, while Informative references are merely that, information. An example of the former might be the details of a required consensus algorithm, and an example of the latter might be a pointer to research that demonstrates why a particular consensus algorithm might be better suited for inclusion in the standard than another.
|
This section is divided into Normative and Informative references. Normative references are those that must be read in order to implement this specification, while Informative references are merely that, informative. An example of the former might be the details of a required consensus algorithm, and an example of the latter might be a pointer to research that demonstrates why a particular consensus algorithm might be better suited for inclusion in the standard than another.
|
||||||
|
|
||||||
## Normative
|
## Normative
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue