diff --git a/.codespell-whitelist b/.codespell-whitelist new file mode 100644 index 000000000..ff694e380 --- /dev/null +++ b/.codespell-whitelist @@ -0,0 +1,2 @@ +uint +byteorder \ No newline at end of file diff --git a/scripts/build_spec.py b/scripts/build_spec.py index 88c3d46fb..e6a95e028 100644 --- a/scripts/build_spec.py +++ b/scripts/build_spec.py @@ -210,7 +210,7 @@ ignored_dependencies = [ def dependency_order_ssz_objects(objects: Dict[str, str], custom_types: Dict[str, str]) -> None: """ - Determines which SSZ Object is depenedent on which other and orders them appropriately + Determines which SSZ Object is dependent on which other and orders them appropriately """ items = list(objects.items()) for key, value in items: diff --git a/specs/core/0_beacon-chain.md b/specs/core/0_beacon-chain.md index a42465ad4..7ed3226e1 100644 --- a/specs/core/0_beacon-chain.md +++ b/specs/core/0_beacon-chain.md @@ -169,7 +169,7 @@ 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/constant_presets) 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 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. ### Misc diff --git a/specs/light_client/merkle_proofs.md b/specs/light_client/merkle_proofs.md index 21115dd27..345435133 100644 --- a/specs/light_client/merkle_proofs.md +++ b/specs/light_client/merkle_proofs.md @@ -6,14 +6,17 @@ - [Merkle proof formats](#merkle-proof-formats) - - [Table of contents](#table-of-contents) - - [Constants](#constants) - - [Generalized Merkle tree index](#generalized-merkle-tree-index) - - [SSZ object to index](#ssz-object-to-index) - - [Merkle multiproofs](#merkle-multiproofs) - - [MerklePartial](#merklepartial) - - [`SSZMerklePartial`](#sszmerklepartial) - - [Proofs for execution](#proofs-for-execution) + - [Table of contents](#table-of-contents) + - [Generalized Merkle tree index](#generalized-merkle-tree-index) + - [SSZ object to index](#ssz-object-to-index) + - [Helpers for generalized indices](#helpers-for-generalized-indices) + - [`concat_generalized_indices`](#concat_generalized_indices) + - [`get_generalized_index_length`](#get_generalized_index_length) + - [`get_generalized_index_bit`](#get_generalized_index_bit) + - [`generalized_index_sibling`](#generalized_index_sibling) + - [`generalized_index_child`](#generalized_index_child) + - [`generalized_index_parent`](#generalized_index_parent) + - [Merkle multiproofs](#merkle-multiproofs) diff --git a/specs/networking/p2p-interface.md b/specs/networking/p2p-interface.md index cdad92085..b3e0db50e 100644 --- a/specs/networking/p2p-interface.md +++ b/specs/networking/p2p-interface.md @@ -301,7 +301,7 @@ Here, `result` represents the 1-byte response code. The token of the negotiated protocol ID specifies the type of encoding to be used for the req/resp interaction. Two values are possible at this time: -- `ssz`: The contents are [SSZ-encoded](#ssz-encoding). This encoding type MUST be supported by all clients. For objects containing a single field, only the field is SSZ-encoded not a container with a single field. For example, the `BeaconBlocks` response would be an SSZ-encoded list of `BeaconBlock`s. All SSZ-Lists in the Req/Resp domain will have a maximum list size of `SSZ_MAX_LIST_SIZE`. +- `ssz`: The contents are [SSZ-encoded](../simple-serialize.md). This encoding type MUST be supported by all clients. For objects containing a single field, only the field is SSZ-encoded not a container with a single field. For example, the `BeaconBlocks` response would be an SSZ-encoded list of `BeaconBlock`s. All SSZ-Lists in the Req/Resp domain will have a maximum list size of `SSZ_MAX_LIST_SIZE`. - `ssz_snappy`: The contents are SSZ-encoded and then compressed with [Snappy](https://github.com/google/snappy). MAY be supported in the interoperability testnet; MUST be supported in mainnet. #### SSZ-encoding strategy (with or without Snappy) diff --git a/specs/simple-serialize.md b/specs/simple-serialize.md index 50d091c07..588200f20 100644 --- a/specs/simple-serialize.md +++ b/specs/simple-serialize.md @@ -26,6 +26,7 @@ - [Deserialization](#deserialization) - [Merkleization](#merkleization) - [Self-signed containers](#self-signed-containers) + - [Summaries and expansions](#summaries-and-expansions) - [Implementations](#implementations) @@ -230,7 +231,7 @@ We similarly define "summary types" and "expansion types". For example, [`Beacon | Python | Ethereum 2.0 | Ethereum Foundation | [https://github.com/ethereum/py-ssz](https://github.com/ethereum/py-ssz) | | Rust | Lighthouse | Sigma Prime | [https://github.com/sigp/lighthouse/tree/master/eth2/utils/ssz](https://github.com/sigp/lighthouse/tree/master/eth2/utils/ssz) | | Nim | Nimbus | Status | [https://github.com/status-im/nim-beacon-chain/blob/master/beacon_chain/ssz.nim](https://github.com/status-im/nim-beacon-chain/blob/master/beacon_chain/ssz.nim) | -| Rust | Shasper | ParityTech | [https://github.com/paritytech/shasper/tree/master/utils/ssz](https://github.com/paritytech/shasper/tree/master/util/ssz) | +| Rust | Shasper | ParityTech | [https://github.com/paritytech/shasper/tree/master/utils/ssz](https://github.com/paritytech/shasper/tree/master/utils/ssz) | | TypeScript | Lodestar | ChainSafe Systems | [https://github.com/ChainSafe/ssz-js](https://github.com/ChainSafe/ssz-js) | | Java | Cava | ConsenSys | [https://www.github.com/ConsenSys/cava/tree/master/ssz](https://www.github.com/ConsenSys/cava/tree/master/ssz) | | Go | Prysm | Prysmatic Labs | [https://github.com/prysmaticlabs/go-ssz](https://github.com/prysmaticlabs/go-ssz) | diff --git a/specs/validator/0_beacon-chain-validator.md b/specs/validator/0_beacon-chain-validator.md index 188a6a291..ef5ad4415 100644 --- a/specs/validator/0_beacon-chain-validator.md +++ b/specs/validator/0_beacon-chain-validator.md @@ -266,7 +266,7 @@ Up to `MAX_ATTESTATIONS`, aggregate attestations can be included in the `block`. ##### Deposits -If there are any unprocessed deposits for the existing `state.eth1_data` (i.e. `state.eth1_data.deposit_count > state.eth1_deposit_index`), then pending deposits _must_ be added to the block. The expected number of deposits is exactly `min(MAX_DEPOSITS, eth1_data.deposit_count - state.eth1_deposit_index)`. These [`deposits`](../core/0_beacon-chain.md#deposit) are constructed from the `Deposit` logs from the [Eth 1.0 deposit contract](../core/0_deposit-contract) and must be processed in sequential order. The deposits included in the `block` must satisfy the verification conditions found in [deposits processing](../core/0_beacon-chain.md#deposits). +If there are any unprocessed deposits for the existing `state.eth1_data` (i.e. `state.eth1_data.deposit_count > state.eth1_deposit_index`), then pending deposits _must_ be added to the block. The expected number of deposits is exactly `min(MAX_DEPOSITS, eth1_data.deposit_count - state.eth1_deposit_index)`. These [`deposits`](../core/0_beacon-chain.md#deposit) are constructed from the `Deposit` logs from the [Eth 1.0 deposit contract](../core/0_deposit-contract.md) and must be processed in sequential order. The deposits included in the `block` must satisfy the verification conditions found in [deposits processing](../core/0_beacon-chain.md#deposits). The `proof` for each deposit must be constructed against the deposit root contained in `state.eth1_data` rather than the deposit root at the time the deposit was initially logged from the 1.0 chain. This entails storing a full deposit merkle tree locally and computing updated proofs against the `eth1_data.deposit_root` as needed. See [`minimal_merkle.py`](https://github.com/ethereum/research/blob/master/spec_pythonizer/utils/merkle_minimal.py) for a sample implementation. diff --git a/test_generators/README.md b/test_generators/README.md index 7a4a5c536..abcb8a1ee 100644 --- a/test_generators/README.md +++ b/test_generators/README.md @@ -9,6 +9,24 @@ On releases, test generators are run by the release manager. Test-generation of An automated nightly tests release system, with a config filter applied, is being considered as implementation needs mature. +## Table of contents + + + + + +- [How to run generators](#how-to-run-generators) + - [Cleaning](#cleaning) + - [Running all test generators](#running-all-test-generators) + - [Running a single generator](#running-a-single-generator) +- [Developing a generator](#developing-a-generator) +- [How to add a new test generator](#how-to-add-a-new-test-generator) +- [How to remove a test generator](#how-to-remove-a-test-generator) + + + + + ## How to run generators Prerequisites: diff --git a/test_libs/pyspec/eth2spec/test/context.py b/test_libs/pyspec/eth2spec/test/context.py index 5a0ddb59d..5cc42c510 100644 --- a/test_libs/pyspec/eth2spec/test/context.py +++ b/test_libs/pyspec/eth2spec/test/context.py @@ -101,7 +101,7 @@ all_phases = ['phase0', 'phase1'] def with_all_phases(fn): """ - A decorator for running a test wil every phase + A decorator for running a test with every phase """ return with_phases(all_phases)(fn) diff --git a/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py b/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py index 1f199e6e1..891633afe 100644 --- a/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py +++ b/test_libs/pyspec/eth2spec/utils/ssz/ssz_typing.py @@ -344,7 +344,7 @@ class BaseList(list, Elements): return super().__iter__() def last(self): - # be explict about getting the last item, for the non-python readers, and negative-index safety + # be explicit about getting the last item, for the non-python readers, and negative-index safety return self[len(self) - 1] diff --git a/test_libs/pyspec/eth2spec/utils/ssz/test_ssz_typing.py b/test_libs/pyspec/eth2spec/utils/ssz/test_ssz_typing.py index f746a29c9..d5a53c5fa 100644 --- a/test_libs/pyspec/eth2spec/utils/ssz/test_ssz_typing.py +++ b/test_libs/pyspec/eth2spec/utils/ssz/test_ssz_typing.py @@ -222,7 +222,7 @@ def test_bytesn_subclass(): def test_uint_math(): - assert uint8(0) + uint8(uint32(16)) == uint8(16) # allow explict casting to make invalid addition valid + assert uint8(0) + uint8(uint32(16)) == uint8(16) # allow explicit casting to make invalid addition valid expect_value_error(lambda: uint8(0) - uint8(1), "no underflows allowed") expect_value_error(lambda: uint8(1) + uint8(255), "no overflows allowed")