Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
djrtwo committed May 14, 2021
2 parents 0d22e08 + 7e0cc36 commit cfba8f5
Show file tree
Hide file tree
Showing 107 changed files with 3,178 additions and 992 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ eth2.0-spec-tests/
# Dynamically built from Markdown spec
tests/core/pyspec/eth2spec/phase0/
tests/core/pyspec/eth2spec/altair/
tests/core/pyspec/eth2spec/merge/

# coverage reports
.htmlcov
Expand Down
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ SPEC_DIR = ./specs
SSZ_DIR = ./ssz
TEST_LIBS_DIR = ./tests/core
TEST_GENERATORS_DIR = ./tests/generators
# The working dir during testing
PY_SPEC_DIR = $(TEST_LIBS_DIR)/pyspec
ETH2SPEC_MODULE_DIR = $(PY_SPEC_DIR)/eth2spec
TEST_REPORT_DIR = $(PY_SPEC_DIR)/test-reports
TEST_VECTOR_DIR = ../eth2.0-spec-tests/tests
GENERATOR_DIR = ./tests/generators
SOLIDITY_DEPOSIT_CONTRACT_DIR = ./solidity_deposit_contract
Expand All @@ -27,7 +30,8 @@ MARKDOWN_FILES = $(wildcard $(SPEC_DIR)/phase0/*.md) $(wildcard $(SPEC_DIR)/alta
$(wildcard $(SPEC_DIR)/sharding/*.md)

COV_HTML_OUT=.htmlcov
COV_INDEX_FILE=$(PY_SPEC_DIR)/$(COV_HTML_OUT)/index.html
COV_HTML_OUT_DIR=$(PY_SPEC_DIR)/$(COV_HTML_OUT)
COV_INDEX_FILE=$(COV_HTML_OUT_DIR)/index.html

CURRENT_DIR = ${CURDIR}
LINTER_CONFIG_FILE = $(CURRENT_DIR)/linter.ini
Expand All @@ -53,16 +57,17 @@ partial_clean:
rm -f .coverage
rm -rf $(PY_SPEC_DIR)/.pytest_cache
rm -rf $(DEPOSIT_CONTRACT_TESTER_DIR)/.pytest_cache
rm -rf $(PY_SPEC_DIR)/phase0
rm -rf $(PY_SPEC_DIR)/altair
rm -rf $(PY_SPEC_DIR)/$(COV_HTML_OUT)
rm -rf $(PY_SPEC_DIR)/.coverage
rm -rf $(PY_SPEC_DIR)/test-reports
rm -rf $(ETH2SPEC_MODULE_DIR)/phase0
rm -rf $(ETH2SPEC_MODULE_DIR)/altair
rm -rf $(ETH2SPEC_MODULE_DIR)/merge
rm -rf $(COV_HTML_OUT_DIR)
rm -rf $(TEST_REPORT_DIR)
rm -rf eth2spec.egg-info dist build
rm -rf build

clean: partial_clean
rm -rf venv
# legacy cleanup. The pyspec venv should be located at the repository root
rm -rf $(PY_SPEC_DIR)/venv
rm -rf $(DEPOSIT_CONTRACT_COMPILER_DIR)/venv
rm -rf $(DEPOSIT_CONTRACT_TESTER_DIR)/venv
Expand All @@ -87,7 +92,7 @@ pyspec:

# installs the packages to run pyspec tests
install_test:
python3 -m venv venv; . venv/bin/activate; python3 -m pip install .[lint]; python3 -m pip install -e .[test]
python3 -m venv venv; . venv/bin/activate; python3 -m pip install -e .[lint]; python3 -m pip install -e .[test]

test: pyspec
. venv/bin/activate; cd $(PY_SPEC_DIR); \
Expand Down Expand Up @@ -119,7 +124,7 @@ codespell:
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.altair
&& mypy --config-file $(LINTER_CONFIG_FILE) -p eth2spec.phase0 -p eth2spec.altair -p eth2spec.merge

lint_generators: pyspec
. venv/bin/activate; cd $(TEST_GENERATORS_DIR); \
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ The current features are:
* [Deposit Contract](specs/phase0/deposit-contract.md)
* [Honest Validator](specs/phase0/validator.md)
* [P2P Networking](specs/phase0/p2p-interface.md)
* [Weak Subjectivity](specs/phase0/weak-subjectivity.md)

### Altair

* [Beacon chain changes](specs/altair/beacon-chain.md)
* [Altair fork](specs/altair/fork.md)
* [Light client sync protocol](specs/altair/sync-protocol.md)
* [Honest Validator guide changes](specs/altair/validator.md)
* [P2P Networking](specs/altair/p2p-interface.md)

### Merge

Expand Down
2 changes: 1 addition & 1 deletion configs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Over time, the need to sync an older state may be deprecated.
In this case, the prefix on the new constant may be removed, and the old constant will keep a special name before completely being removed.

A previous iteration of forking made use of "timelines", but this collides with the definitions used in the spec (constants for special forking slots, etc.), and was not integrated sufficiently in any of the spec tools or implementations.
Instead, the config essentially doubles as fork definition now, e.g. changing the value for `ALTAIR_FORK_SLOT` changes the fork.
Instead, the config essentially doubles as fork definition now, e.g. changing the value for `ALTAIR_FORK_EPOCH` changes the fork.

Another reason to prefer forking through constants is the ability to program a forking moment based on context, instead of being limited to a static slot number.

Expand Down
34 changes: 17 additions & 17 deletions configs/mainnet/altair.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Mainnet preset - Altair

CONFIG_NAME: "mainnet"

# Updated penalty values
# ---------------------------------------------------------------
# 3 * 2**24 (= 50,331,648)
Expand All @@ -12,20 +10,20 @@ MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR: 64
PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR: 2


# Misc
# Sync committee
# ---------------------------------------------------------------
# 2**10 (= 1,024)
SYNC_COMMITTEE_SIZE: 1024
# 2**6 (= 64)
SYNC_PUBKEYS_PER_AGGREGATE: 64
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4
# 2**9 (= 512)
SYNC_COMMITTEE_SIZE: 512
# 2**9 (= 512)
EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 512


# Time parameters
# Misc
# ---------------------------------------------------------------
# 2**8 (= 256)
EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 256
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4
# 2**4 (= 16)
INACTIVITY_SCORE_RECOVERY_RATE: 16


# Signature domains
Expand All @@ -40,14 +38,16 @@ DOMAIN_CONTRIBUTION_AND_PROOF: 0x09000000
# 0x01000000
ALTAIR_FORK_VERSION: 0x01000000
# TBD
ALTAIR_FORK_SLOT: 18446744073709551615
ALTAIR_FORK_EPOCH: 18446744073709551615


# Sync protocol
# ---------------------------------------------------------------
# 1
MIN_SYNC_COMMITTEE_PARTICIPANTS: 1
# 2**13
MAX_VALID_LIGHT_CLIENT_UPDATES: 8192
# 2**13 (=8192)
LIGHT_CLIENT_UPDATE_TIMEOUT: 8192


# Validator
# ---------------------------------------------------------------
# 2**2 (= 4)
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE: 4
2 changes: 0 additions & 2 deletions configs/mainnet/custody_game.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Mainnet preset - Custody Game

CONFIG_NAME: "mainnet"

# Time parameters
# ---------------------------------------------------------------
# 2**1 (= 2) epochs, 12.8 minutes
Expand Down
4 changes: 1 addition & 3 deletions configs/mainnet/merge.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Mainnet preset - The Merge

CONFIG_NAME: "mainnet"

# Fork
# ---------------------------------------------------------------
MERGE_FORK_VERSION: 0x02000000
# TBD, temporarily max uint64 value: 2**64 - 1
MERGE_FORK_SLOT: 18446744073709551615
MERGE_FORK_EPOCH: 18446744073709551615
2 changes: 0 additions & 2 deletions configs/mainnet/phase0.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Mainnet preset

CONFIG_NAME: "mainnet"

# Misc
# ---------------------------------------------------------------
# 2**6 (= 64)
Expand Down
4 changes: 1 addition & 3 deletions configs/mainnet/sharding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Mainnet preset - Sharding

CONFIG_NAME: "mainnet"

# Fork
# ---------------------------------------------------------------
SHARDING_FORK_VERSION: 0x03000000
# TBD, temporarily max uint64 value: 2**64 - 1
SHARDING_FORK_SLOT: 18446744073709551615
SHARDING_FORK_EPOCH: 18446744073709551615


# Beacon-chain
Expand Down
29 changes: 15 additions & 14 deletions configs/minimal/altair.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Minimal preset - Altair

CONFIG_NAME: "minimal"

# Updated penalty values
# ---------------------------------------------------------------
# 3 * 2**24 (= 50,331,648)
Expand All @@ -12,20 +10,20 @@ MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR: 64
PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR: 2


# Misc
# Sync committee
# ---------------------------------------------------------------
# [customized]
SYNC_COMMITTEE_SIZE: 32
# [customized]
SYNC_PUBKEYS_PER_AGGREGATE: 16
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4
EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 8


# Time parameters
# Misc
# ---------------------------------------------------------------
# [customized]
EPOCHS_PER_SYNC_COMMITTEE_PERIOD: 8
# 2**2 (= 4)
INACTIVITY_SCORE_BIAS: 4
# 2**4 (= 16)
INACTIVITY_SCORE_RECOVERY_RATE: 16


# Signature domains
Expand All @@ -40,14 +38,17 @@ DOMAIN_CONTRIBUTION_AND_PROOF: 0x09000000
# [customized] Highest byte set to 0x01 to avoid collisions with mainnet versioning
ALTAIR_FORK_VERSION: 0x01000001
# [customized]
ALTAIR_FORK_SLOT: 18446744073709551615
ALTAIR_FORK_EPOCH: 18446744073709551615


# Sync protocol
# ---------------------------------------------------------------
# 1
MIN_SYNC_COMMITTEE_PARTICIPANTS: 1
# [customized]
MAX_VALID_LIGHT_CLIENT_UPDATES: 32
# [customized]
LIGHT_CLIENT_UPDATE_TIMEOUT: 32



# Validator
# ---------------------------------------------------------------
# 2**2 (= 4)
TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE: 4
2 changes: 0 additions & 2 deletions configs/minimal/custody_game.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Minimal preset - Custody Game

CONFIG_NAME: "minimal"

# Time parameters
# ---------------------------------------------------------------
# 2**1 (= 2) epochs, 12.8 minutes
Expand Down
4 changes: 1 addition & 3 deletions configs/minimal/merge.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# Minimal preset - The Merge

CONFIG_NAME: "minimal"

# Fork
# ---------------------------------------------------------------
MERGE_FORK_VERSION: 0x02000001
# TBD, temporarily max uint64 value: 2**64 - 1
MERGE_FORK_SLOT: 18446744073709551615
MERGE_FORK_EPOCH: 18446744073709551615
2 changes: 0 additions & 2 deletions configs/minimal/phase0.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Minimal preset

CONFIG_NAME: "minimal"

# Misc
# ---------------------------------------------------------------

Expand Down
4 changes: 1 addition & 3 deletions configs/minimal/sharding.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Minimal preset - Sharding

CONFIG_NAME: "minimal"

# Fork
# ---------------------------------------------------------------
SHARDING_FORK_VERSION: 0x03000001
# TBD, temporarily max uint64 value: 2**64 - 1
MERGE_FORK_SLOT: 18446744073709551615
MERGE_FORK_EPOCH: 18446744073709551615


# Beacon-chain
Expand Down
Loading

0 comments on commit cfba8f5

Please sign in to comment.