Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.0 release #2082

Merged
merged 76 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
3cb1580
Update p2p-interface.md
ralexstokes Sep 12, 2020
8ad0865
Use gossip signing policy in p2p spec, see libp2p/specs#294
protolambda Sep 14, 2020
7a46181
Merge pull request #2077 from ethereum/master
protolambda Sep 21, 2020
104b83a
use integer division (//) instead of non-integer (/)
ericsson49 Sep 22, 2020
d7cb570
Merge pull request #2078 from ericsson49/ericsson49/fix_compute_weak_…
djrtwo Sep 22, 2020
a232efb
revert incorrect type fix
djrtwo Sep 22, 2020
8c9c943
Merge pull request #2054 from ethereum/ralexstokes-patch-1
djrtwo Sep 22, 2020
7088274
cleanup phase1 TOC contents
protolambda Sep 23, 2020
6a1813b
Merge pull request #2079 from ethereum/toc-cleanup
djrtwo Sep 23, 2020
19d6c83
Add IETF BLS draft 04 edge cases test vectors
hwwhww Sep 25, 2020
bdbd2aa
Aggregate G2 point at infinity
hwwhww Sep 25, 2020
ad4ad2d
Bump IETF BLS spec version draft 03 -> draft 04
hwwhww Sep 25, 2020
b43f62d
Fix encoding
hwwhww Sep 25, 2020
62d596a
update signature policy link
protolambda Sep 25, 2020
157f7e8
upgrade config to mainnet values
djrtwo Sep 28, 2020
4e2c7d2
add additional genesis initialization tests
djrtwo Sep 28, 2020
76d6926
use better rng practice for reproducibility
djrtwo Sep 29, 2020
0e2e494
fix function signature calls on deposit helpers
djrtwo Sep 29, 2020
9f36fd6
PR feedback. thanks @hwwhww
djrtwo Sep 29, 2020
122d34a
Merge pull request #2083 from ethereum/init-tests
djrtwo Sep 29, 2020
4613c6b
Bump py_ecc to 5.0.0
hwwhww Sep 30, 2020
5f9e659
Merge pull request #2060 from protolambda/signing-policy
djrtwo Sep 30, 2020
4d3ac72
Bump milagro_bls_binding to `1.4.0`, handle the exception cases
hwwhww Oct 5, 2020
d264ad8
Merge pull request #2080 from ethereum/bls_v4
hwwhww Oct 5, 2020
00a19e5
Bump milagro_bls_binding to 1.5.0
hwwhww Oct 6, 2020
29b5efd
Merge pull request #2087 from ethereum/bls_v4_milagro_patch
djrtwo Oct 6, 2020
2e09c91
fix test generators for mainnet max slashing penalties
djrtwo Oct 6, 2020
df23a95
Merge pull request #2088 from ethereum/fix-test
djrtwo Oct 6, 2020
a365fcb
fix message-id issues
djrtwo Oct 6, 2020
6287875
use domain byte to isolate message-id domains
djrtwo Oct 7, 2020
8cda237
note v5.1 in discv5 p2p spec
djrtwo Oct 7, 2020
3bf6b00
Merge pull request #2090 from ethereum/dv5.1
djrtwo Oct 7, 2020
64b34b5
Merge pull request #2089 from ethereum/fix-message-id
djrtwo Oct 7, 2020
45de819
Merge branch 'dev' into v1.0-candidate
djrtwo Oct 7, 2020
d3d9bbd
add note about coming gs v1.1 params
djrtwo Oct 7, 2020
d0cf4e7
Simplify fork choice spec
ralexstokes Oct 7, 2020
663af77
Clean up unused variable for linter
ralexstokes Oct 8, 2020
d0fd65c
Merge pull request #2091 from ethereum/gs-v1.1
djrtwo Oct 8, 2020
91deacb
double eth1data params
djrtwo Oct 8, 2020
a64ae81
Merge pull request #2093 from ethereum/eth1data-params
djrtwo Oct 8, 2020
427c7bb
fix minor typo in validator guide
djrtwo Oct 8, 2020
8fa3efe
Update simple-serialize.md
Oct 8, 2020
ddfb74c
Merge pull request #2095 from ethereum/val-typo
protolambda Oct 8, 2020
0f2fcac
Merge pull request #2096 from androolloyd/master
djrtwo Oct 12, 2020
d6ccbd5
Fix typo, `messages` -> `message`
hwwhww Oct 13, 2020
1782983
Merge pull request #2099 from ethereum/fix_bls_testgen_typo
djrtwo Oct 13, 2020
a61c56a
add a few rewards tests for duplicate style attestations
djrtwo Oct 13, 2020
032a933
Merge pull request #2102 from ethereum/add-rewards-tests
djrtwo Oct 14, 2020
c17a95a
add note about how slashings and exits can interact. add test
djrtwo Oct 14, 2020
aab58e4
update sanity generators to generate the oepration block tests as well
djrtwo Oct 14, 2020
7fb9226
Make `state_transition` not return post state; the given pre state sh…
hwwhww Oct 15, 2020
f1e4b3c
Refactor shard_state_transition
hwwhww Oct 15, 2020
a34970f
move op tests to test_blocks
djrtwo Oct 16, 2020
2c337d6
Merge pull request #2103 from ethereum/slash-exit
djrtwo Oct 16, 2020
73cd1a8
added best practices section according to https://github.com/ethereum…
alonmuroch Oct 20, 2020
fe5e2f6
table of content
alonmuroch Oct 20, 2020
f7a9493
multi-op tests
djrtwo Oct 20, 2020
0835c78
Apply suggestions from Dankrad's code review
alonmuroch Oct 27, 2020
b356f52
ensure aggregate attestation's slot and target are consistent
djrtwo Oct 28, 2020
b1c2a20
Merge pull request #2115 from ethereum/agg-target-validation
protolambda Oct 29, 2020
bdd1077
Merge pull request #2110 from ethereum/multi-op-tests
djrtwo Nov 2, 2020
bfaef68
Merge pull request #2092 from ethereum/ralexstokes-patch-1
djrtwo Nov 3, 2020
6b44f63
Merge pull request #2104 from ethereum/state_transition_patch
djrtwo Nov 3, 2020
a8c1d21
add attestation test for off by one committee index
djrtwo Nov 3, 2020
276ca6d
pr feedback
djrtwo Nov 3, 2020
a3e023a
Merge pull request #2119 from ethereum/att-test
protolambda Nov 3, 2020
c4ccdc9
Merge branch 'dev' into v1.0-candidate
djrtwo Nov 3, 2020
15270b7
bump VERSION.txt to 1.0.0
djrtwo Nov 3, 2020
0d8d9e7
Merge pull request #2120 from ethereum/bump-version
djrtwo Nov 3, 2020
82cdbba
Increase mesh degree
AgeManning Nov 4, 2020
cfc91cd
Merge pull request #2121 from AgeManning/gossipsub-mesh
djrtwo Nov 4, 2020
5b95219
Apply suggestions from code review
alonmuroch Nov 4, 2020
6996a89
Apply suggestions from code review
alonmuroch Nov 4, 2020
2aa827c
Merge pull request #2107 from bloxapp/honest_val_time_attack
djrtwo Nov 4, 2020
cd7b105
add mainnet deposit contract address and min genesis time
djrtwo Nov 4, 2020
7589af8
remove wip notice on phase 0 specs
djrtwo Nov 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions configs/mainnet/phase0.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Mainnet preset
# Note: the intention of this file (for now) is to illustrate what a mainnet configuration could look like.
# Some of these constants may still change before the launch of Phase 0.

CONFIG_NAME: "mainnet"

Expand All @@ -20,16 +18,14 @@ CHURN_LIMIT_QUOTIENT: 65536
SHUFFLE_ROUND_COUNT: 90
# `2**14` (= 16,384)
MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 16384
# Jan 3, 2020
MIN_GENESIS_TIME: 1578009600
# Dec 1, 2020, 12pm UTC
MIN_GENESIS_TIME: 1606824000
# 4
HYSTERESIS_QUOTIENT: 4
# 1 (minus 0.25)
HYSTERESIS_DOWNWARD_MULTIPLIER: 1
# 5 (plus 1.25)
HYSTERESIS_UPWARD_MULTIPLIER: 5
# 3
PROPORTIONAL_SLASHING_MULTIPLIER: 3


# Fork Choice
Expand All @@ -40,8 +36,8 @@ SAFE_SLOTS_TO_UPDATE_JUSTIFIED: 8

# Validator
# ---------------------------------------------------------------
# 2**10 (= 1,024)
ETH1_FOLLOW_DISTANCE: 1024
# 2**11 (= 2,048)
ETH1_FOLLOW_DISTANCE: 2048
# 2**4 (= 16)
TARGET_AGGREGATORS_PER_COMMITTEE: 16
# 2**0 (= 1)
Expand All @@ -58,7 +54,7 @@ SECONDS_PER_ETH1_BLOCK: 14
DEPOSIT_CHAIN_ID: 1
DEPOSIT_NETWORK_ID: 1
# **TBD**
DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890
DEPOSIT_CONTRACT_ADDRESS: 0x00000000219ab540356cBB839Cbe05303d7705Fa


# Gwei values
Expand All @@ -82,8 +78,8 @@ BLS_WITHDRAWAL_PREFIX: 0x00

# Time parameters
# ---------------------------------------------------------------
# 172800 seconds (2 days)
GENESIS_DELAY: 172800
# 604800 seconds (7 days)
GENESIS_DELAY: 604800
# 12 seconds
SECONDS_PER_SLOT: 12
# 2**0 (= 1) slots 12 seconds
Expand All @@ -94,8 +90,8 @@ SLOTS_PER_EPOCH: 32
MIN_SEED_LOOKAHEAD: 1
# 2**2 (= 4) epochs 25.6 minutes
MAX_SEED_LOOKAHEAD: 4
# 2**5 (= 32) epochs ~3.4 hours
EPOCHS_PER_ETH1_VOTING_PERIOD: 32
# 2**6 (= 64) epochs ~6.8 hours
EPOCHS_PER_ETH1_VOTING_PERIOD: 64
# 2**13 (= 8,192) slots ~13 hours
SLOTS_PER_HISTORICAL_ROOT: 8192
# 2**8 (= 256) epochs ~27 hours
Expand Down Expand Up @@ -126,10 +122,12 @@ BASE_REWARD_FACTOR: 64
WHISTLEBLOWER_REWARD_QUOTIENT: 512
# 2**3 (= 8)
PROPOSER_REWARD_QUOTIENT: 8
# 2**24 (= 16,777,216)
INACTIVITY_PENALTY_QUOTIENT: 16777216
# 2**5 (= 32)
MIN_SLASHING_PENALTY_QUOTIENT: 32
# 2**26 (= 67,108,864)
INACTIVITY_PENALTY_QUOTIENT: 67108864
# 2**7 (= 128) (lower safety margin at Phase 0 genesis)
MIN_SLASHING_PENALTY_QUOTIENT: 128
# 1 (lower safety margin at Phase 0 genesis)
PROPORTIONAL_SLASHING_MULTIPLIER: 1


# Max operations per block
Expand Down
14 changes: 7 additions & 7 deletions configs/minimal/phase0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ HYSTERESIS_QUOTIENT: 4
HYSTERESIS_DOWNWARD_MULTIPLIER: 1
# 5 (plus 1.25)
HYSTERESIS_UPWARD_MULTIPLIER: 5
# 3
PROPORTIONAL_SLASHING_MULTIPLIER: 3


# Fork Choice
Expand Down Expand Up @@ -56,7 +54,7 @@ SECONDS_PER_ETH1_BLOCK: 14
# Ethereum Goerli testnet
DEPOSIT_CHAIN_ID: 5
DEPOSIT_NETWORK_ID: 5
# **TBD**
# Configured on a per testnet basis
DEPOSIT_CONTRACT_ADDRESS: 0x1234567890123456789012345678901234567890


Expand Down Expand Up @@ -125,10 +123,12 @@ BASE_REWARD_FACTOR: 64
WHISTLEBLOWER_REWARD_QUOTIENT: 512
# 2**3 (= 8)
PROPOSER_REWARD_QUOTIENT: 8
# 2**24 (= 16,777,216)
INACTIVITY_PENALTY_QUOTIENT: 16777216
# 2**5 (= 32)
MIN_SLASHING_PENALTY_QUOTIENT: 32
# [customized] 2**25 (= 33,554,432)
INACTIVITY_PENALTY_QUOTIENT: 33554432
# [customized] 2**6 (= 64)
MIN_SLASHING_PENALTY_QUOTIENT: 64
# [customized] 2 (lower safety margin than Phase 0 genesis but different than mainnet config for testing)
PROPORTIONAL_SLASHING_MULTIPLIER: 2


# Max operations per block
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ def run(self):
"eth-utils>=1.3.0,<2",
"eth-typing>=2.1.0,<3.0.0",
"pycryptodome==3.9.4",
"py_ecc==4.0.0",
"milagro_bls_binding==1.3.0",
"py_ecc==5.0.0",
"milagro_bls_binding==1.5.0",
"dataclasses==0.6",
"remerkleable==0.1.17",
"ruamel.yaml==0.16.5",
Expand Down
30 changes: 13 additions & 17 deletions specs/phase0/beacon-chain.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Ethereum 2.0 Phase 0 -- The Beacon Chain

**Notice**: This document is a work-in-progress for researchers and implementers.

## Table of contents
<!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -177,25 +175,24 @@ The following values are (non-configurable) constants used throughout the specif

## Configuration

*Note*: The default mainnet configuration values are included here for spec-design purposes. The different configurations for mainnet, testnets, and YAML-based testing can be found in the [`configs/constant_presets`](../../configs) directory. These configurations are updated for releases and may be out of sync during `dev` changes.
*Note*: The default mainnet configuration values are included here for illustrative purposes. The different configurations for mainnet, testnets, and YAML-based testing can be found in the [`configs/constant_presets`](../../configs) directory.

### Misc

| Name | Value |
| - | - |
| `ETH1_FOLLOW_DISTANCE` | `uint64(2**10)` (= 1,024) |
| `ETH1_FOLLOW_DISTANCE` | `uint64(2**11)` (= 2,048) |
| `MAX_COMMITTEES_PER_SLOT` | `uint64(2**6)` (= 64) |
| `TARGET_COMMITTEE_SIZE` | `uint64(2**7)` (= 128) |
| `MAX_VALIDATORS_PER_COMMITTEE` | `uint64(2**11)` (= 2,048) |
| `MIN_PER_EPOCH_CHURN_LIMIT` | `uint64(2**2)` (= 4) |
| `CHURN_LIMIT_QUOTIENT` | `uint64(2**16)` (= 65,536) |
| `SHUFFLE_ROUND_COUNT` | `uint64(90)` |
| `MIN_GENESIS_ACTIVE_VALIDATOR_COUNT` | `uint64(2**14)` (= 16,384) |
| `MIN_GENESIS_TIME` | `uint64(1578009600)` (Jan 3, 2020) |
| `MIN_GENESIS_TIME` | `uint64(1606824000)` (Dec 1, 2020, 12pm UTC) |
| `HYSTERESIS_QUOTIENT` | `uint64(4)` |
| `HYSTERESIS_DOWNWARD_MULTIPLIER` | `uint64(1)` |
| `HYSTERESIS_UPWARD_MULTIPLIER` | `uint64(5)` |
| `PROPORTIONAL_SLASHING_MULTIPLIER` | `uint64(3)` |

- For the safety of committees, `TARGET_COMMITTEE_SIZE` exceeds [the recommended minimum committee size of 111](http://web.archive.org/web/20190504131341/https://vitalik.ca/files/Ithaca201807_Sharding.pdf); with sufficient active validators (at least `SLOTS_PER_EPOCH * TARGET_COMMITTEE_SIZE`), the shuffling algorithm ensures committee sizes of at least `TARGET_COMMITTEE_SIZE`. (Unbiasable randomness with a Verifiable Delay Function (VDF) will improve committee robustness and lower the safe minimum committee size.)

Expand All @@ -219,15 +216,15 @@ The following values are (non-configurable) constants used throughout the specif

| Name | Value | Unit | Duration |
| - | - | :-: | :-: |
| `GENESIS_DELAY` | `uint64(172800)` | seconds | 2 days |
| `GENESIS_DELAY` | `uint64(604800)` | seconds | 7 days |
| `SECONDS_PER_SLOT` | `uint64(12)` | seconds | 12 seconds |
| `SECONDS_PER_ETH1_BLOCK` | `uint64(14)` | seconds | 14 seconds |
| `MIN_ATTESTATION_INCLUSION_DELAY` | `uint64(2**0)` (= 1) | slots | 12 seconds |
| `SLOTS_PER_EPOCH` | `uint64(2**5)` (= 32) | slots | 6.4 minutes |
| `MIN_SEED_LOOKAHEAD` | `uint64(2**0)` (= 1) | epochs | 6.4 minutes |
| `MAX_SEED_LOOKAHEAD` | `uint64(2**2)` (= 4) | epochs | 25.6 minutes |
| `MIN_EPOCHS_TO_INACTIVITY_PENALTY` | `uint64(2**2)` (= 4) | epochs | 25.6 minutes |
| `EPOCHS_PER_ETH1_VOTING_PERIOD` | `uint64(2**5)` (= 32) | epochs | ~3.4 hours |
| `EPOCHS_PER_ETH1_VOTING_PERIOD` | `uint64(2**6)` (= 64) | epochs | ~6.8 hours |
| `SLOTS_PER_HISTORICAL_ROOT` | `uint64(2**13)` (= 8,192) | slots | ~27 hours |
| `MIN_VALIDATOR_WITHDRAWABILITY_DELAY` | `uint64(2**8)` (= 256) | epochs | ~27 hours |
| `SHARD_COMMITTEE_PERIOD` | `uint64(2**8)` (= 256) | epochs | ~27 hours |
Expand All @@ -248,10 +245,13 @@ The following values are (non-configurable) constants used throughout the specif
| `BASE_REWARD_FACTOR` | `uint64(2**6)` (= 64) |
| `WHISTLEBLOWER_REWARD_QUOTIENT` | `uint64(2**9)` (= 512) |
| `PROPOSER_REWARD_QUOTIENT` | `uint64(2**3)` (= 8) |
| `INACTIVITY_PENALTY_QUOTIENT` | `uint64(2**24)` (= 16,777,216) |
| `MIN_SLASHING_PENALTY_QUOTIENT` | `uint64(2**5)` (= 32) |
| `INACTIVITY_PENALTY_QUOTIENT` | `uint64(2**26)` (= 67,108,864) |
| `MIN_SLASHING_PENALTY_QUOTIENT` | `uint64(2**7)` (=128) |
| `PROPORTIONAL_SLASHING_MULTIPLIER` | `uint64(1)` |

- The `INACTIVITY_PENALTY_QUOTIENT` equals `INVERSE_SQRT_E_DROP_TIME**2` where `INVERSE_SQRT_E_DROP_TIME := 2**13` epochs (about 36 days) is the time it takes the inactivity penalty to reduce the balance of non-participating validators to about `1/sqrt(e) ~= 60.6%`. Indeed, the balance retained by offline validators after `n` epochs is about `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(n**2/2)`; so after `INVERSE_SQRT_E_DROP_TIME` epochs, it is roughly `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(INACTIVITY_PENALTY_QUOTIENT/2) ~= 1/sqrt(e)`. Note this value will be upgraded to `2**24` after Phase 0 mainnet stabilizes to provide a faster recovery in the event of an inactivity leak.

- The `INACTIVITY_PENALTY_QUOTIENT` equals `INVERSE_SQRT_E_DROP_TIME**2` where `INVERSE_SQRT_E_DROP_TIME := 2**12` epochs (about 18 days) is the time it takes the inactivity penalty to reduce the balance of non-participating validators to about `1/sqrt(e) ~= 60.6%`. Indeed, the balance retained by offline validators after `n` epochs is about `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(n**2/2)`; so after `INVERSE_SQRT_E_DROP_TIME` epochs, it is roughly `(1 - 1/INACTIVITY_PENALTY_QUOTIENT)**(INACTIVITY_PENALTY_QUOTIENT/2) ~= 1/sqrt(e)`.
- The `PROPORTIONAL_SLASHING_MULTIPLIER` is set to `1` at initial mainnet launch, resulting in one-third of the minimum accountable safety margin in the event of a finality attack. After Phase 0 mainnet stablizes, this value will be upgraded to `3` to provide the maximal minimum accoutable safety margin.

### Max operations per block

Expand Down Expand Up @@ -603,7 +603,7 @@ def bytes_to_uint64(data: bytes) -> uint64:

#### BLS Signatures

Eth2 makes use of BLS signatures as specified in the [IETF draft BLS specification draft-irtf-cfrg-bls-signature-03](https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-03). Specifically, eth2 uses the `BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_` ciphersuite which implements the following interfaces:
Eth2 makes use of BLS signatures as specified in the [IETF draft BLS specification draft-irtf-cfrg-bls-signature-04](https://tools.ietf.org/html/draft-irtf-cfrg-bls-signature-04). Specifically, eth2 uses the `BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_` ciphersuite which implements the following interfaces:

- `def Sign(SK: int, message: Bytes) -> BLSSignature`
- `def Verify(PK: BLSPubkey, message: Bytes, signature: BLSSignature) -> bool`
Expand Down Expand Up @@ -1189,8 +1189,6 @@ def is_valid_genesis_state(state: BeaconState) -> bool:
return True
```

*Note*: The `is_valid_genesis_state` function (including `MIN_GENESIS_TIME` and `MIN_GENESIS_ACTIVE_VALIDATOR_COUNT`) is a placeholder for testing. It has yet to be finalized by the community, and can be updated as necessary.

### Genesis block

Let `genesis_block = BeaconBlock(state_root=hash_tree_root(genesis_state))`.
Expand All @@ -1200,7 +1198,7 @@ Let `genesis_block = BeaconBlock(state_root=hash_tree_root(genesis_state))`.
The post-state corresponding to a pre-state `state` and a signed block `signed_block` is defined as `state_transition(state, signed_block)`. State transitions that trigger an unhandled exception (e.g. a failed `assert` or an out-of-range list access) are considered invalid. State transitions that cause a `uint64` overflow or underflow are also considered invalid.

```python
def state_transition(state: BeaconState, signed_block: SignedBeaconBlock, validate_result: bool=True) -> BeaconState:
def state_transition(state: BeaconState, signed_block: SignedBeaconBlock, validate_result: bool=True) -> None:
block = signed_block.message
# Process slots (including those with no blocks) since block
process_slots(state, block.slot)
Expand All @@ -1212,8 +1210,6 @@ def state_transition(state: BeaconState, signed_block: SignedBeaconBlock, valida
# Verify state root
if validate_result:
assert block.state_root == hash_tree_root(state)
# Return post-state
return state
```

```python
Expand Down
4 changes: 1 addition & 3 deletions specs/phase0/deposit-contract.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Ethereum 2.0 Phase 0 -- Deposit Contract

**Notice**: This document is a work-in-progress for researchers and implementers.

## Table of contents
<!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -43,7 +41,7 @@ These configurations are updated for releases and may be out of sync during `dev
| - | - |
| `DEPOSIT_CHAIN_ID` | `1` |
| `DEPOSIT_NETWORK_ID` | `1` |
| `DEPOSIT_CONTRACT_ADDRESS` | **TBD** |
| `DEPOSIT_CONTRACT_ADDRESS` | `0x00000000219ab540356cBB839Cbe05303d7705Fa` |

## Ethereum 1.0 deposit contract

Expand Down
8 changes: 3 additions & 5 deletions specs/phase0/fork-choice.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Ethereum 2.0 Phase 0 -- Beacon Chain Fork Choice

**Notice**: This document is a work-in-progress for researchers and implementers.

## Table of contents
<!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
Expand Down Expand Up @@ -226,11 +224,10 @@ def get_head(store: Store) -> Root:
blocks = get_filtered_block_tree(store)
# Execute the LMD-GHOST fork choice
head = store.justified_checkpoint.root
justified_slot = compute_start_slot_at_epoch(store.justified_checkpoint.epoch)
while True:
children = [
root for root in blocks.keys()
if blocks[root].parent_root == head and blocks[root].slot > justified_slot
if blocks[root].parent_root == head
]
if len(children) == 0:
return head
Expand Down Expand Up @@ -355,7 +352,8 @@ def on_block(store: Store, signed_block: SignedBeaconBlock) -> None:
assert get_ancestor(store, block.parent_root, finalized_slot) == store.finalized_checkpoint.root

# Check the block is valid and compute the post-state
state = state_transition(pre_state, signed_block, True)
state = pre_state.copy()
state_transition(state, signed_block, True)
# Add new block to the store
store.blocks[hash_tree_root(block)] = block
# Add new state for this block to the store
Expand Down
Loading