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

Modularize Phase1 into post-Merge features: Sharding, Custody Game, Data Availability Sampling #2254

Merged
merged 91 commits into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
e17ab8e
DAS phase 1
vbuterin Dec 9, 2020
d02a642
Combing... part 1
vbuterin Dec 10, 2020
f75ea37
Second pass
vbuterin Dec 10, 2020
623f164
Fixed custom types
vbuterin Dec 10, 2020
3d108e7
Made confirmed headers a separate object
vbuterin Dec 10, 2020
ed357b9
Abstracted (Kate commitment, length) into separate object
vbuterin Dec 10, 2020
2190c13
Added dependencies to fork choice section
vbuterin Dec 10, 2020
1ce25c1
Minor fixes
hwwhww Dec 11, 2020
55d9f62
(OOP SSZ) if the fields are updated, we need to redefine them when de…
hwwhww Dec 11, 2020
3211c11
Revert: `BeaconBlockHeader` was not changed
hwwhww Dec 11, 2020
27dbb5e
Update specs/phase1/beacon-chain.md
vbuterin Dec 12, 2020
badc3ea
Update specs/phase1/beacon-chain.md
vbuterin Dec 13, 2020
1bccf9f
Update specs/phase1/beacon-chain.md
vbuterin Dec 13, 2020
42ad120
Update specs/phase1/beacon-chain.md
vbuterin Dec 13, 2020
2abc7a4
pending_headers -> pending_shard_headers
vbuterin Dec 13, 2020
4647a1b
Some small fixes
dankrad Dec 14, 2020
d3cb261
Delta minimum 1
vbuterin Dec 16, 2020
315fe92
Added size check to include the degree check
vbuterin Dec 16, 2020
4348d3b
Add data availability coding rate as a constant (makes it more explic…
dankrad Dec 16, 2020
7d05c42
Improve/correct length checking
dankrad Dec 18, 2020
68844f2
Increase maximum allowable gas price and restrict proposer selection …
dankrad Dec 18, 2020
0769b2c
Fill in with zeroes only up to the next power of two, to reduce degre…
dankrad Dec 18, 2020
c674a27
Fix seed in get_shard_proposer_index
dankrad Dec 28, 2020
6e249e8
Update specs/phase1/beacon-chain.md
dankrad Dec 28, 2020
126d07c
MAX_COMMITTEE_SIZE -> MAX_VALIDATORS_PER_COMMITTEE
dankrad Dec 28, 2020
f0fc9c6
Add modulus
dankrad Dec 28, 2020
0408aa5
Update specs/phase1/beacon-chain.md
dankrad Dec 28, 2020
6660262
Update specs/phase1/beacon-chain.md
dankrad Dec 28, 2020
a260dbc
Kate -> KZG10 (better in formal contexts)
dankrad Dec 28, 2020
f44b7ff
Change length proof to degree proof
dankrad Dec 28, 2020
41f9716
most_recent_confirmed_commitments -> grantparent_epoch_confirmed_comm…
dankrad Dec 28, 2020
7fc34c8
Update specs/phase1/beacon-chain.md
dankrad Dec 28, 2020
f216000
MAX_COMMITTEE_SIZE -> MAX_VALIDATORS_PER_COMMITTEE (missed one)
dankrad Dec 28, 2020
eccae0a
Update specs/phase1/beacon-chain.md
dankrad Dec 28, 2020
29a5d4c
BLSCommitment -> DataCommitment
dankrad Dec 28, 2020
fc4dad6
Fix degree proof for length 0 (degree -inf)
dankrad Dec 28, 2020
ac0686d
Refactor loop
dankrad Dec 28, 2020
0af9e25
Revert hackmd link -- original link was good, just accidentally overw…
dankrad Dec 28, 2020
ca63238
Apply suggestions from code review
vbuterin Dec 31, 2020
3e6baf1
Fixed index vs shard and beacon committee getting
vbuterin Dec 31, 2020
1192158
minor cleanups/fixes to shard data avail PR
djrtwo Jan 4, 2021
be93b03
pending_commitment.votes -> pending_header.votes
protolambda Mar 17, 2021
304e87a
typo
djrtwo Jan 11, 2021
be91e59
DAS phase 1
vbuterin Dec 9, 2020
6f0b613
work in progress DAS network + validator spec
protolambda Jan 1, 2021
e3a7e16
DAS doc
protolambda Jan 1, 2021
91e935d
more DAS spec work: DAS function signatures, gossip details
protolambda Jan 1, 2021
a02f856
update bit-reverse-ordering/presentation + shard blob signature verif…
protolambda Jan 2, 2021
334c889
toc
protolambda Jan 2, 2021
5e57ff0
Update specs/phase1/data-availability-sampling.md
protolambda Jan 2, 2021
a183194
adjustments based on review by @dankrad
protolambda Jan 2, 2021
a8c9cfb
minor cleanups/fixes to shard data avail PR
djrtwo Jan 4, 2021
c6af2ec
Code review - apply suggestions to DAS doc
protolambda Jan 4, 2021
4c5afb9
refactor/polish style of DAS docs, move DAS validator work to new doc
protolambda Jan 4, 2021
8e21a31
DAS docs TOC updates
protolambda Jan 4, 2021
02e3144
fix DAS p2p validation rule wording
protolambda Jan 4, 2021
b7d965b
split out general phase1 networking from DAS
protolambda Jan 4, 2021
cf86766
notes about backbone identification function claims
protolambda Jan 4, 2021
8116e1c
minor fixes to appease CI
protolambda Jan 4, 2021
b3c5e65
cleanup old docs about transition-full sharding
protolambda Mar 17, 2021
2696968
cleanup validator doc; lightclient was moved to altair, shards are da…
protolambda Mar 17, 2021
3f97cca
remove light-client-sync. Altair implements this. Shard-specific part…
protolambda Mar 17, 2021
4068a88
split phase1 features
protolambda Mar 17, 2021
882aa81
cleanup
protolambda Mar 17, 2021
6d2d8cb
toc updates
protolambda Mar 17, 2021
c748c1d
cleanup sharding docs
protolambda Mar 17, 2021
1acb1d6
disable phase1 pyspec build
protolambda Mar 17, 2021
306fc95
Update doc names and sharding readme section
protolambda Mar 17, 2021
0b8e3ae
move shard blob types from das to sharding spec
protolambda Mar 17, 2021
8542d34
update sharding p2p doc
protolambda Mar 17, 2021
f618f3c
move custody-specific operations to custody spec
protolambda Mar 18, 2021
d4c057a
bls point type back to sharding spec
protolambda Mar 18, 2021
4e4d0eb
update custody doc wording
protolambda Mar 18, 2021
b627f70
fix body type
protolambda Mar 18, 2021
65dbf6a
toc
protolambda Mar 18, 2021
112056f
add custom types to TOC
protolambda Mar 26, 2021
14cb996
split phase1 tests into proof-of-custody and sharding tests, drop old…
protolambda Mar 26, 2021
906cde0
preserve proof of custody tests
protolambda Mar 26, 2021
a6c01f8
no phase1 in tests, per-feature testing now, executable specs will be…
protolambda Mar 26, 2021
0c94be4
clean up more phase1 test references
protolambda Mar 26, 2021
c225813
split phase1 configs into feature configs
protolambda Mar 26, 2021
379ba98
move static sharding configuration into constants
protolambda Mar 26, 2021
29f78a7
proof of custody full name
protolambda Mar 26, 2021
d067237
list new Merge specs, update features descriptions
protolambda Mar 27, 2021
5e186fc
update sharding spec to extend Merge types
protolambda Mar 27, 2021
2bc3e81
rename to custody game
protolambda Mar 27, 2021
d28cac0
clean up test phase 1 testgen references
protolambda Mar 29, 2021
430627f
Apply suggestions from @djrtwo
protolambda Mar 29, 2021
9420c29
custody game doc naming updates
protolambda Mar 29, 2021
07b7774
misc. phase1 modules refactor updates
protolambda Mar 29, 2021
7344442
update merge and sharding configs to reflect fork slot placeholder, a…
protolambda Mar 29, 2021
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
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ GENERATOR_VENVS = $(patsubst $(GENERATOR_DIR)/%, $(GENERATOR_DIR)/%venv, $(GENER
# To check generator matching:
#$(info $$GENERATOR_TARGETS is [${GENERATOR_TARGETS}])

MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/phase0/*.md) $(wildcard $(SPEC_DIR)/phase1/*.md) $(wildcard $(SPEC_DIR)/altair/*.md) $(wildcard $(SSZ_DIR)/*.md) $(wildcard $(SPEC_DIR)/networking/*.md) $(wildcard $(SPEC_DIR)/validator/*.md)
MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/phase0/*.md) $(wildcard $(SPEC_DIR)/altair/*.md) $(wildcard $(SSZ_DIR)/*.md) \
$(wildcard $(SPEC_DIR)/merge/*.md) \
$(wildcard $(SPEC_DIR)/custody/*.md) \
$(wildcard $(SPEC_DIR)/das/*.md) \
$(wildcard $(SPEC_DIR)/sharding/*.md)

COV_HTML_OUT=.htmlcov
COV_INDEX_FILE=$(PY_SPEC_DIR)/$(COV_HTML_OUT)/index.html
Expand Down Expand Up @@ -88,11 +92,11 @@ install_test:

test: pyspec
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -n 4 --disable-bls --cov=eth2spec.phase0.spec --cov=eth2spec.phase1.spec --cov=eth2spec.altair.spec --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec
python3 -m pytest -n 4 --disable-bls --cov=eth2spec.phase0.spec --cov=eth2spec.altair.spec --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec

find_test: pyspec
. venv/bin/activate; cd $(PY_SPEC_DIR); \
python3 -m pytest -k=$(K) --disable-bls --cov=eth2spec.phase0.spec --cov=eth2spec.phase1.spec --cov=eth2spec.altair.spec --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec
python3 -m pytest -k=$(K) --disable-bls --cov=eth2spec.phase0.spec --cov=eth2spec.altair.spec --cov-report="html:$(COV_HTML_OUT)" --cov-branch eth2spec

citest: pyspec
mkdir -p tests/core/pyspec/test-reports/eth2spec; . venv/bin/activate; cd $(PY_SPEC_DIR); \
Expand All @@ -112,10 +116,11 @@ check_toc: $(MARKDOWN_FILES:=.toc)
codespell:
codespell . --skip ./.git -I .codespell-whitelist

# TODO: add future merge, sharding, etc. packages to linting.
lint: pyspec
. venv/bin/activate; cd $(PY_SPEC_DIR); \
flake8 --config $(LINTER_CONFIG_FILE) ./eth2spec \
&& mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.phase1 -p eth2spec.altair
&& mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.altair
protolambda marked this conversation as resolved.
Show resolved Hide resolved

lint_generators: pyspec
. venv/bin/activate; cd $(TEST_GENERATORS_DIR); \
Expand Down
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ This repository hosts the current Eth2 specifications. Discussions about design

[![GitHub release](https://img.shields.io/github/v/release/ethereum/eth2.0-specs)](https://github.com/ethereum/eth2.0-specs/releases/) [![PyPI version](https://badge.fury.io/py/eth2spec.svg)](https://badge.fury.io/py/eth2spec)

Core specifications for Eth2 clients be found in [specs](specs/). These are divided into phases. Each subsequent phase depends upon the prior. The current phases specified are:
Core specifications for Eth2 clients be found in [specs](specs/). These are divided into features.
Features are researched and developed in parallel, and then consolidated into sequential upgrades when ready.

The current features are:

### Phase 0

Expand All @@ -27,13 +30,35 @@ Core specifications for Eth2 clients be found in [specs](specs/). These are divi
* [Altair fork](specs/altair/fork.md)
* [Light client sync protocol](specs/altair/sync-protocol.md)

### Sharding
### Merge

The sharding spec is still actively in R&D; see the most recent available pull request [here](https://github.com/ethereum/eth2.0-specs/pull/2146) and some technical details [here](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD).
The merge is still actively in R&D. The specifications outline a general direction for engineering work,
while the details are in review and may change.

### Merge
* Background material:
* An [ethresear.ch](https://ethresear.ch) post [describing the basic mechanism](https://ethresear.ch/t/the-eth1-eth2-transition/6265)
* [ethereum.org](https://ethereum.org) high-level description of the merge [here](https://ethereum.org/en/eth2/docking/)
* Specifications:
* [Beacon Chain changes](specs/merge/beacon-chain.md)
* [Fork Choice changes](specs/merge/fork-choice.md)
* [Validator additions](specs/merge/validator.md)

### Sharding

The merge is still actively in R&D; see an [ethresear.ch](https://ethresear.ch) post describing the proposed basic mechanism [here](https://ethresear.ch/t/the-eth1-eth2-transition/6265) and the section of [ethereum.org](https://ethereum.org) describing the merge at a high level [here](https://ethereum.org/en/eth2/docking/).
Sharding follows the merge, and is divided into three parts:

* Sharding base functionality - In early engineering phase
* [Beacon Chain changes](specs/sharding/beacon-chain.md)
* [P2P Network changes](specs/sharding/p2p-interface.md)
* Custody Game - Ready, dependent on sharding
* [Custody Game](specs/custody_game/custody-game.md)
* [Validator custody work](specs/custody_game/validator.md)
* Data Availability Sampling - In active R&D
* Technical details [here](https://hackmd.io/@HWeNw8hNRimMm2m2GH56Cw/B1YJPGkpD).
* [Core types and functions](specs/das/das-core.md)
* [P2P Networking](specs/das/p2p-interface.md)
* [Fork Choice](specs/das/fork-choice.md)
* [Sampling process](specs/das/sampling.md)

### Accompanying documents can be found in [specs](specs) and include:

Expand Down
48 changes: 48 additions & 0 deletions configs/mainnet/custody_game.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Mainnet preset - Custody Game

# Time parameters
# ---------------------------------------------------------------
# 2**1 (= 2) epochs, 12.8 minutes
RANDAO_PENALTY_EPOCHS: 2
# 2**15 (= 32,768) epochs, ~146 days
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 32768
# 2**14 (= 16,384) epochs ~73 days
EPOCHS_PER_CUSTODY_PERIOD: 16384
# 2**11 (= 2,048) epochs, ~9 days
CUSTODY_PERIOD_TO_RANDAO_PADDING: 2048
# 2**15 (= 32,768) epochs, ~146 days
MAX_CHUNK_CHALLENGE_DELAY: 32768

# Misc parameters
# ---------------------------------------------------------------
# 2**256 - 189
CUSTODY_PRIME: 115792089237316195423570985008687907853269984665640564039457584007913129639747
# 3
CUSTODY_SECRETS: 3
# 1/1024 chance of custody bit 1
CUSTODY_PROBABILITY_EXPONENT: 10

# Max operations
# ---------------------------------------------------------------
# 2**8 (= 256)
MAX_CUSTODY_KEY_REVEALS: 256
# 2**0 (= 1)
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
# 2**2 (= 2)
MAX_CUSTODY_CHUNK_CHALLENGES: 4
# 2** 4 (= 16)
MAX_CUSTODY_CHUNK_CHALLENGE_RESP: 16
# 2**0 (= 1)
MAX_CUSTODY_SLASHINGS: 1

# Reward and penalty quotients
# ---------------------------------------------------------------
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE: 2
# 2**8 (= 256)
MINOR_REWARD_QUOTIENT: 256

# Signature domains
# ---------------------------------------------------------------
DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000
DOMAIN_LIGHT_SELECTION_PROOF: 0x84000000
DOMAIN_LIGHT_AGGREGATE_AND_PROOF: 0x85000000
7 changes: 7 additions & 0 deletions configs/mainnet/merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Mainnet preset - The Merge

# Fork
# ---------------------------------------------------------------
MERGE_FORK_VERSION: 0x02000000
# TBD
MERGE_FORK_SLOT: 0
101 changes: 0 additions & 101 deletions configs/mainnet/phase1.yaml

This file was deleted.

43 changes: 43 additions & 0 deletions configs/mainnet/sharding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Mainnet preset - Sharding

# Fork
# ---------------------------------------------------------------
SHARDING_FORK_VERSION: 0x03000000
# TBD
SHARDING_FORK_SLOT: 0


# Beacon-chain
# ---------------------------------------------------------------
# Misc
# 2**10 (= 1,024)
MAX_SHARDS: 1024
# 2**6 = 64
INITIAL_ACTIVE_SHARDS: 64
# 2**3 (= 8)
GASPRICE_ADJUSTMENT_COEFFICIENT: 8

# Shard block configs
# ---------------------------------------------------------------
MAX_SHARD_HEADERS_PER_SHARD: 4
# 2**11 (= 2,048)
MAX_SAMPLES_PER_BLOCK: 2048
# 2**10 (= 1,1024)
TARGET_SAMPLES_PER_BLOCK: 1024

# Gwei values
# ---------------------------------------------------------------
# 2**33 (= 8,589,934,592) Gwei
MAX_GASPRICE: 8589934592
# 2**3 (= 8) Gwei
MIN_GASPRICE: 8

# Time parameters
# ---------------------------------------------------------------
# 2**8 (= 256) | epochs
SHARD_COMMITTEE_PERIOD: 256

# Signature domains
# ---------------------------------------------------------------
DOMAIN_SHARD_PROPOSAL: 0x80000000
DOMAIN_SHARD_COMMITTEE: 0x81000000
protolambda marked this conversation as resolved.
Show resolved Hide resolved
48 changes: 48 additions & 0 deletions configs/minimal/custody_game.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Minimal preset - Custody Game

# Time parameters
# ---------------------------------------------------------------
# 2**1 (= 2) epochs, 12.8 minutes
RANDAO_PENALTY_EPOCHS: 2
# [customized] quicker for testing
EARLY_DERIVED_SECRET_PENALTY_MAX_FUTURE_EPOCHS: 64
# [customized] quicker for testing
EPOCHS_PER_CUSTODY_PERIOD: 32
# [customized] quicker for testing
CUSTODY_PERIOD_TO_RANDAO_PADDING: 8
# [customize for faster testing]
MAX_CHUNK_CHALLENGE_DELAY: 64

# Misc parameters
# ---------------------------------------------------------------
# 2**256 - 189
CUSTODY_PRIME: 115792089237316195423570985008687907853269984665640564039457584007913129639747
# 3
CUSTODY_SECRETS: 3
# 1/4 chance of custody bit 1 [customized for faster testing]
CUSTODY_PROBABILITY_EXPONENT: 2

# Max operations
# ---------------------------------------------------------------
# 2**8 (= 256)
MAX_CUSTODY_KEY_REVEALS: 256
# 2**0 (= 1)
MAX_EARLY_DERIVED_SECRET_REVEALS: 1
# [customized]
MAX_CUSTODY_CHUNK_CHALLENGES: 2
# [customized]
MAX_CUSTODY_CHUNK_CHALLENGE_RESP: 8
# 2**0 (= 1)
MAX_CUSTODY_SLASHINGS: 1

# Reward and penalty quotients
# ---------------------------------------------------------------
EARLY_DERIVED_SECRET_REVEAL_SLOT_REWARD_MULTIPLE: 2
# 2**8 (= 256)
MINOR_REWARD_QUOTIENT: 256

# Signature domains
# ---------------------------------------------------------------
DOMAIN_CUSTODY_BIT_SLASHING: 0x83000000
DOMAIN_LIGHT_SELECTION_PROOF: 0x84000000
DOMAIN_LIGHT_AGGREGATE_AND_PROOF: 0x85000000
7 changes: 7 additions & 0 deletions configs/minimal/merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Minimal preset - The Merge

# Fork
# ---------------------------------------------------------------
MERGE_FORK_VERSION: 0x02000001
# TBD
MERGE_FORK_SLOT: 0
Loading