Merge pull request #1512 from MrChico/toc_ci

Check table of content of markdown files with CI
This commit is contained in:
Danny Ryan 2019-12-12 09:47:38 -07:00 committed by GitHub
commit 7343baf85a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 478 additions and 370 deletions

View File

@ -103,6 +103,15 @@ jobs:
command: make citest command: make citest
- store_test_results: - store_test_results:
path: test_libs/pyspec/test-reports path: test_libs/pyspec/test-reports
table_of_contents:
docker:
- image: circleci/node:10.16.3
working_directory: ~/specs-repo
steps:
- checkout
- run:
name: Check table of contents
command: sudo npm install -g doctoc && make check_toc
lint: lint:
docker: docker:
- image: circleci/python:3.6 - image: circleci/python:3.6
@ -148,6 +157,7 @@ workflows:
- test: - test:
requires: requires:
- install_pyspec_test - install_pyspec_test
- table_of_contents
- lint: - lint:
requires: requires:
- test - test

View File

@ -17,18 +17,22 @@ GENERATOR_VENVS = $(patsubst $(GENERATOR_DIR)/%, $(GENERATOR_DIR)/%venv, $(GENER
#$(info $$GENERATOR_TARGETS is [${GENERATOR_TARGETS}]) #$(info $$GENERATOR_TARGETS is [${GENERATOR_TARGETS}])
PY_SPEC_PHASE_0_TARGETS = $(PY_SPEC_DIR)/eth2spec/phase0/spec.py PY_SPEC_PHASE_0_TARGETS = $(PY_SPEC_DIR)/eth2spec/phase0/spec.py
PY_SPEC_PHASE_0_DEPS = $(SPEC_DIR)/core/0_*.md PY_SPEC_PHASE_0_DEPS = $(wildcard $(SPEC_DIR)/core/0_*.md)
PY_SPEC_PHASE_1_TARGETS = $(PY_SPEC_DIR)/eth2spec/phase1/spec.py PY_SPEC_PHASE_1_TARGETS = $(PY_SPEC_DIR)/eth2spec/phase1/spec.py
PY_SPEC_PHASE_1_DEPS = $(SPEC_DIR)/core/1_*.md PY_SPEC_PHASE_1_DEPS = $(wildcard $(SPEC_DIR)/core/1_*.md)
PY_SPEC_ALL_DEPS = $(PY_SPEC_PHASE_0_DEPS) $(PY_SPEC_PHASE_1_DEPS)
PY_SPEC_ALL_TARGETS = $(PY_SPEC_PHASE_0_TARGETS) $(PY_SPEC_PHASE_1_TARGETS) PY_SPEC_ALL_TARGETS = $(PY_SPEC_PHASE_0_TARGETS) $(PY_SPEC_PHASE_1_TARGETS)
MARKDOWN_FILES = $(PY_SPEC_ALL_DEPS) $(wildcard $(SPEC_DIR)/*.md) $(wildcard $(SPEC_DIR)/light_client/*.md) $(wildcard $(SPEC_DIR)/networking/*.md) $(wildcard $(SPEC_DIR)/validator/*.md)
COV_HTML_OUT=.htmlcov COV_HTML_OUT=.htmlcov
COV_INDEX_FILE=$(PY_SPEC_DIR)/$(COV_HTML_OUT)/index.html COV_INDEX_FILE=$(PY_SPEC_DIR)/$(COV_HTML_OUT)/index.html
.PHONY: clean partial_clean all test citest lint generate_tests pyspec phase0 phase1 install_test open_cov \ .PHONY: clean partial_clean all test citest lint generate_tests pyspec phase0 phase1 install_test open_cov \
install_deposit_contract_test test_deposit_contract compile_deposit_contract install_deposit_contract_test test_deposit_contract compile_deposit_contract check_toc
all: $(PY_SPEC_ALL_TARGETS) all: $(PY_SPEC_ALL_TARGETS)
@ -65,6 +69,14 @@ citest: $(PY_SPEC_ALL_TARGETS)
open_cov: open_cov:
((open "$(COV_INDEX_FILE)" || xdg-open "$(COV_INDEX_FILE)") &> /dev/null) & ((open "$(COV_INDEX_FILE)" || xdg-open "$(COV_INDEX_FILE)") &> /dev/null) &
check_toc: $(MARKDOWN_FILES:=.toc)
%.toc:
cp $* $*.tmp && \
doctoc $* && \
diff -q $* $*.tmp && \
rm $*.tmp
lint: $(PY_SPEC_ALL_TARGETS) lint: $(PY_SPEC_ALL_TARGETS)
cd $(PY_SPEC_DIR); . venv/bin/activate; \ cd $(PY_SPEC_DIR); . venv/bin/activate; \
flake8 --ignore=E252,W504,W503 --max-line-length=120 ./eth2spec \ flake8 --ignore=E252,W504,W503 --max-line-length=120 ./eth2spec \

View File

@ -6,23 +6,25 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [BLS signature verification](#bls-signature-verification)
- [Table of contents](#table-of-contents) - [Curve parameters](#curve-parameters)
- [Curve parameters](#curve-parameters) - [Point representations](#point-representations)
- [Point representations](#point-representations)
- [G1 points](#g1-points) - [G1 points](#g1-points)
- [G2 points](#g2-points) - [G2 points](#g2-points)
- [Helpers](#helpers) - [Helpers](#helpers)
- [`hash_to_G2`](#hash_to_g2) - [`hash_to_G2`](#hash_to_g2)
- [`modular_squareroot`](#modular_squareroot) - [`modular_squareroot`](#modular_squareroot)
- [Aggregation operations](#aggregation-operations) - [Aggregation operations](#aggregation-operations)
- [`bls_aggregate_pubkeys`](#bls_aggregate_pubkeys) - [`bls_aggregate_pubkeys`](#bls_aggregate_pubkeys)
- [`bls_aggregate_signatures`](#bls_aggregate_signatures) - [`bls_aggregate_signatures`](#bls_aggregate_signatures)
- [Signature verification](#signature-verification) - [Signature verification](#signature-verification)
- [`bls_verify`](#bls_verify) - [`bls_verify`](#bls_verify)
- [`bls_verify_multiple`](#bls_verify_multiple) - [`bls_verify_multiple`](#bls_verify_multiple)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Curve parameters ## Curve parameters

View File

@ -4,14 +4,15 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Ethereum 2.0 Phase 0 -- The Beacon Chain](#ethereum-20-phase-0----the-beacon-chain)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Notation](#notation)
- [Notation](#notation) - [Custom types](#custom-types)
- [Custom types](#custom-types) - [Constants](#constants)
- [Constants](#constants) - [Configuration](#configuration)
- [Configuration](#configuration)
- [Misc](#misc) - [Misc](#misc)
- [Gwei values](#gwei-values) - [Gwei values](#gwei-values)
- [Initial values](#initial-values) - [Initial values](#initial-values)
@ -20,7 +21,7 @@
- [Rewards and penalties](#rewards-and-penalties) - [Rewards and penalties](#rewards-and-penalties)
- [Max operations per block](#max-operations-per-block) - [Max operations per block](#max-operations-per-block)
- [Domain types](#domain-types) - [Domain types](#domain-types)
- [Containers](#containers) - [Containers](#containers)
- [Misc dependencies](#misc-dependencies) - [Misc dependencies](#misc-dependencies)
- [`Fork`](#fork) - [`Fork`](#fork)
- [`Checkpoint`](#checkpoint) - [`Checkpoint`](#checkpoint)
@ -48,7 +49,7 @@
- [`SignedVoluntaryExit`](#signedvoluntaryexit) - [`SignedVoluntaryExit`](#signedvoluntaryexit)
- [`SignedBeaconBlock`](#signedbeaconblock) - [`SignedBeaconBlock`](#signedbeaconblock)
- [`SignedBeaconBlockHeader`](#signedbeaconblockheader) - [`SignedBeaconBlockHeader`](#signedbeaconblockheader)
- [Helper functions](#helper-functions) - [Helper functions](#helper-functions)
- [Math](#math) - [Math](#math)
- [`integer_squareroot`](#integer_squareroot) - [`integer_squareroot`](#integer_squareroot)
- [`xor`](#xor) - [`xor`](#xor)
@ -61,8 +62,6 @@
- [`bls_aggregate_pubkeys`](#bls_aggregate_pubkeys) - [`bls_aggregate_pubkeys`](#bls_aggregate_pubkeys)
- [Predicates](#predicates) - [Predicates](#predicates)
- [`is_active_validator`](#is_active_validator) - [`is_active_validator`](#is_active_validator)
- [`is_eligible_for_activation_queue`](#is_eligible_for_activation_queue)
- [`is_eligible_for_activation`](#is_eligible_for_activation)
- [`is_slashable_validator`](#is_slashable_validator) - [`is_slashable_validator`](#is_slashable_validator)
- [`is_slashable_attestation_data`](#is_slashable_attestation_data) - [`is_slashable_attestation_data`](#is_slashable_attestation_data)
- [`is_valid_indexed_attestation`](#is_valid_indexed_attestation) - [`is_valid_indexed_attestation`](#is_valid_indexed_attestation)
@ -97,10 +96,10 @@
- [`decrease_balance`](#decrease_balance) - [`decrease_balance`](#decrease_balance)
- [`initiate_validator_exit`](#initiate_validator_exit) - [`initiate_validator_exit`](#initiate_validator_exit)
- [`slash_validator`](#slash_validator) - [`slash_validator`](#slash_validator)
- [Genesis](#genesis) - [Genesis](#genesis)
- [Genesis state](#genesis-state) - [Genesis state](#genesis-state)
- [Genesis block](#genesis-block) - [Genesis block](#genesis-block)
- [Beacon chain state transition function](#beacon-chain-state-transition-function) - [Beacon chain state transition function](#beacon-chain-state-transition-function)
- [Epoch processing](#epoch-processing) - [Epoch processing](#epoch-processing)
- [Helper functions](#helper-functions-1) - [Helper functions](#helper-functions-1)
- [Justification and finalization](#justification-and-finalization) - [Justification and finalization](#justification-and-finalization)
@ -119,6 +118,7 @@
- [Deposits](#deposits) - [Deposits](#deposits)
- [Voluntary exits](#voluntary-exits) - [Voluntary exits](#voluntary-exits)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction

View File

@ -4,19 +4,21 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Ethereum 2.0 Phase 0 -- Deposit Contract](#ethereum-20-phase-0----deposit-contract)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Constants](#constants)
- [Constants](#constants)
- [Contract](#contract) - [Contract](#contract)
- [Ethereum 1.0 deposit contract](#ethereum-10-deposit-contract) - [Ethereum 1.0 deposit contract](#ethereum-10-deposit-contract)
- [`deposit` function](#deposit-function) - [`deposit` function](#deposit-function)
- [Deposit amount](#deposit-amount) - [Deposit amount](#deposit-amount)
- [Withdrawal credentials](#withdrawal-credentials) - [Withdrawal credentials](#withdrawal-credentials)
- [`DepositEvent` log](#depositevent-log) - [`DepositEvent` log](#depositevent-log)
- [Vyper code](#vyper-code) - [Vyper code](#vyper-code)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction

View File

@ -4,16 +4,17 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Ethereum 2.0 Phase 0 -- Beacon Chain Fork Choice](#ethereum-20-phase-0----beacon-chain-fork-choice)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Fork choice](#fork-choice)
- [Fork choice](#fork-choice) - [Configuration](#configuration)
- [Helpers](#helpers) - [Helpers](#helpers)
- [`LatestMessage`](#latestmessage) - [`LatestMessage`](#latestmessage)
- [`Store`](#store) - [`Store`](#store)
- [`get_genesis_store`](#get_genesis_store) - [`get_genesis_store`](#get_genesis_store)
- [`get_slots_since_genesis`](#get_slots_since_genesis)
- [`get_current_slot`](#get_current_slot) - [`get_current_slot`](#get_current_slot)
- [`compute_slots_since_epoch_start`](#compute_slots_since_epoch_start) - [`compute_slots_since_epoch_start`](#compute_slots_since_epoch_start)
- [`get_ancestor`](#get_ancestor) - [`get_ancestor`](#get_ancestor)
@ -27,6 +28,7 @@
- [`on_block`](#on_block) - [`on_block`](#on_block)
- [`on_attestation`](#on_attestation) - [`on_attestation`](#on_attestation)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction

View File

@ -3,15 +3,16 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Phase 1 miscellaneous beacon chain changes](#phase-1-miscellaneous-beacon-chain-changes)
- [Table of contents](#table-of-contents) - [Configuration](#configuration)
- [Configuration](#configuration) - [Containers](#containers)
- [Containers](#containers)
- [`CompactCommittee`](#compactcommittee) - [`CompactCommittee`](#compactcommittee)
- [`ShardReceiptDelta`](#shardreceiptdelta) - [`ShardReceiptDelta`](#shardreceiptdelta)
- [`ShardReceiptProof`](#shardreceiptproof) - [`ShardReceiptProof`](#shardreceiptproof)
- [Helper functions](#helper-functions) - [Helper functions](#helper-functions)
- [`pack_compact_validator`](#pack_compact_validator) - [`pack_compact_validator`](#pack_compact_validator)
- [`unpack_compact_validator`](#unpack_compact_validator) - [`unpack_compact_validator`](#unpack_compact_validator)
- [`committee_to_compact_committee`](#committee_to_compact_committee) - [`committee_to_compact_committee`](#committee_to_compact_committee)
@ -19,13 +20,14 @@
- [`compute_historical_state_generalized_index`](#compute_historical_state_generalized_index) - [`compute_historical_state_generalized_index`](#compute_historical_state_generalized_index)
- [`get_generalized_index_of_crosslink_header`](#get_generalized_index_of_crosslink_header) - [`get_generalized_index_of_crosslink_header`](#get_generalized_index_of_crosslink_header)
- [`process_shard_receipt_proof`](#process_shard_receipt_proof) - [`process_shard_receipt_proof`](#process_shard_receipt_proof)
- [Changes](#changes) - [Changes](#changes)
- [Phase 0 container updates](#phase-0-container-updates) - [Phase 0 container updates](#phase-0-container-updates)
- [`BeaconState`](#beaconstate) - [`BeaconState`](#beaconstate)
- [`BeaconBlockBody`](#beaconblockbody) - [`BeaconBlockBody`](#beaconblockbody)
- [Persistent committees](#persistent-committees) - [Persistent committees](#persistent-committees)
- [Shard receipt processing](#shard-receipt-processing) - [Shard receipt processing](#shard-receipt-processing)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Configuration ## Configuration

View File

@ -5,12 +5,13 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Ethereum 2.0 Phase 1 -- Custody Game](#ethereum-20-phase-1----custody-game)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Terminology](#terminology)
- [Terminology](#terminology) - [Constants](#constants)
- [Constants](#constants)
- [Misc](#misc) - [Misc](#misc)
- [Custody game parameters](#custody-game-parameters) - [Custody game parameters](#custody-game-parameters)
- [Time parameters](#time-parameters) - [Time parameters](#time-parameters)
@ -18,7 +19,7 @@
- [Reward and penalty quotients](#reward-and-penalty-quotients) - [Reward and penalty quotients](#reward-and-penalty-quotients)
- [Signature domain types](#signature-domain-types) - [Signature domain types](#signature-domain-types)
- [TODO PLACEHOLDER](#todo-placeholder) - [TODO PLACEHOLDER](#todo-placeholder)
- [Data structures](#data-structures) - [Data structures](#data-structures)
- [Custody objects](#custody-objects) - [Custody objects](#custody-objects)
- [`CustodyChunkChallenge`](#custodychunkchallenge) - [`CustodyChunkChallenge`](#custodychunkchallenge)
- [`CustodyBitChallenge`](#custodybitchallenge) - [`CustodyBitChallenge`](#custodybitchallenge)
@ -32,7 +33,7 @@
- [`Validator`](#validator) - [`Validator`](#validator)
- [`BeaconState`](#beaconstate) - [`BeaconState`](#beaconstate)
- [`BeaconBlockBody`](#beaconblockbody) - [`BeaconBlockBody`](#beaconblockbody)
- [Helpers](#helpers) - [Helpers](#helpers)
- [`ceillog2`](#ceillog2) - [`ceillog2`](#ceillog2)
- [`is_valid_merkle_branch_with_mixin`](#is_valid_merkle_branch_with_mixin) - [`is_valid_merkle_branch_with_mixin`](#is_valid_merkle_branch_with_mixin)
- [`get_crosslink_chunk_count`](#get_crosslink_chunk_count) - [`get_crosslink_chunk_count`](#get_crosslink_chunk_count)
@ -43,16 +44,17 @@
- [`get_randao_epoch_for_custody_period`](#get_randao_epoch_for_custody_period) - [`get_randao_epoch_for_custody_period`](#get_randao_epoch_for_custody_period)
- [`get_custody_period_for_validator`](#get_custody_period_for_validator) - [`get_custody_period_for_validator`](#get_custody_period_for_validator)
- [`replace_empty_or_append`](#replace_empty_or_append) - [`replace_empty_or_append`](#replace_empty_or_append)
- [Per-block processing](#per-block-processing) - [Per-block processing](#per-block-processing)
- [Operations](#operations) - [Operations](#operations)
- [Custody key reveals](#custody-key-reveals) - [Custody key reveals](#custody-key-reveals)
- [Early derived secret reveals](#early-derived-secret-reveals) - [Early derived secret reveals](#early-derived-secret-reveals)
- [Chunk challenges](#chunk-challenges) - [Chunk challenges](#chunk-challenges)
- [Bit challenges](#bit-challenges) - [Bit challenges](#bit-challenges)
- [Custody responses](#custody-responses) - [Custody responses](#custody-responses)
- [Per-epoch processing](#per-epoch-processing) - [Per-epoch processing](#per-epoch-processing)
- [Handling of custody-related deadlines](#handling-of-custody-related-deadlines) - [Handling of custody-related deadlines](#handling-of-custody-related-deadlines)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction

View File

@ -5,25 +5,26 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Ethereum 2.0 Phase 1 -- Shard Data Chains](#ethereum-20-phase-1----shard-data-chains)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Custom types](#custom-types)
- [Custom types](#custom-types) - [Configuration](#configuration)
- [Configuration](#configuration)
- [Misc](#misc) - [Misc](#misc)
- [Initial values](#initial-values) - [Initial values](#initial-values)
- [Time parameters](#time-parameters) - [Time parameters](#time-parameters)
- [State list lengths](#state-list-lengths) - [State list lengths](#state-list-lengths)
- [Rewards and penalties](#rewards-and-penalties) - [Rewards and penalties](#rewards-and-penalties)
- [Signature domain types](#signature-domain-types) - [Signature domain types](#signature-domain-types)
- [Containers](#containers) - [Containers](#containers)
- [`Crosslink`](#crosslink) - [`Crosslink`](#crosslink)
- [`ShardBlock`](#shardblock) - [`ShardBlock`](#shardblock)
- [`ShardBlockHeader`](#shardblockheader) - [`ShardBlockHeader`](#shardblockheader)
- [`ShardState`](#shardstate) - [`ShardState`](#shardstate)
- [`ShardAttestationData`](#shardattestationdata) - [`ShardAttestationData`](#shardattestationdata)
- [Helper functions](#helper-functions) - [Helper functions](#helper-functions)
- [Misc](#misc-1) - [Misc](#misc-1)
- [`compute_epoch_of_shard_slot`](#compute_epoch_of_shard_slot) - [`compute_epoch_of_shard_slot`](#compute_epoch_of_shard_slot)
- [`compute_shard_period_start_epoch`](#compute_shard_period_start_epoch) - [`compute_shard_period_start_epoch`](#compute_shard_period_start_epoch)
@ -33,17 +34,18 @@
- [`get_shard_proposer_index`](#get_shard_proposer_index) - [`get_shard_proposer_index`](#get_shard_proposer_index)
- [Shard state mutators](#shard-state-mutators) - [Shard state mutators](#shard-state-mutators)
- [`process_delta`](#process_delta) - [`process_delta`](#process_delta)
- [Genesis](#genesis) - [Genesis](#genesis)
- [`get_genesis_shard_state`](#get_genesis_shard_state) - [`get_genesis_shard_state`](#get_genesis_shard_state)
- [`get_genesis_shard_block`](#get_genesis_shard_block) - [`get_genesis_shard_block`](#get_genesis_shard_block)
- [Shard state transition function](#shard-state-transition-function) - [Shard state transition function](#shard-state-transition-function)
- [Period processing](#period-processing) - [Period processing](#period-processing)
- [Block processing](#block-processing) - [Block processing](#block-processing)
- [Block header](#block-header) - [Block header](#block-header)
- [Attestations](#attestations) - [Attestations](#attestations)
- [Block body](#block-body) - [Block body](#block-body)
- [Shard fork choice rule](#shard-fork-choice-rule) - [Shard fork choice rule](#shard-fork-choice-rule)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction

View File

@ -4,12 +4,13 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Merkle proof formats](#merkle-proof-formats)
- [Table of contents](#table-of-contents) - [Helper functions](#helper-functions)
- [Helper functions](#helper-functions) - [Generalized Merkle tree index](#generalized-merkle-tree-index)
- [Generalized Merkle tree index](#generalized-merkle-tree-index) - [SSZ object to index](#ssz-object-to-index)
- [SSZ object to index](#ssz-object-to-index)
- [Helpers for generalized indices](#helpers-for-generalized-indices) - [Helpers for generalized indices](#helpers-for-generalized-indices)
- [`concat_generalized_indices`](#concat_generalized_indices) - [`concat_generalized_indices`](#concat_generalized_indices)
- [`get_generalized_index_length`](#get_generalized_index_length) - [`get_generalized_index_length`](#get_generalized_index_length)
@ -17,8 +18,9 @@
- [`generalized_index_sibling`](#generalized_index_sibling) - [`generalized_index_sibling`](#generalized_index_sibling)
- [`generalized_index_child`](#generalized_index_child) - [`generalized_index_child`](#generalized_index_child)
- [`generalized_index_parent`](#generalized_index_parent) - [`generalized_index_parent`](#generalized_index_parent)
- [Merkle multiproofs](#merkle-multiproofs) - [Merkle multiproofs](#merkle-multiproofs)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Helper functions ## Helper functions

View File

@ -5,20 +5,22 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Minimal Light Client Design](#minimal-light-client-design)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Custom types](#custom-types)
- [Custom types](#custom-types) - [Constants](#constants)
- [Constants](#constants) - [Containers](#containers)
- [Containers](#containers)
- [`LightClientUpdate`](#lightclientupdate) - [`LightClientUpdate`](#lightclientupdate)
- [Helpers](#helpers) - [Helpers](#helpers)
- [`LightClientMemory`](#lightclientmemory) - [`LightClientMemory`](#lightclientmemory)
- [`get_persistent_committee_pubkeys_and_balances`](#get_persistent_committee_pubkeys_and_balances) - [`get_persistent_committee_pubkeys_and_balances`](#get_persistent_committee_pubkeys_and_balances)
- [Light client state updates](#light-client-state-updates) - [Light client state updates](#light-client-state-updates)
- [Data overhead](#data-overhead) - [Data overhead](#data-overhead)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction

View File

@ -18,23 +18,88 @@ It consists of four main sections:
- [Network fundamentals](#network-fundamentals) - [Network fundamentals](#network-fundamentals)
- [Transport](#transport) - [Transport](#transport)
- [Interop](#interop)
- [Mainnet](#mainnet)
- [Encryption and identification](#encryption-and-identification) - [Encryption and identification](#encryption-and-identification)
- [Protocol negotiation](#protocol-negotiation) - [Interop](#interop-1)
- [Mainnet](#mainnet-1)
- [Protocol Negotiation](#protocol-negotiation)
- [Interop](#interop-2)
- [Mainnet](#mainnet-2)
- [Multiplexing](#multiplexing) - [Multiplexing](#multiplexing)
- [Eth2 network interaction domains](#eth2-network-interaction-domains) - [Eth2 network interaction domains](#eth2-network-interaction-domains)
- [Configuration](#configuration) - [Configuration](#configuration)
- [The gossip domain: gossipsub](#the-gossip-domain-gossipsub) - [The gossip domain: gossipsub](#the-gossip-domain-gossipsub)
- [Topics and messages](#topics-and-messages)
- [Global topics](#global-topics)
- [Attestation subnets](#attestation-subnets)
- [Interop](#interop-3)
- [Mainnet](#mainnet-3)
- [Encodings](#encodings)
- [Interop](#interop-4)
- [Mainnet](#mainnet-4)
- [The Req/Resp domain](#the-reqresp-domain) - [The Req/Resp domain](#the-reqresp-domain)
- [Protocol identification](#protocol-identification)
- [Req/Resp interaction](#reqresp-interaction)
- [Requesting side](#requesting-side)
- [Responding side](#responding-side)
- [Encoding strategies](#encoding-strategies)
- [SSZ-encoding strategy (with or without Snappy)](#ssz-encoding-strategy-with-or-without-snappy)
- [Messages](#messages)
- [Status](#status)
- [Goodbye](#goodbye)
- [BeaconBlocksByRange](#beaconblocksbyrange)
- [BeaconBlocksByRoot](#beaconblocksbyroot)
- [The discovery domain: discv5](#the-discovery-domain-discv5) - [The discovery domain: discv5](#the-discovery-domain-discv5)
- [Integration into libp2p stacks](#integration-into-libp2p-stacks)
- [ENR structure](#enr-structure)
- [Interop](#interop-5)
- [Mainnet](#mainnet-5)
- [Topic advertisement](#topic-advertisement)
- [Interop](#interop-6)
- [Mainnet](#mainnet-6)
- [Design decision rationale](#design-decision-rationale) - [Design decision rationale](#design-decision-rationale)
- [Transport](#transport-1) - [Transport](#transport-1)
- [Why are we defining specific transports?](#why-are-we-defining-specific-transports)
- [Can clients support other transports/handshakes than the ones mandated by the spec?](#can-clients-support-other-transportshandshakes-than-the-ones-mandated-by-the-spec)
- [What are the advantages of using TCP/QUIC/Websockets?](#what-are-the-advantages-of-using-tcpquicwebsockets)
- [Why do we not just support a single transport?](#why-do-we-not-just-support-a-single-transport)
- [Why are we not using QUIC for mainnet from the start?](#why-are-we-not-using-quic-for-mainnet-from-the-start)
- [Multiplexing](#multiplexing-1) - [Multiplexing](#multiplexing-1)
- [Protocol negotiation](#protocol-negotiation-1) - [Why are we using mplex/yamux?](#why-are-we-using-mplexyamux)
- [Protocol Negotiation](#protocol-negotiation-1)
- [When is multiselect 2.0 due and why are we using it for mainnet?](#when-is-multiselect-20-due-and-why-are-we-using-it-for-mainnet)
- [What is the difference between connection-level and stream-level protocol negotiation?](#what-is-the-difference-between-connection-level-and-stream-level-protocol-negotiation)
- [Encryption](#encryption) - [Encryption](#encryption)
- [Why are we using SecIO for interop? Why not for mainnet?](#why-are-we-using-secio-for-interop-why-not-for-mainnet)
- [Why are we using Noise/TLS 1.3 for mainnet?](#why-are-we-using-noisetls-13-for-mainnet)
- [Why are we using encryption at all?](#why-are-we-using-encryption-at-all)
- [Will mainnnet networking be untested when it launches?](#will-mainnnet-networking-be-untested-when-it-launches)
- [Gossipsub](#gossipsub) - [Gossipsub](#gossipsub)
- [Why are we using a pub/sub algorithm for block and attestation propagation?](#why-are-we-using-a-pubsub-algorithm-for-block-and-attestation-propagation)
- [Why are we using topics to segregate encodings, yet only support one encoding?](#why-are-we-using-topics-to-segregate-encodings-yet-only-support-one-encoding)
- [How do we upgrade gossip channels (e.g. changes in encoding, compression)?](#how-do-we-upgrade-gossip-channels-eg-changes-in-encoding-compression)
- [Why must all clients use the same gossip topic instead of one negotiated between each peer pair?](#why-must-all-clients-use-the-same-gossip-topic-instead-of-one-negotiated-between-each-peer-pair)
- [Why are the topics strings and not hashes?](#why-are-the-topics-strings-and-not-hashes)
- [Why are there `ATTESTATION_SUBNET_COUNT` attestation subnets?](#why-are-there-attestation_subnet_count-attestation-subnets)
- [Why are attestations limited to be broadcast on gossip channels within `SLOTS_PER_EPOCH` slots?](#why-are-attestations-limited-to-be-broadcast-on-gossip-channels-within-slots_per_epoch-slots)
- [Why are aggregate attestations broadcast to the global topic as `AggregateAndProof`s rather than just as `Attestation`s?](#why-are-aggregate-attestations-broadcast-to-the-global-topic-as-aggregateandproofs-rather-than-just-as-attestations)
- [Why are we sending entire objects in the pubsub and not just hashes?](#why-are-we-sending-entire-objects-in-the-pubsub-and-not-just-hashes)
- [Should clients gossip blocks if they *cannot* validate the proposer signature due to not yet being synced, not knowing the head block, etc?](#should-clients-gossip-blocks-if-they-cannot-validate-the-proposer-signature-due-to-not-yet-being-synced-not-knowing-the-head-block-etc)
- [How are we going to discover peers in a gossipsub topic?](#how-are-we-going-to-discover-peers-in-a-gossipsub-topic)
- [Req/Resp](#reqresp) - [Req/Resp](#reqresp)
- [Why segregate requests into dedicated protocol IDs?](#why-segregate-requests-into-dedicated-protocol-ids)
- [Why are messages length-prefixed with a protobuf varint in the SSZ-encoding?](#why-are-messages-length-prefixed-with-a-protobuf-varint-in-the-ssz-encoding)
- [Why do we version protocol strings with ordinals instead of semver?](#why-do-we-version-protocol-strings-with-ordinals-instead-of-semver)
- [Why is it called Req/Resp and not RPC?](#why-is-it-called-reqresp-and-not-rpc)
- [Discovery](#discovery) - [Discovery](#discovery)
- [Why are we using discv5 and not libp2p Kademlia DHT?](#why-are-we-using-discv5-and-not-libp2p-kademlia-dht)
- [What is the difference between an ENR and a multiaddr, and why are we using ENRs?](#what-is-the-difference-between-an-enr-and-a-multiaddr-and-why-are-we-using-enrs)
- [Compression/Encoding](#compressionencoding) - [Compression/Encoding](#compressionencoding)
- [Why are we using SSZ for encoding?](#why-are-we-using-ssz-for-encoding)
- [Why are we compressing, and at which layers?](#why-are-we-compressing-and-at-which-layers)
- [Why are using Snappy for compression?](#why-are-using-snappy-for-compression)
- [Can I get access to unencrypted bytes on the wire for debugging purposes?](#can-i-get-access-to-unencrypted-bytes-on-the-wire-for-debugging-purposes)
- [libp2p implementations matrix](#libp2p-implementations-matrix) - [libp2p implementations matrix](#libp2p-implementations-matrix)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@ -567,7 +632,7 @@ Conscious of that, the libp2p community conceptualized [mplex](https://github.co
Overlay multiplexers are not necessary with QUIC since the protocol provides native multiplexing, but they need to be layered atop TCP, WebSockets, and other transports that lack such support. Overlay multiplexers are not necessary with QUIC since the protocol provides native multiplexing, but they need to be layered atop TCP, WebSockets, and other transports that lack such support.
## Protocol negotiation ## Protocol Negotiation
### When is multiselect 2.0 due and why are we using it for mainnet? ### When is multiselect 2.0 due and why are we using it for mainnet?

View File

@ -4,11 +4,12 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [SimpleSerialize (SSZ)](#simpleserialize-ssz)
- [Table of contents](#table-of-contents) - [Constants](#constants)
- [Constants](#constants) - [Typing](#typing)
- [Typing](#typing)
- [Basic types](#basic-types) - [Basic types](#basic-types)
- [Composite types](#composite-types) - [Composite types](#composite-types)
- [Variable-size and fixed-size](#variable-size-and-fixed-size) - [Variable-size and fixed-size](#variable-size-and-fixed-size)
@ -16,18 +17,19 @@
- [Default values](#default-values) - [Default values](#default-values)
- [`is_zero`](#is_zero) - [`is_zero`](#is_zero)
- [Illegal types](#illegal-types) - [Illegal types](#illegal-types)
- [Serialization](#serialization) - [Serialization](#serialization)
- [`uintN`](#uintn) - [`uintN`](#uintn)
- [`boolean`](#boolean) - [`boolean`](#boolean)
- [`null`](#null) - [`null`](#null)
- [`Bitvector[N]`](#bitvectorn) - [`Bitvector[N]`](#bitvectorn)
- [`Bitlist[N]`](#bitlistn) - [`Bitlist[N]`](#bitlistn)
- [Vectors, containers, lists, unions](#vectors-containers-lists-unions) - [Vectors, containers, lists, unions](#vectors-containers-lists-unions)
- [Deserialization](#deserialization) - [Deserialization](#deserialization)
- [Merkleization](#merkleization) - [Merkleization](#merkleization)
- [Summaries and expansions](#summaries-and-expansions) - [Summaries and expansions](#summaries-and-expansions)
- [Implementations](#implementations) - [Implementations](#implementations)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Constants ## Constants

View File

@ -5,14 +5,15 @@
## Table of contents ## Table of contents
<!-- TOC --> <!-- TOC -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Ethereum 2.0 Phase 0 -- Honest Validator](#ethereum-20-phase-0----honest-validator)
- [Table of contents](#table-of-contents) - [Introduction](#introduction)
- [Introduction](#introduction) - [Prerequisites](#prerequisites)
- [Prerequisites](#prerequisites) - [Constants](#constants)
- [Constants](#constants)
- [Misc](#misc) - [Misc](#misc)
- [Becoming a validator](#becoming-a-validator) - [Becoming a validator](#becoming-a-validator)
- [Initialization](#initialization) - [Initialization](#initialization)
- [BLS public key](#bls-public-key) - [BLS public key](#bls-public-key)
- [BLS withdrawal key](#bls-withdrawal-key) - [BLS withdrawal key](#bls-withdrawal-key)
@ -20,23 +21,24 @@
- [Process deposit](#process-deposit) - [Process deposit](#process-deposit)
- [Validator index](#validator-index) - [Validator index](#validator-index)
- [Activation](#activation) - [Activation](#activation)
- [Validator assignments](#validator-assignments) - [Validator assignments](#validator-assignments)
- [Lookahead](#lookahead) - [Lookahead](#lookahead)
- [Beacon chain responsibilities](#beacon-chain-responsibilities) - [Beacon chain responsibilities](#beacon-chain-responsibilities)
- [Block proposal](#block-proposal) - [Block proposal](#block-proposal)
- [Block header](#block-header) - [Preparing for a `BeaconBlock`](#preparing-for-a-beaconblock)
- [Slot](#slot) - [Slot](#slot)
- [Parent root](#parent-root) - [Parent root](#parent-root)
- [State root](#state-root) - [Constructing the `BeaconBlockBody`](#constructing-the-beaconblockbody)
- [Randao reveal](#randao-reveal) - [Randao reveal](#randao-reveal)
- [Eth1 Data](#eth1-data) - [Eth1 Data](#eth1-data)
- [Signature](#signature)
- [Block body](#block-body)
- [Proposer slashings](#proposer-slashings) - [Proposer slashings](#proposer-slashings)
- [Attester slashings](#attester-slashings) - [Attester slashings](#attester-slashings)
- [Attestations](#attestations) - [Attestations](#attestations)
- [Deposits](#deposits) - [Deposits](#deposits)
- [Voluntary exits](#voluntary-exits) - [Voluntary exits](#voluntary-exits)
- [Packaging into a `SignedBeaconBlock`](#packaging-into-a-signedbeaconblock)
- [State root](#state-root)
- [Signature](#signature)
- [Attesting](#attesting) - [Attesting](#attesting)
- [Attestation data](#attestation-data) - [Attestation data](#attestation-data)
- [General](#general) - [General](#general)
@ -55,11 +57,12 @@
- [Aggregate signature](#aggregate-signature-1) - [Aggregate signature](#aggregate-signature-1)
- [Broadcast aggregate](#broadcast-aggregate) - [Broadcast aggregate](#broadcast-aggregate)
- [`AggregateAndProof`](#aggregateandproof) - [`AggregateAndProof`](#aggregateandproof)
- [Phase 0 attestation subnet stability](#phase-0-attestation-subnet-stability) - [Phase 0 attestation subnet stability](#phase-0-attestation-subnet-stability)
- [How to avoid slashing](#how-to-avoid-slashing) - [How to avoid slashing](#how-to-avoid-slashing)
- [Proposer slashing](#proposer-slashing) - [Proposer slashing](#proposer-slashing)
- [Attester slashing](#attester-slashing) - [Attester slashing](#attester-slashing)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
<!-- /TOC --> <!-- /TOC -->
## Introduction ## Introduction