mirror of
https://github.com/AtHeartEngineering/lodestar.git
synced 2026-01-09 01:28:11 -05:00
Removing eth2 mentions in documentation and fix links (#3848)
* Remove architecture.md from docs * Update mkdocs.yml to remove architecture.md * Remove architecture link from readme * Remove architecture.md links from depgraph.md * Remove architecture overview from readme * Remove eth2 terminology on contributing.md * remove eth2 references from docs
This commit is contained in:
@@ -209,15 +209,14 @@ Effort estimations can help planning to tackle issues that are particulary easy
|
||||
- `q7-involved`: Can be fixed by a team of developers and probably takes some time.
|
||||
- `q9-epic`: Can only be fixed by John Skeet. ;)
|
||||
|
||||
###### `spec.*` Eth2 Consensus Spec Version Target
|
||||
###### `spec.*` Ethereum Consensus Spec Version Target
|
||||
|
||||
Issues that target a specific version of the Eth2 consensus spec, shall be tagged accordingly.
|
||||
|
||||
- `spec0-phase0`: Issues targeting the initial Eth2 spec version.
|
||||
- `spec1-altair`: Issues targeting the Altair Eth2 spec version.
|
||||
- `spec3-merge`: Issues targeting the merge Eth2 spec version.
|
||||
- `spec5-phase1`: Issues targeting the Phase1 Eth2 spec version.
|
||||
- `spec7-phase2`: Issues targeting the Phase2 Eth2 spec version.
|
||||
Issues that target a specific version of the Ethereum consensus spec, shall be tagged accordingly.
|
||||
* `spec0-phase0`: Issues targeting the initial Ethereum consensus spec version.
|
||||
* `spec1-altair`: Issues targeting the Altair Ethereum consensus spec version.
|
||||
* `spec3-bellatrix`: Issues targeting the Bellatrix Ethereum consensus spec version.
|
||||
* `spec5-phase1`: Issues targeting the Phase1 Ethereum consensus spec version.
|
||||
* `spec7-phase2`: Issues targeting the Phase2 Ethereum consensus spec version.
|
||||
|
||||
###### `meta.*` Meta Labels to organize Miscelaneous Issues
|
||||
|
||||
|
||||
44
README.md
44
README.md
@@ -1,17 +1,17 @@
|
||||
<p align="center"><a href="https://chainsafe.github.io/lodestar"><img width="500" title="Lodestar" src='assets/lodestar_icon_text_black_stroke.png' /></a></p>
|
||||
|
||||
# Lodestar Eth2 Implementation
|
||||
# Lodestar Ethereum Consensus Implementation
|
||||
|
||||
[](https://github.com/ChainSafe/lodestar/releases/latest)
|
||||
[](https://www.npmjs.com/package/@chainsafe/lodestar-cli)
|
||||
[](https://hub.docker.com/r/chainsafe/lodestar)
|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.0-beta.3)
|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||
[](https://codecov.io/gh/ChainSafe/lodestar)
|
||||
[](https://codeclimate.com/github/ChainSafe/lodestar/maintainability)
|
||||

|
||||

|
||||

|
||||
|
||||
[Lodestar](https://lodestar.chainsafe.io) is a TypeScript implementation of the [Ethereum 2.0 specification](https://github.com/ethereum/consensus-specs) developed by [ChainSafe Systems](https://chainsafe.io).
|
||||
[Lodestar](https://lodestar.chainsafe.io) is a TypeScript implementation of the [Ethereum Consensus specification](https://github.com/ethereum/consensus-specs) developed by [ChainSafe Systems](https://chainsafe.io).
|
||||
|
||||
###### Get it from the NPM Registry:
|
||||
|
||||
@@ -28,7 +28,7 @@ docker pull chainsafe/lodestar
|
||||
## Getting started
|
||||
|
||||
- :gear: Follow the [installation guide](https://chainsafe.github.io/lodestar/installation) to install Lodestar.
|
||||
- :globe_with_meridians: Run lodestar on the [Eth2 mainnet or on a public testnet](https://chainsafe.github.io/lodestar/usage/testnet/).
|
||||
- :globe_with_meridians: Run lodestar on the [Ethereum beacon chain mainnet or on a public testnet](https://chainsafe.github.io/lodestar/usage/testnet/).
|
||||
- :computer: Quickly try out the whole stack by [starting a local testnet](https://chainsafe.github.io/lodestar/usage/local).
|
||||
- :spiral_notepad: View the lodestar [CLI commands and options](https://chainsafe.github.io/lodestar/reference/cli/).
|
||||
- :nerd_face: View the [TypeDoc code documentation](https://chainsafe.github.io/lodestar/packages).
|
||||
@@ -52,25 +52,25 @@ yarn build
|
||||
|
||||
## Architecture Overview
|
||||
|
||||
- :package: This mono-repository contains a suite of Ethereum 2.0 packages.
|
||||
- :package: This mono-repository contains a suite of Ethereum Consensus packages.
|
||||
- :balance_scale: The mono-repository is released under [LGPLv3 license](./LICENSE). Note, that the packages contain their own licenses.
|
||||
|
||||
| Package | Version | License | Docs | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
|
||||
| [@chainsafe/lodestar](https://github.com/ChainSafe/lodestar/tree/master/packages/lodestar) | [](https://www.npmjs.com/package/@chainsafe/lodestar) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://chainsafe.github.io/lodestar) | :rotating_light: Beacon-chain client |
|
||||
| [@chainsafe/lodestar-validator](https://github.com/ChainSafe/lodestar/tree/master/packages/validator) | [](https://www.npmjs.com/package/@chainsafe/lodestar-validator) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/validator) | :bank: Validator client |
|
||||
| [@chainsafe/lodestar-light-client](https://github.com/ChainSafe/lodestar/tree/master/packages/light-client) | [](https://www.npmjs.com/package/@chainsafe/lodestar-light-client) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/light-client) | :bird: Eth2 Light client |
|
||||
| [@chainsafe/lodestar-api](https://github.com/ChainSafe/lodestar/tree/master/packages/api) | [](https://www.npmjs.com/package/@chainsafe/lodestar-api) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/api) | :clipboard: REST Client for the Eth2 API |
|
||||
| [@chainsafe/lodestar-cli](https://github.com/ChainSafe/lodestar/tree/master/packages/cli) | [](https://www.npmjs.com/package/@chainsafe/lodestar-cli) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://chainsafe.github.io/lodestar/reference/cli/) | :computer: Command-line tool for Lodestar |
|
||||
| [@chainsafe/lodestar-beacon-state-transition](https://github.com/ChainSafe/lodestar/tree/master/packages/beacon-state-transition) | [](https://www.npmjs.com/package/@chainsafe/lodestar-beacon-state-transition) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/beacon-state-transition) | :mag_right: Eth2 beacon-state transition |
|
||||
| [@chainsafe/lodestar-types](https://github.com/ChainSafe/lodestar/tree/master/packages/types) | [](https://www.npmjs.com/package/@chainsafe/lodestar-types) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/types) | :spiral_notepad: Eth2 TypeScript and SSZ types |
|
||||
| [@chainsafe/lodestar-params](https://github.com/ChainSafe/lodestar/tree/master/packages/params) | [](https://www.npmjs.com/package/@chainsafe/lodestar-params) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/params) | :spider_web: Eth2 network parameters |
|
||||
| [@chainsafe/lodestar-utils](https://github.com/ChainSafe/lodestar/tree/master/packages/utils) | [](https://www.npmjs.com/package/@chainsafe/lodestar-utils) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/utils) | :toolbox: Miscellaneous utility functions used across Lodestar |
|
||||
| [@chainsafe/lodestar-config](https://github.com/ChainSafe/lodestar/tree/master/packages/config) | [](https://www.npmjs.com/package/@chainsafe/lodestar-config) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/config) | :spiral_notepad: Eth2 types and params bundled together |
|
||||
| [@chainsafe/lodestar-spec-test-util](https://github.com/ChainSafe/lodestar/tree/master/packages/spec-test-util) | [](https://www.npmjs.com/package/@chainsafe/lodestar-spec-test-util) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/spec-test-util) | :test_tube: Test harness for Eth2 spec tests |
|
||||
| [@chainsafe/lodestar-spec-test-runner](https://github.com/ChainSafe/lodestar/tree/master/packages/spec-test-runner) | | [](https://www.gnu.org/licenses/lgpl-3.0) | | :test_tube: Run all Eth2 spec tests |
|
||||
| [@chainsafe/lodestar-db](https://github.com/ChainSafe/lodestar/tree/master/packages/db) | [](https://www.npmjs.com/package/@chainsafe/lodestar-db) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/db) | :floppy_disk: Read/write persistent Eth2 data |
|
||||
| [@chainsafe/lodestar-fork-choice](https://github.com/ChainSafe/lodestar/tree/master/packages/fork-choice) | [](https://www.npmjs.com/package/@chainsafe/lodestar-fork-choice) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/fork-choice) | :fork_and_knife: Beacon-chain fork choice |
|
||||
| Package | Version | License | Docs | Description |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------- |
|
||||
| [@chainsafe/lodestar](https://github.com/ChainSafe/lodestar/tree/master/packages/lodestar) | [](https://www.npmjs.com/package/@chainsafe/lodestar) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://chainsafe.github.io/lodestar) | :rotating_light: Beacon-chain client |
|
||||
| [@chainsafe/lodestar-validator](https://github.com/ChainSafe/lodestar/tree/master/packages/validator) | [](https://www.npmjs.com/package/@chainsafe/lodestar-validator) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/validator) | :bank: Validator client |
|
||||
| [@chainsafe/lodestar-light-client](https://github.com/ChainSafe/lodestar/tree/master/packages/light-client) | [](https://www.npmjs.com/package/@chainsafe/lodestar-light-client) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/light-client) | :bird: Ethereum Light client |
|
||||
| [@chainsafe/lodestar-api](https://github.com/ChainSafe/lodestar/tree/master/packages/api) | [](https://www.npmjs.com/package/@chainsafe/lodestar-api) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/api) | :clipboard: REST Client for the Eth Beacon API |
|
||||
| [@chainsafe/lodestar-cli](https://github.com/ChainSafe/lodestar/tree/master/packages/cli) | [](https://www.npmjs.com/package/@chainsafe/lodestar-cli) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://chainsafe.github.io/lodestar/reference/cli/) | :computer: Command-line tool for Lodestar |
|
||||
| [@chainsafe/lodestar-beacon-state-transition](https://github.com/ChainSafe/lodestar/tree/master/packages/beacon-state-transition) | [](https://www.npmjs.com/package/@chainsafe/lodestar-beacon-state-transition) | [](https://www.gnu.org/licenses/lgpl-3.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/beacon-state-transition) | :mag_right: Eth Consensus beacon-state transition |
|
||||
| [@chainsafe/lodestar-types](https://github.com/ChainSafe/lodestar/tree/master/packages/types) | [](https://www.npmjs.com/package/@chainsafe/lodestar-types) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/types) | :spiral_notepad: Eth Consensus TypeScript and SSZ types |
|
||||
| [@chainsafe/lodestar-params](https://github.com/ChainSafe/lodestar/tree/master/packages/params) | [](https://www.npmjs.com/package/@chainsafe/lodestar-params) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/params) | :spider_web: Eth Consensus network parameters |
|
||||
| [@chainsafe/lodestar-utils](https://github.com/ChainSafe/lodestar/tree/master/packages/utils) | [](https://www.npmjs.com/package/@chainsafe/lodestar-utils) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/utils) | :toolbox: Miscellaneous utility functions used across Lodestar |
|
||||
| [@chainsafe/lodestar-config](https://github.com/ChainSafe/lodestar/tree/master/packages/config) | [](https://www.npmjs.com/package/@chainsafe/lodestar-config) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/config) | :spiral_notepad: Eth Consensus types and params bundled together |
|
||||
| [@chainsafe/lodestar-spec-test-util](https://github.com/ChainSafe/lodestar/tree/master/packages/spec-test-util) | [](https://www.npmjs.com/package/@chainsafe/lodestar-spec-test-util) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/spec-test-util) | :test_tube: Test harness for Eth Consensus spec tests |
|
||||
| [@chainsafe/lodestar-spec-test-runner](https://github.com/ChainSafe/lodestar/tree/master/packages/spec-test-runner) | | [](https://www.gnu.org/licenses/lgpl-3.0) | | :test_tube: Run all Eth Consensus spec tests |
|
||||
| [@chainsafe/lodestar-db](https://github.com/ChainSafe/lodestar/tree/master/packages/db) | [](https://www.npmjs.com/package/@chainsafe/lodestar-db) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/db) | :floppy_disk: Read/write persistent Eth Consensus data |
|
||||
| [@chainsafe/lodestar-fork-choice](https://github.com/ChainSafe/lodestar/tree/master/packages/fork-choice) | [](https://www.npmjs.com/package/@chainsafe/lodestar-fork-choice) | [](https://opensource.org/licenses/Apache-2.0) | [](https://github.com/ChainSafe/lodestar/tree/master/packages/fork-choice) | :fork_and_knife: Beacon-chain fork choice |
|
||||
|
||||
## Contributors
|
||||
|
||||
|
||||
@@ -74,11 +74,11 @@ Let's talk about how each package fits together in finer detail, from top to bot
|
||||
|
||||
## @chainsafe/lodestar-params
|
||||
|
||||
[@chainsafe/lodestar-params](https://github.com/ChainSafe/lodestar/tree/master/packages/params) contains the parameters for configuring an eth2 network. For example, the [mainnet params](https://github.com/ethereum/eth2.0-specs/blob/dev/configs/mainnet/phase0.yaml)
|
||||
[@chainsafe/lodestar-params](https://github.com/ChainSafe/lodestar/tree/master/packages/params) contains the parameters for configuring an Ethereum Consensus network. For example, the [mainnet params](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#configuration)
|
||||
|
||||
## @chainsafe/lodestar-types
|
||||
|
||||
[@chainsafe/lodestar-types](https://github.com/ChainSafe/lodestar/tree/master/packages/types) contains eth2 ssz types and data structures.
|
||||
[@chainsafe/lodestar-types](https://github.com/ChainSafe/lodestar/tree/master/packages/types) contains Eth Consensus ssz types and data structures.
|
||||
|
||||
## @chainsafe/lodestar-config
|
||||
|
||||
@@ -90,7 +90,7 @@ Let's talk about how each package fits together in finer detail, from top to bot
|
||||
|
||||
## @chainsafe/lodestar-beacon-state-transition
|
||||
|
||||
[@chainsafe/lodestar-beacon-state-transition](https://github.com/ChainSafe/lodestar/tree/master/packages/beacon-state-transition) contains the Lodestar implementation of the [beacon state transition function](https://github.com/ethereum/eth2.0-specs/blob/v0.10.0/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function), which is used by [`@chainsafe/lodestar`](#chainsafelodestar) to perform the actual beacon state transition. This package also contains various functions used to calculate info about the beacon chain (such as `computeEpochAtSlot`) which are used by [@chainsafe/lodestar-fork-choice](#chainsafelodestar-fork-choice) and [@chainsafe/lodestar-validator](#chainsafelodestar-validator)
|
||||
[@chainsafe/lodestar-beacon-state-transition](https://github.com/ChainSafe/lodestar/tree/master/packages/beacon-state-transition) contains the Lodestar implementation of the [beacon state transition function](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#beacon-chain-state-transition-function), which is used by [`@chainsafe/lodestar`](#chainsafelodestar) to perform the actual beacon state transition. This package also contains various functions used to calculate info about the beacon chain (such as `computeEpochAtSlot`) which are used by [@chainsafe/lodestar-fork-choice](#chainsafelodestar-fork-choice) and [@chainsafe/lodestar-validator](#chainsafelodestar-validator)
|
||||
|
||||
## @chainsafe/lodestar-db
|
||||
|
||||
@@ -99,7 +99,7 @@ Let's talk about how each package fits together in finer detail, from top to bot
|
||||
## @chainsafe/lodestar-fork-choice
|
||||
|
||||
[@chainsafe/lodestar-fork-choice](https://github.com/ChainSafe/lodestar/tree/master/packages/fork-choice) holds the methods for reading/writing the fork choice DAG. The [`@chainsafe/lodestar`](#chainsafelodestar) package is the sole consumer of this package because the beacon node itself is what controls when the fork choice DAG is updated.
|
||||
For a good explainer on how the fork choice itself works, see the [annotated fork choice spec](https://github.com/ethereum/annotated-spec/blob/master/phase0/fork-choice.md). This is an annotated version of the [Eth2 fork choice spec](https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md) which `lodestar-fork-choice` is based on.
|
||||
For a good explainer on how the fork choice itself works, see the [annotated fork choice spec](https://github.com/ethereum/annotated-spec/blob/v1.1.10/phase0/fork-choice.md). This is an annotated version of the [Eth Consensus fork choice spec](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md) which `lodestar-fork-choice` is based on.
|
||||
|
||||
## @chainsafe/lodestar-validator
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Welcome to the Lodestar documentation!
|
||||
|
||||
> **Lodestar is an open-source Ethereum Consensus (Eth2) client and Typescript ecosystem, maintained by ChainSafe Systems**
|
||||
> **Lodestar is an open-source Ethereum Consensus client and Typescript ecosystem, maintained by ChainSafe Systems**
|
||||
|
||||
### Getting started
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Clone the repo locally.
|
||||
git clone https://github.com/chainsafe/lodestar.git
|
||||
```
|
||||
|
||||
Install across all packages. Lodestar follows a [monorepo](https://github.com/lerna/lerna) structure, so all commands below must be run in the project root. Use the `--ignore-optional` flag to prevent downloading the eth2 spec tests.
|
||||
Install across all packages. Lodestar follows a [monorepo](https://github.com/lerna/lerna) structure, so all commands below must be run in the project root. Use the `--ignore-optional` flag to prevent downloading the Ethereum Consensus spec tests.
|
||||
|
||||
```bash
|
||||
yarn install --ignore-optional
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Lodestar libraries
|
||||
|
||||
The Lodestar project is divided into Typescript packages that can be used independently of the CLI. These packages span the breadth of the Ethereum consensus layer (Eth2), and are perfect for Typescript developers looking to build around Ethereum.
|
||||
The Lodestar project is divided into Typescript packages that can be used independently of the CLI. These packages span the breadth of the Ethereum Consensus layer, and are perfect for Typescript developers looking to build around Ethereum.
|
||||
|
||||
## Monorepo libraries
|
||||
|
||||
@@ -15,7 +15,7 @@ Several useful Ethereum consensus libraries are developed as part of the [Lodest
|
||||
|
||||
### BLS Utilities
|
||||
|
||||
- [bls](https://github.com/ChainSafe/bls) - Eth2 BLS sign / verify / aggregate
|
||||
- [bls](https://github.com/ChainSafe/bls) - Eth Consensus BLS sign / verify / aggregate
|
||||
- [bls-keystore](https://github.com/ChainSafe/bls-keystore) - store / retrieve a BLS secret key from an [EIP-2335](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2335.md) JSON keystore
|
||||
- [bls-keygen](https://github.com/ChainSafe/bls-keygen) - utility functions to generate BLS secret keys, following [EIP-2333](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md) and [EIP-2334](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2334.md)
|
||||
- [bls-hd-key](https://github.com/ChainSafe/bls-hd-key) - low level [EIP-2333](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md) and [EIP-2334](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2334.md) functionality
|
||||
|
||||
@@ -80,4 +80,4 @@ This command will print the public address of every active keystore.
|
||||
|
||||
### Submit a validator deposit
|
||||
|
||||
DEPRECATED. Please use the official tools to perform your deposits - eth2.0-deposit-cli: https://github.com/ethereum/eth2.0-deposit-cli - Ethereum Foundation launchpad: https://prater.launchpad.ethereum.org
|
||||
DEPRECATED. Please use the official tools to perform your deposits - eth2.0-deposit-cli: https://github.com/ethereum/eth2.0-deposit-cli - Ethereum Foundation launchpad: https://launchpad.ethereum.org/en/
|
||||
|
||||
@@ -69,7 +69,7 @@ Jul-09 17:34:54.278 [] info: Syncing - 3 days left - 3.00 slots/
|
||||
If your node is stuck with `Searching for peers` review your network configuration to make sure your ports are open.
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
A young testnet should take a few hours to sync. If you see multiple or consistent errors in the logs, please open a [Github issue](https://github.com/ChainSafe/lodestar/issues/new) or reach out to us in [Discord](https://discord.gg/yjyvFRP). Just by reporting anomalities you are helping accelerate the progress of Eth2.0, thanks for contributing!
|
||||
A young testnet should take a few hours to sync. If you see multiple or consistent errors in the logs, please open a [Github issue](https://github.com/ChainSafe/lodestar/issues/new) or reach out to us in [Discord](https://discord.gg/yjyvFRP). Just by reporting anomalities you are helping accelerate the progress of Ethereum Consensus, thanks for contributing!
|
||||
|
||||
### Weak Subjectivity
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
site_name: Lodestar documentation
|
||||
site_description: Lodestar documentation - Typescript Eth2.0 client
|
||||
site_description: Lodestar documentation - Typescript Ethereum Consensus client
|
||||
site_url: https://chainsafe.github.io/lodestar
|
||||
|
||||
repo_name: chainsafe/lodestar
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# Lodestar ETH2.0 API
|
||||
# Lodestar Eth Consensus API
|
||||
|
||||
[](https://discord.gg/aMxzVcr)
|
||||

|
||||
[](https://github.com/ethereum/beacon-APIs/releases/tag/v2.1.0)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
Typescript REST client for the [Eth2.0 API spec](https://ethereum.github.io/eth2.0-APIs/)
|
||||
Typescript REST client for the [Ethereum Consensus API spec](https://github.com/ethereum/beacon-apis)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -34,7 +34,7 @@ api.beacon
|
||||
|
||||
## What you need
|
||||
|
||||
You will need to go over the [specification](https://github.com/ethereum/eth2.0-specs). You will also need to have a [basic understanding of sharding](https://github.com/ethereum/wiki/wiki/Sharding-FAQs).
|
||||
You will need to go over the [specification](https://github.com/ethereum/beacon-apis). You will also need to have a [basic understanding of sharding](https://eth.wiki/sharding/Sharding-FAQs).
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chainsafe/lodestar-api",
|
||||
"description": "A Typescript implementation of the eth2 light client",
|
||||
"description": "A Typescript implementation of the Ethereum Consensus light client",
|
||||
"license": "Apache-2.0",
|
||||
"author": "ChainSafe Systems",
|
||||
"homepage": "https://github.com/ChainSafe/lodestar#readme",
|
||||
@@ -56,7 +56,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"api",
|
||||
"blockchain"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import qs from "qs";
|
||||
|
||||
/**
|
||||
* Eth2.0 API requires the query with format:
|
||||
* Ethereum Beacon API requires the query with format:
|
||||
* - arrayFormat: repeat `topic=topic1&topic=topic2`
|
||||
*/
|
||||
export function stringifyQuery(query: unknown): string {
|
||||
|
||||
@@ -124,7 +124,7 @@ export function getReqSerializers(config: IChainForkConfig): ReqSerializers<Api,
|
||||
schema: {params: {blockId: Schema.StringRequired}},
|
||||
};
|
||||
|
||||
// Compute block type from JSON payload. See https://github.com/ethereum/eth2.0-APIs/pull/142
|
||||
// Compute block type from JSON payload. See https://github.com/ethereum/beacon-APIs/pull/142
|
||||
const getSignedBeaconBlockType = (data: allForks.SignedBeaconBlock): ContainerType<allForks.SignedBeaconBlock> =>
|
||||
config.getForkTypes(data.message.slot).SignedBeaconBlock;
|
||||
const AllForksSignedBeaconBlock: TypeJson<allForks.SignedBeaconBlock> = {
|
||||
|
||||
@@ -73,7 +73,7 @@ export type Api = {
|
||||
|
||||
/**
|
||||
* Get Fork object for requested state
|
||||
* Returns [Fork](https://github.com/ethereum/eth2.0-specs/blob/v0.11.1/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'.
|
||||
* Returns [Fork](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'.
|
||||
* @param stateId State identifier.
|
||||
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
||||
*/
|
||||
|
||||
@@ -29,9 +29,9 @@ export type Api = {
|
||||
|
||||
/**
|
||||
* Retrieve specification configuration used on this node. The configuration should include:
|
||||
* - Constants for all hard forks known by the beacon node, for example the [phase 0](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#constants) and [altair](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/beacon-chain.md#constants) values
|
||||
* - Presets for all hard forks supplied to the beacon node, for example the [phase 0](https://github.com/ethereum/eth2.0-specs/blob/dev/presets/mainnet/phase0.yaml) and [altair](https://github.com/ethereum/eth2.0-specs/blob/dev/presets/mainnet/altair.yaml) values
|
||||
* - Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/eth2.0-specs/blob/dev/configs/mainnet.yaml) values
|
||||
* - Constants for all hard forks known by the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#constants) and [altair](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/beacon-chain.md#constants) values
|
||||
* - Presets for all hard forks supplied to the beacon node, for example the [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.1.10/presets/mainnet/phase0.yaml) and [altair](https://github.com/ethereum/consensus-specs/blob/v1.1.10/presets/mainnet/altair.yaml) values
|
||||
* - Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/consensus-specs/blob/v1.1.10/configs/mainnet.yaml) values
|
||||
*
|
||||
* Values are returned with following format:
|
||||
* - any value starting with 0x in the spec is returned as a hex string
|
||||
|
||||
@@ -22,7 +22,7 @@ export type NetworkIdentity = {
|
||||
enr: string;
|
||||
p2pAddresses: string[];
|
||||
discoveryAddresses: string[];
|
||||
/** Based on eth2 [Metadata object](https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/p2p-interface.md#metadata) */
|
||||
/** Based on Ethereum Consensus [Metadata object](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#metadata) */
|
||||
metadata: allForks.Metadata;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export type BeaconCommitteeSubscription = {
|
||||
};
|
||||
|
||||
/**
|
||||
* From https://github.com/ethereum/eth2.0-APIs/pull/136
|
||||
* From https://github.com/ethereum/beacon-APIs/pull/136
|
||||
*/
|
||||
export type SyncCommitteeSubscription = {
|
||||
validatorIndex: ValidatorIndex;
|
||||
@@ -67,7 +67,7 @@ export type AttesterDuty = {
|
||||
};
|
||||
|
||||
/**
|
||||
* From https://github.com/ethereum/eth2.0-APIs/pull/134
|
||||
* From https://github.com/ethereum/beacon-APIs/pull/134
|
||||
*/
|
||||
export type SyncDuty = {
|
||||
pubkey: BLSPubkey;
|
||||
|
||||
@@ -23,7 +23,7 @@ export type ServerRoute<Req extends ReqGeneric = ReqGeneric> = {
|
||||
method: fastify.HTTPMethods;
|
||||
handler: FastifyHandler<Req>;
|
||||
schema?: fastify.FastifySchema;
|
||||
/** OperationId as defined in https://github.com/ethereum/eth2.0-APIs/blob/18cb6ff152b33a5f34c377f00611821942955c82/apis/beacon/blocks/attestations.yaml#L2 */
|
||||
/** OperationId as defined in https://github.com/ethereum/beacon-APIs/blob/v2.1.0/apis/beacon/blocks/attestations.yaml#L2 */
|
||||
id: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {ReqGeneric} from "./types";
|
||||
|
||||
// Reasoning: Allows to declare JSON schemas for server routes in a succinct typesafe way.
|
||||
// The enums exposed here are very feature incomplete but cover the minimum necessary for
|
||||
// the existing routes. Since the arguments for Eth2.0 server routes are very simple it suffice.
|
||||
// the existing routes. Since the arguments for Ethereum Consensus server routes are very simple it suffice.
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
type JsonSchema = Record<string, any>;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
[](https://www.npmjs.com/package/@chainsafe/lodestar-beacon-state-transition)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
]
|
||||
|
||||
@@ -4,7 +4,7 @@ import {CachedBeaconStateAllForks} from "../../types";
|
||||
import {ZERO_HASH} from "../../constants";
|
||||
|
||||
/**
|
||||
* Converts a Deposit record (created by the eth1 deposit contract) into a Validator object that goes into the eth2 state.
|
||||
* Converts a Deposit record (created by the eth-execution deposit contract) into a Validator object that goes into the eth-consensus state.
|
||||
*
|
||||
* PERF: Fixed work independent of block contents.
|
||||
* NOTE: `block` body root MUST be pre-cached.
|
||||
|
||||
@@ -5,8 +5,8 @@ import {readonlyValues, TreeBacked} from "@chainsafe/ssz";
|
||||
import {CachedBeaconStateAllForks} from "../../types";
|
||||
|
||||
/**
|
||||
* Store vote counts for every eth1 block that has votes; if any eth1 block wins majority support within a 1024-slot
|
||||
* voting period, formally accept that eth1 block and set it as the official "latest known eth1 block" in the eth2 state.
|
||||
* Store vote counts for every eth-execution block that has votes; if any eth-execution block wins majority support within a 1024-slot
|
||||
* voting period, formally accept that eth-execution block and set it as the official "latest known eth-execution block" in the eth-consensus state.
|
||||
*
|
||||
* PERF: Processing cost depends on the current amount of votes.
|
||||
* - Best case: Vote is already decided, zero work. See becomesNewEth1Data conditions
|
||||
|
||||
@@ -121,7 +121,7 @@ export function processAttestations(
|
||||
}
|
||||
|
||||
/**
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.4/specs/altair/beacon-chain.md#get_attestation_participation_flag_indices
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/beacon-chain.md#get_attestation_participation_flag_indices
|
||||
*/
|
||||
export function getAttestationParticipationStatus(
|
||||
data: phase0.AttestationData,
|
||||
|
||||
@@ -73,7 +73,7 @@ export function getSyncCommitteeSignatureSet(
|
||||
// When there's no participation we consider the signature valid and just ignore it
|
||||
if (participantIndices.length === 0) {
|
||||
// Must set signature as G2_POINT_AT_INFINITY when participating bits are empty
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/30f2a076377264677e27324a8c3c78c590ae5e20/specs/altair/bls.md#eth2_fast_aggregate_verify
|
||||
// https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/bls.md#eth_fast_aggregate_verify
|
||||
if (ssz.BLSSignature.equals(signature, G2_POINT_AT_INFINITY)) {
|
||||
return null;
|
||||
} else {
|
||||
|
||||
@@ -41,7 +41,7 @@ function upgradeTreeBackedState(config: IBeaconConfig, state: CachedBeaconStateP
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate_participation in https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/fork.md
|
||||
* Translate_participation in https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/fork.md
|
||||
*/
|
||||
function translateParticipation(state: CachedBeaconStateAltair, pendingAttesations: phase0.PendingAttestation[]): void {
|
||||
const {epochCtx} = state;
|
||||
|
||||
@@ -46,7 +46,7 @@ def shuffle(list_size, seed):
|
||||
Heavily-optimized version of the set-shuffling algorithm proposed by Vitalik to shuffle all items in a list together.
|
||||
|
||||
Original here:
|
||||
https://github.com/ethereum/eth2.0-specs/pull/576#issue-250741806
|
||||
https://github.com/ethereum/consensus-specs/pull/576
|
||||
|
||||
Main differences, implemented by @protolambda:
|
||||
- User can supply input slice to shuffle, simple provide [0,1,2,3,4, ...] to get a list of cleanly shuffled indices.
|
||||
|
||||
@@ -57,7 +57,7 @@ function attesterShufflingDecisionSlot(state: CachedBeaconStateAllForks, request
|
||||
/**
|
||||
* Returns the epoch at which the attester shuffling was decided.
|
||||
*
|
||||
* Spec ref: https://github.com/ethereum/eth2.0-APIs/blob/46d2b82127cb1ffce51bbc748a7df2677fc0215a/apis/validator/duties/attester.yaml#L15
|
||||
* Spec ref: https://github.com/ethereum/beacon-APIs/blob/v2.1.0/apis/validator/duties/attester.yaml#L15
|
||||
*
|
||||
* Throws an error when:
|
||||
* - `EpochTooLow` when `requestedEpoch` is more than 1 prior to `currentEpoch`.
|
||||
|
||||
@@ -2,7 +2,7 @@ import {getClient} from "@chainsafe/lodestar-api";
|
||||
import {config} from "@chainsafe/lodestar-config/default";
|
||||
import {getInfuraBeaconUrl} from "./infura";
|
||||
|
||||
// Analyze how eth2 blocks are in a target network to prepare accurate performance states and blocks
|
||||
// Analyze how Ethereum Consensus blocks are in a target network to prepare accurate performance states and blocks
|
||||
|
||||
// Mainnet
|
||||
// slot: 1803658,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Command Line Interface for Lodestar
|
||||
|
||||
[](https://discord.gg/aMxzVcr)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||
|
||||
@@ -24,7 +24,7 @@ Here's a quick list of the available CLI commands:
|
||||
| - | - |
|
||||
| `./bin/lodestar init` | Write a configuration and network identity to disk, by default `./.lodestar`|
|
||||
|`./bin/lodestar beacon` | Run a beacon node using a configuration from disk, by default `./.lodestar`|
|
||||
|`./bin/lodestar account` | Run various subcommands for creating/managing Eth2 accounts|
|
||||
|`./bin/lodestar account` | Run various subcommands for creating/managing Ethereum Consensus accounts|
|
||||
|`./bin/lodestar validator` | Run one or more validator clients|
|
||||
|`./bin/lodestar dev` | Quickly bootstrap a beacon node and multiple validators. Use for development and testing|
|
||||
Append `--help` to any of these commands to print out all options for each command.
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
],
|
||||
|
||||
@@ -6,7 +6,7 @@ import {registerCommandToYargs} from "./util";
|
||||
import {getVersion} from "./util/version";
|
||||
|
||||
const version = getVersion();
|
||||
const topBanner = `🌟 Lodestar: TypeScript Implementation of the Ethereum 2.0 Beacon Chain.
|
||||
const topBanner = `🌟 Lodestar: TypeScript Implementation of the Ethereum Consensus Beacon Chain.
|
||||
* Version: ${version}
|
||||
* by ChainSafe Systems, 2018-2022`;
|
||||
const bottomBanner = `📖 For more information, check the CLI reference:
|
||||
|
||||
@@ -5,7 +5,7 @@ import {IGlobalArgs} from "../../../../options";
|
||||
const deprecatedDescription =
|
||||
"DEPRECATED. Please use the official tools to perform your deposits \
|
||||
- eth2.0-deposit-cli: https://github.com/ethereum/eth2.0-deposit-cli \
|
||||
- Ethereum Foundation launchpad: https://prater.launchpad.ethereum.org";
|
||||
- Ethereum Foundation launchpad: https://launchpad.ethereum.org";
|
||||
|
||||
export const deposit: ICliCommand<Record<never, never>, IAccountValidatorArgs & IGlobalArgs> = {
|
||||
command: "deposit",
|
||||
|
||||
@@ -37,7 +37,7 @@ Ethereum Foundation utility.",
|
||||
examples: [
|
||||
{
|
||||
command: "account validator import --network prater --directory $HOME/eth2.0-deposit-cli/validator_keys",
|
||||
description: "Import validator keystores generated with the Ethereum Foundation Eth2 Launchpad",
|
||||
description: "Import validator keystores generated with the Ethereum Foundation Staking Launchpad",
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {recover} from "./recover";
|
||||
|
||||
export const validator: ICliCommand<IAccountValidatorArgs, IGlobalArgs> = {
|
||||
command: "validator <command>",
|
||||
describe: "Provides commands for managing Eth2 validators.",
|
||||
describe: "Provides commands for managing Ethereum Consensus validators.",
|
||||
options: accountValidatorOptions,
|
||||
subcommands: [create, deposit, importCmd, list, recover, slashingProtection, voluntaryExit],
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@ import {recover} from "./recover";
|
||||
|
||||
export const wallet: ICliCommand<IAccountWalletArgs, IGlobalArgs> = {
|
||||
command: "wallet <command>",
|
||||
describe: "Provides commands for managing Eth2 wallets.",
|
||||
describe: "Provides commands for managing Ethereum Consensus wallets.",
|
||||
options: accountWalletsOptions,
|
||||
subcommands: [create, list, recover],
|
||||
};
|
||||
|
||||
@@ -5,6 +5,6 @@ import {wallet} from "./cmds/wallet";
|
||||
|
||||
export const account: ICliCommand<Record<never, never>, IGlobalArgs> = {
|
||||
command: "account <command>",
|
||||
describe: "Utilities for generating and managing Ethereum 2.0 accounts",
|
||||
describe: "Utilities for generating and managing Ethereum Consensus accounts",
|
||||
subcommands: [validator, wallet],
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@ const globalSingleOptions: ICliCommandOptions<IGlobalSingleArgs> = {
|
||||
},
|
||||
|
||||
network: {
|
||||
description: "Name of the Eth2 chain network to join",
|
||||
description: "Name of the Ethereum Consensus chain network to join",
|
||||
type: "string",
|
||||
default: defaultNetwork,
|
||||
choices: networkNames,
|
||||
|
||||
@@ -135,7 +135,7 @@ describe("config / bootnodes / parsing", () => {
|
||||
{
|
||||
name: "Can parse plain txt-file input",
|
||||
input: `
|
||||
# Eth2 mainnet bootnodes
|
||||
# Ethereum Consensus mainnet bootnodes
|
||||
# ---------------------------------------
|
||||
# 1. Tag nodes with maintainer
|
||||
# 2. Keep nodes updated
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
[](https://www.npmjs.com/package/@chainsafe/lodestar-config)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
Lodestar defines all [network configuration variables](https://github.com/ethereum/eth2.0-specs/tree/dev/configs) defined in the [Ethereum Consensus / Eth2 spec](https://github.com/ethereum/eth2.0-specs). This tooling may be used to configure testnets, ingest mainnet/testnet config variables, or be used in downstream Lodestar libraries.
|
||||
Lodestar defines all [network configuration variables](https://github.com/ethereum/consensus-specs/tree/v1.1.10/configs) defined in the [Ethereum Consensus spec](https://github.com/ethereum/consensus-specs). This tooling may be used to configure testnets, ingest mainnet/testnet config variables, or be used in downstream Lodestar libraries.
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
Lodestar implementation of the [Eth2 fork choice](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/fork-choice.md).
|
||||
Lodestar implementation of the [Ethereum Consensus fork choice](https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/fork-choice.md).
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chainsafe/lodestar-fork-choice",
|
||||
"description": "A Typescript implementation eth2 fork choice",
|
||||
"description": "A Typescript implementation Ethereum Consensus fork choice",
|
||||
"license": "Apache-2.0",
|
||||
"author": "ChainSafe Systems",
|
||||
"homepage": "https://github.com/ChainSafe/lodestar#readme",
|
||||
@@ -46,7 +46,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
]
|
||||
|
||||
@@ -24,9 +24,9 @@ import {IForkChoiceStore, CheckpointWithHex, toCheckpointWithHex} from "./store"
|
||||
/* eslint-disable max-len */
|
||||
|
||||
/**
|
||||
* Provides an implementation of "Ethereum 2.0 Phase 0 -- Beacon Chain Fork Choice":
|
||||
* Provides an implementation of "Ethereum Consensus -- Beacon Chain Fork Choice":
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/fork-choice.md#ethereum-20-phase-0----beacon-chain-fork-choice
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#fork-choice
|
||||
*
|
||||
* ## Detail
|
||||
*
|
||||
@@ -108,7 +108,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#get_ancestor
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#get_ancestor
|
||||
*/
|
||||
getAncestor(blockRoot: RootHex, ancestorSlot: Slot): RootHex {
|
||||
const block = this.protoArray.getBlock(blockRoot);
|
||||
@@ -169,7 +169,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Is equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/fork-choice.md#get_head
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#get_head
|
||||
*/
|
||||
updateHead(): IProtoBlock {
|
||||
// balances is not changed but votes are changed
|
||||
@@ -258,7 +258,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Approximates:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#on_block
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#on_block
|
||||
*
|
||||
* It only approximates the specification since it does not run the `state_transition` check.
|
||||
* That should have already been called upstream and it's too expensive to call again.
|
||||
@@ -430,7 +430,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Approximates:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#on_attestation
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#on_attestation
|
||||
*
|
||||
* It only approximates the specification since it does not perform
|
||||
* `is_valid_indexed_attestation` since that should already have been called upstream and it's
|
||||
@@ -731,7 +731,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Is equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#should_update_justified_checkpoint
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#should_update_justified_checkpoint
|
||||
*/
|
||||
private shouldUpdateJustifiedCheckpoint(state: allForks.BeaconState): boolean {
|
||||
const {slot, currentJustifiedCheckpoint} = state;
|
||||
@@ -780,7 +780,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#validate_on_attestation
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#validate_on_attestation
|
||||
*/
|
||||
private validateOnAttestation(
|
||||
indexedAttestation: phase0.IndexedAttestation,
|
||||
@@ -972,7 +972,7 @@ export class ForkChoice implements IForkChoice {
|
||||
*
|
||||
* Equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#on_tick
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#on_tick
|
||||
*/
|
||||
private onTick(time: Slot): void {
|
||||
const previousSlot = this.fcStore.currentSlot;
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface IForkChoice {
|
||||
*
|
||||
* Equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#get_ancestor
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#get_ancestor
|
||||
*/
|
||||
getAncestor(blockRoot: RootHex, ancestorSlot: Slot): RootHex;
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ export interface IForkChoice {
|
||||
*
|
||||
* Is equivalent to:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/fork-choice.md#get_head
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#get_head
|
||||
*/
|
||||
getHeadRoot(): RootHex;
|
||||
getHead(): IProtoBlock;
|
||||
@@ -45,7 +45,7 @@ export interface IForkChoice {
|
||||
*
|
||||
* Approximates:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#on_block
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#on_block
|
||||
*
|
||||
* It only approximates the specification since it does not run the `state_transition` check.
|
||||
* That should have already been called upstream and it's too expensive to call again.
|
||||
@@ -65,7 +65,7 @@ export interface IForkChoice {
|
||||
*
|
||||
* Approximates:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/fork-choice.md#on_attestation
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#on_attestation
|
||||
*
|
||||
* It only approximates the specification since it does not perform
|
||||
* `is_valid_indexed_attestation` since that should already have been called upstream and it's
|
||||
|
||||
@@ -9,9 +9,9 @@ import {toHexString} from "@chainsafe/ssz";
|
||||
export type CheckpointWithHex = phase0.Checkpoint & {rootHex: RootHex};
|
||||
|
||||
/**
|
||||
* Approximates the `Store` in "Ethereum 2.0 Phase 0 -- Beacon Chain Fork Choice":
|
||||
* Approximates the `Store` in "Ethereum Consensus -- Beacon Chain Fork Choice":
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.2/specs/phase0/fork-choice.md#store
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#store
|
||||
*
|
||||
* ## Detail
|
||||
*
|
||||
|
||||
@@ -474,9 +474,9 @@ export class ProtoArray {
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the equivalent to the `filter_block_tree` function in the eth2 spec:
|
||||
* This is the equivalent to the `filter_block_tree` function in the Ethereum Consensus spec:
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v1.0.1/specs/phase0/fork-choice.md#filter_block_tree
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/fork-choice.md#filter_block_tree
|
||||
*
|
||||
* Any node that has a different finalized or justified epoch should not be viable for the
|
||||
* head.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Lodestar Light-client
|
||||
|
||||
[](https://discord.gg/aMxzVcr)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
## What you need
|
||||
|
||||
You will need to go over the [specification](https://github.com/ethereum/eth2.0-specs). You will also need to have a [basic understanding of sharding](https://github.com/ethereum/wiki/wiki/Sharding-FAQs).
|
||||
You will need to go over the [specification](https://github.com/ethereum/consensus-specs). You will also need to have a [basic understanding of sharding](https://github.com/ethereum/wiki/wiki/Sharding-FAQs).
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@chainsafe/lodestar-light-client",
|
||||
"description": "A Typescript implementation of the eth2 light client",
|
||||
"description": "A Typescript implementation of the Ethereum Consensus light client",
|
||||
"license": "Apache-2.0",
|
||||
"author": "ChainSafe Systems",
|
||||
"homepage": "https://github.com/ChainSafe/lodestar#readme",
|
||||
@@ -49,7 +49,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"light-client",
|
||||
"blockchain"
|
||||
|
||||
@@ -129,7 +129,7 @@ export function activeHeader(update: altair.LightClientUpdate): phase0.BeaconBlo
|
||||
* domain = get_domain(state, DOMAIN_SYNC_COMMITTEE, compute_epoch_at_slot(previous_slot))
|
||||
* signing_root = compute_signing_root(get_block_root_at_slot(state, previous_slot), domain)
|
||||
* ```
|
||||
* Ref: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/beacon-chain.md#sync-committee-processing
|
||||
* Ref: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/beacon-chain.md#sync-aggregate-processing
|
||||
*
|
||||
* @param syncCommittee SyncPeriod that signed this update: `computeSyncPeriodAtSlot(update.header.slot) - 1`
|
||||
* @param forkVersion ForkVersion that was used to sign the update
|
||||
|
||||
@@ -68,7 +68,7 @@ export function processLightClientUpdate(
|
||||
|
||||
// Apply update if (1) 2/3 quorum is reached and (2) we have a finality proof.
|
||||
// Note that (2) means that the current light client design needs finality.
|
||||
// It may be changed to re-organizable light client design. See the on-going issue eth2.0-specs#2182.
|
||||
// It may be changed to re-organizable light client design. See the on-going issue https://github.com/ethereum/consensus-specs/issues/2315.
|
||||
if (
|
||||
sumBits(update.syncAggregate.syncCommitteeBits) * 3 >= update.syncAggregate.syncCommitteeBits.length * 2 &&
|
||||
!isEmptyHeader(update.finalizedHeader)
|
||||
|
||||
@@ -23,7 +23,7 @@ export async function prepareUpdateNaive(
|
||||
// domain = get_domain(state, DOMAIN_SYNC_COMMITTEE, compute_epoch_at_slot(previous_slot))
|
||||
// signing_root = compute_signing_root(get_block_root_at_slot(state, previous_slot), domain)
|
||||
// ```
|
||||
// Ref: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/beacon-chain.md#sync-committee-processing
|
||||
// Ref: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/beacon-chain.md#sync-aggregate-processing
|
||||
//
|
||||
// Then the lightclient will verify it signs over `signedHeader`, where
|
||||
// ```js
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Lodestar
|
||||
|
||||
[](https://discord.gg/aMxzVcr)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
## What you need
|
||||
|
||||
You will need to go over the [specification](https://github.com/ethereum/eth2.0-specs). You will also need to have a [basic understanding of sharding](https://github.com/ethereum/wiki/wiki/Sharding-FAQs).
|
||||
You will need to go over the [specification](https://github.com/ethereum/consensus-specs). You will also need to have a [basic understanding of sharding](https://github.com/ethereum/wiki/wiki/Sharding-FAQs).
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
]
|
||||
|
||||
@@ -109,7 +109,7 @@ export function getBeaconPoolApi({
|
||||
* If a sync committee signature is validated successfully the node MUST publish that sync committee signature on all applicable subnets.
|
||||
* If one or more sync committee signatures fail validation the node MUST return a 400 error with details of which sync committee signatures have failed, and why.
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-APIs/pull/135
|
||||
* https://github.com/ethereum/beacon-APIs/pull/135
|
||||
*/
|
||||
async submitPoolSyncCommitteeSignatures(signatures) {
|
||||
// Fetch states for all slots of the `signatures`
|
||||
|
||||
@@ -6,12 +6,12 @@ import {ApiModules} from "../types";
|
||||
export function getConfigApi({config}: Pick<ApiModules, "config">): routes.config.Api {
|
||||
// Retrieve specification configuration used on this node. The configuration should include:
|
||||
// - Constants for all hard forks known by the beacon node, for example the
|
||||
// [phase 0](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#constants) and
|
||||
// [altair](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/altair/beacon-chain.md#constants) values
|
||||
// [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#constants) and
|
||||
// [altair](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/beacon-chain.md#constants) values
|
||||
// - Presets for all hard forks supplied to the beacon node, for example the
|
||||
// [phase 0](https://github.com/ethereum/eth2.0-specs/blob/dev/presets/mainnet/phase0.yaml) and
|
||||
// [altair](https://github.com/ethereum/eth2.0-specs/blob/dev/presets/mainnet/altair.yaml) values
|
||||
// - Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/eth2.0-specs/blob/dev/configs/mainnet.yaml) values
|
||||
// [phase 0](https://github.com/ethereum/consensus-specs/blob/v1.1.10/presets/mainnet/phase0.yaml) and
|
||||
// [altair](https://github.com/ethereum/consensus.0-specs/blob/v1.1.10/presets/mainnet/altair.yaml) values
|
||||
// - Configuration for the beacon node, for example the [mainnet](https://github.com/ethereum/consensus-specs/blob/v1.1.10/configs/mainnet.yaml) values
|
||||
|
||||
let jsonSpec: Record<string, string> | null = null;
|
||||
function getJsonSpec(): Record<string, string> {
|
||||
|
||||
@@ -25,7 +25,7 @@ export class ValidationError extends ApiError {
|
||||
}
|
||||
}
|
||||
|
||||
// Spec requires 503 - https://github.com/ethereum/eth2.0-APIs/blob/e68a954e1b6f6eb5421abf4532c171ce301c6b2e/types/http.yaml#L62
|
||||
// Spec requires 503 - https://github.com/ethereum/beacon-APIs/blob/e68a954e1b6f6eb5421abf4532c171ce301c6b2e/types/http.yaml#L62
|
||||
export class NodeIsSyncing extends ApiError {
|
||||
constructor(statusMsg: string) {
|
||||
super(503, `Node is syncing - ${statusMsg}`);
|
||||
|
||||
@@ -256,7 +256,7 @@ export function getValidatorApi({chain, config, logger, metrics, network, sync}:
|
||||
*
|
||||
* Requests that the beacon node produce a sync committee contribution.
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-APIs/pull/138
|
||||
* https://github.com/ethereum/beacon-APIs/pull/138
|
||||
*
|
||||
* @param slot The slot for which a sync committee contribution should be created.
|
||||
* @param subcommitteeIndex The subcommittee index for which to produce the contribution.
|
||||
@@ -366,7 +366,7 @@ export function getValidatorApi({chain, config, logger, metrics, network, sync}:
|
||||
* - `sync_committee_index` is the index of the validator in the sync committee. This can be used to infer the
|
||||
* subnet to which the contribution should be broadcast. Note, there can be multiple per validator.
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-APIs/pull/134
|
||||
* https://github.com/ethereum/beacon-APIs/pull/134
|
||||
*
|
||||
* @param validatorIndices an array of the validator indices for which to obtain the duties.
|
||||
*/
|
||||
@@ -490,7 +490,7 @@ export function getValidatorApi({chain, config, logger, metrics, network, sync}:
|
||||
*
|
||||
* Publish multiple signed sync committee contribution and proofs
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-APIs/pull/137
|
||||
* https://github.com/ethereum/beacon-APIs/pull/137
|
||||
*/
|
||||
async publishContributionAndProofs(contributionAndProofs) {
|
||||
notWhileSyncing();
|
||||
@@ -567,7 +567,7 @@ export function getValidatorApi({chain, config, logger, metrics, network, sync}:
|
||||
* Subscribing to sync committee subnets is an action performed by VC to enable network participation in Altair networks,
|
||||
* and only required if the VC has an active validator in an active sync committee.
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-APIs/pull/136
|
||||
* https://github.com/ethereum/beacon-APIs/pull/136
|
||||
*/
|
||||
async prepareSyncCommitteeSubnets(subscriptions) {
|
||||
notWhileSyncing();
|
||||
@@ -580,7 +580,7 @@ export function getValidatorApi({chain, config, logger, metrics, network, sync}:
|
||||
subs.push({
|
||||
validatorIndex: sub.validatorIndex,
|
||||
subnet: subnet,
|
||||
// Subscribe until the end of `untilEpoch`: https://github.com/ethereum/eth2.0-APIs/pull/136#issuecomment-840315097
|
||||
// Subscribe until the end of `untilEpoch`: https://github.com/ethereum/beacon-APIs/pull/136#issuecomment-840315097
|
||||
slot: computeStartSlotAtEpoch(sub.untilEpoch + 1),
|
||||
isAggregator: true,
|
||||
});
|
||||
|
||||
@@ -83,7 +83,7 @@ export class SyncContributionAndProofPool {
|
||||
if (!bestContributionBySubnet || bestContributionBySubnet.size === 0) {
|
||||
// TODO: Add metric for missing SyncAggregate
|
||||
// Must return signature as G2_POINT_AT_INFINITY when participating bits are empty
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/30f2a076377264677e27324a8c3c78c590ae5e20/specs/altair/bls.md#eth2_fast_aggregate_verify
|
||||
// https://github.com/ethereum/consensus-specs/blob/30f2a076377264677e27324a8c3c78c590ae5e20/specs/altair/bls.md#eth2_fast_aggregate_verify
|
||||
return {
|
||||
syncCommitteeBits: ssz.altair.SyncCommitteeBits.defaultValue(),
|
||||
syncCommitteeSignature: G2_POINT_AT_INFINITY,
|
||||
|
||||
@@ -257,7 +257,7 @@ function verifyAttestationTargetRoot(headBlock: IProtoBlock, targetRoot: Root, a
|
||||
// invalid in the spirit of the protocol. Here we choose safety over profit.
|
||||
//
|
||||
// Reference:
|
||||
// https://github.com/ethereum/eth2.0-specs/pull/2001#issuecomment-699246659
|
||||
// https://github.com/ethereum/consensus-specs/pull/2001#issuecomment-699246659
|
||||
throw new AttestationError(GossipAction.REJECT, {
|
||||
code: AttestationErrorCode.INVALID_TARGET_ROOT,
|
||||
targetRoot: toHexString(targetRoot),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* For more info on some of these constants:
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#configuration
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#configuration
|
||||
*/
|
||||
|
||||
// Gossip constants
|
||||
|
||||
@@ -25,7 +25,7 @@ export class Eth1DepositsCache {
|
||||
* Returns a list of `Deposit` objects, within the given deposit index `range`.
|
||||
*
|
||||
* The `depositCount` is used to generate the proofs for the `Deposits`. For example, if we
|
||||
* have 100 proofs, but the eth2 chain only acknowledges 50 of them, we must produce our
|
||||
* have 100 proofs, but the Ethereum Consensus chain only acknowledges 50 of them, we must produce our
|
||||
* proofs with respect to a tree size of 50.
|
||||
*/
|
||||
async get(indexRange: IFilterOptions<number>, eth1Data: phase0.Eth1Data): Promise<phase0.Deposit[]> {
|
||||
|
||||
@@ -4,7 +4,7 @@ export type IBeaconMetrics = ReturnType<typeof createBeaconMetrics>;
|
||||
|
||||
/**
|
||||
* Metrics from:
|
||||
* https://github.com/ethereum/eth2.0-metrics/ and
|
||||
* https://github.com/ethereum/beacon-metrics/ and
|
||||
* https://hackmd.io/D5FmoeFZScim_squBFl8oA
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type
|
||||
|
||||
@@ -77,7 +77,7 @@ export function computeMsgIdPhase0(topic: GossipTopic, msg: Eth2InMessage): Uint
|
||||
* snappy_decompress(message.data)
|
||||
* )[:20]
|
||||
* ```
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.7/specs/altair/p2p-interface.md#topics-and-messages
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/p2p-interface.md#topics-and-messages
|
||||
*/
|
||||
export function computeMsgIdAltair(topic: GossipTopic, topicStr: string, msg: Eth2InMessage): Uint8Array {
|
||||
switch (topic.encoding ?? DEFAULT_ENCODING) {
|
||||
|
||||
@@ -65,7 +65,7 @@ export interface IGossipsubModules {
|
||||
* - `handleTopic`
|
||||
* - `unhandleTopic`
|
||||
*
|
||||
* See https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#the-gossip-domain-gossipsub
|
||||
* See https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#the-gossip-domain-gossipsub
|
||||
*/
|
||||
export class Eth2Gossipsub extends Gossipsub {
|
||||
readonly jobQueues: GossipJobQueues;
|
||||
@@ -79,7 +79,7 @@ export class Eth2Gossipsub extends Gossipsub {
|
||||
|
||||
constructor(modules: IGossipsubModules) {
|
||||
// Gossipsub parameters defined here:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#the-gossip-domain-gossipsub
|
||||
// https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#the-gossip-domain-gossipsub
|
||||
super(modules.libp2p, {
|
||||
gossipIncoming: true,
|
||||
globalSignaturePolicy: "StrictNoSign" as const,
|
||||
|
||||
@@ -67,7 +67,7 @@ const MAX_UNKNOWN_BLOCK_ROOT_RETRIES = 1;
|
||||
* - We do expensive processing on the object in the validator function that we need to re-use in the handler function.
|
||||
* - The validator function produces extra data that is needed for the handler function. Making this data available in
|
||||
* the handler function scope is hard to achieve without very hacky strategies
|
||||
* - Eth2.0 gossipsub protocol strictly defined a single topic for message
|
||||
* - Ethereum Consensus gossipsub protocol strictly defined a single topic for message
|
||||
*/
|
||||
export function getGossipHandlers(modules: ValidatorFnsModules, options: GossipHandlerOpts): GossipHandlers {
|
||||
const {chain, config, metrics, network, logger} = modules;
|
||||
|
||||
@@ -115,7 +115,7 @@ export type Eth2InMessage = InMessage & {
|
||||
/**
|
||||
* Contains various methods for validation of incoming gossip topic data.
|
||||
* The conditions for valid gossip topics and how they are handled are specified here:
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#global-topics
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#global-topics
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -53,7 +53,7 @@ export function createValidatorFnsByType(
|
||||
|
||||
/**
|
||||
* Returns a GossipSub validator function from a GossipHandlerFn. GossipHandlerFn may throw GossipActionError if one
|
||||
* or more validation conditions from the eth2.0-specs#p2p-interface are not satisfied.
|
||||
* or more validation conditions from the consensus-specs#p2p-interface are not satisfied.
|
||||
*
|
||||
* This function receives a string topic and a binary message `InMessage` and deserializes both using caches.
|
||||
* - The topic string should be known in advance and pre-computed
|
||||
|
||||
@@ -30,9 +30,9 @@ export interface IMetadataModules {
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of eth2 p2p MetaData.
|
||||
* Implementation of Ethereum Consensus p2p MetaData.
|
||||
* For the spec that this code is based on, see:
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#metadata
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#metadata
|
||||
*/
|
||||
export class MetadataController {
|
||||
private enr?: ENR;
|
||||
|
||||
@@ -9,8 +9,8 @@ import {BufferedSource} from "../utils";
|
||||
import {readSszSnappyPayload, ISszSnappyOptions} from "./sszSnappy/decode";
|
||||
import {writeSszSnappyPayload} from "./sszSnappy/encode";
|
||||
|
||||
// For more info about eth2 request/response encoding strategies, see:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#encoding-strategies
|
||||
// For more info about Ethereum Consensus request/response encoding strategies, see:
|
||||
// https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#encoding-strategies
|
||||
// Supported encoding strategies:
|
||||
// - ssz_snappy
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ import {InboundRateLimiter, RateLimiterOpts} from "./response/rateLimiter";
|
||||
export type IReqRespOptions = Partial<typeof timeoutOptions>;
|
||||
|
||||
/**
|
||||
* Implementation of eth2 p2p Req/Resp domain.
|
||||
* Implementation of Ethereum Consensus p2p Req/Resp domain.
|
||||
* For the spec that this code is based on, see:
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#the-reqresp-domain
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#the-reqresp-domain
|
||||
*/
|
||||
export class ReqResp implements IReqResp {
|
||||
private config: IBeaconConfig;
|
||||
|
||||
@@ -21,7 +21,7 @@ export enum Version {
|
||||
|
||||
/**
|
||||
* Available request/response encoding strategies:
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#encoding-strategies
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#encoding-strategies
|
||||
*/
|
||||
export enum Encoding {
|
||||
SSZ_SNAPPY = "ssz_snappy",
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
// By convention, the error_message is a sequence of bytes that MAY be interpreted as a
|
||||
// UTF-8 string (for debugging purposes). Clients MUST treat as valid any byte sequences
|
||||
//
|
||||
// Spec v1.0.0 https://github.com/ethereum/eth2.0-specs/blob/v1.0.0-rc.0/specs/phase0/p2p-interface.md#responding-side
|
||||
// Spec v1.1.10 https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#responding-side
|
||||
|
||||
/**
|
||||
* Encodes a UTF-8 string to 256 bytes max
|
||||
|
||||
@@ -60,7 +60,7 @@ export enum BeaconNodeStatus {
|
||||
|
||||
/**
|
||||
* The main Beacon Node class. Contains various components for getting and processing data from the
|
||||
* eth2 ecosystem as well as systems for getting beacon node metadata.
|
||||
* Ethereum Consensus ecosystem as well as systems for getting beacon node metadata.
|
||||
*/
|
||||
export class BeaconNode {
|
||||
opts: IBeaconNodeOptions;
|
||||
|
||||
@@ -22,7 +22,7 @@ const rootGenericSszPath = path.join(SPEC_TEST_LOCATION, "tests", "general", "ph
|
||||
// | serialized.ssz_snappy
|
||||
// | value.yaml
|
||||
//
|
||||
// Docs: https://github.com/ethereum/eth2.0-specs/blob/master/tests/formats/ssz_generic/README.md
|
||||
// Docs: https://github.com/ethereum/consensus-specs/blob/master/tests/formats/ssz_generic/README.md
|
||||
|
||||
for (const testType of fs.readdirSync(rootGenericSszPath)) {
|
||||
const testTypePath = path.join(rootGenericSszPath, testType);
|
||||
|
||||
@@ -16,7 +16,7 @@ import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params";
|
||||
import {createIChainForkConfig} from "@chainsafe/lodestar-config";
|
||||
import {SeenContributionAndProof} from "../../../../src/chain/seenCache";
|
||||
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.3/specs/altair/p2p-interface.md
|
||||
// https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/p2p-interface.md
|
||||
describe("Sync Committee Contribution And Proof validation", function () {
|
||||
const sandbox = sinon.createSandbox();
|
||||
let chain: SinonStubbedInstance<IBeaconChain>;
|
||||
|
||||
@@ -13,7 +13,7 @@ import {SLOTS_PER_EPOCH} from "@chainsafe/lodestar-params";
|
||||
import {createIChainForkConfig, defaultChainConfig} from "@chainsafe/lodestar-config";
|
||||
import {SeenSyncCommitteeMessages} from "../../../../src/chain/seenCache";
|
||||
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.3/specs/altair/p2p-interface.md
|
||||
// https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/altair/p2p-interface.md
|
||||
describe("Sync Committee Signature validation", function () {
|
||||
const sandbox = sinon.createSandbox();
|
||||
let chain: SinonStubbedInstance<IBeaconChain>;
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
|
||||
[](https://www.npmjs.com/package/@chainsafe/lodestar-types)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
Lodestar defines all constants and presets defined in the [Ethereum Consensus / Eth2 spec](https://github.com/ethereum/eth2.0-specs). This can be used in conjunction with other Lodestar libraries to interact with the Ethereum consensus.
|
||||
|
||||
Lodestar defines all constants and presets defined in the [Ethereum Consensus spec](https://github.com/ethereum/consensus-specs). This can be used in conjunction with other Lodestar libraries to interact with the Ethereum consensus.
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
],
|
||||
|
||||
@@ -140,7 +140,7 @@ export const PARTICIPATION_FLAG_WEIGHTS = [TIMELY_SOURCE_WEIGHT, TIMELY_TARGET_W
|
||||
export const TARGET_AGGREGATORS_PER_COMMITTEE = 16;
|
||||
export const RANDOM_SUBNETS_PER_VALIDATOR = 1;
|
||||
export const EPOCHS_PER_RANDOM_SUBNET_SUBSCRIPTION = 256;
|
||||
/** Rationale: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md#why-are-there-attestation_subnet_count-attestation-subnets */
|
||||
/** Rationale: https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/p2p-interface.md#why-are-there-attestation_subnet_count-attestation-subnets */
|
||||
export const ATTESTATION_SUBNET_COUNT = 64;
|
||||
|
||||
// altair validator
|
||||
|
||||
@@ -32,9 +32,9 @@ function assertCorrectPreset(localPreset: BeaconPreset, remotePreset: BeaconPres
|
||||
|
||||
async function downloadRemoteConfig(preset: "mainnet" | "minimal", commit: string): Promise<BeaconPreset> {
|
||||
const urlByFork: Record<ForkName, string> = {
|
||||
[ForkName.phase0]: `https://raw.githubusercontent.com/ethereum/eth2.0-specs/${commit}/presets/${preset}/phase0.yaml`,
|
||||
[ForkName.altair]: `https://raw.githubusercontent.com/ethereum/eth2.0-specs/${commit}/presets/${preset}/altair.yaml`,
|
||||
[ForkName.bellatrix]: `https://raw.githubusercontent.com/ethereum/eth2.0-specs/${commit}/presets/${preset}/bellatrix.yaml`,
|
||||
[ForkName.phase0]: `https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/presets/${preset}/phase0.yaml`,
|
||||
[ForkName.altair]: `https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/presets/${preset}/altair.yaml`,
|
||||
[ForkName.bellatrix]: `https://raw.githubusercontent.com/ethereum/consensus-specs/${commit}/presets/${preset}/bellatrix.yaml`,
|
||||
};
|
||||
|
||||
const downloadedParams = await Promise.all(
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
],
|
||||
|
||||
@@ -33,7 +33,7 @@ interface TestSpec<TestCase extends IBaseCase> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Run yaml Eth2.0 bulk spec tests (m) for a certain function
|
||||
* Run yaml Ethereum Consensus bulk spec tests (m) for a certain function
|
||||
* Compares actual vs expected for all test cases
|
||||
* @param {string} testYamlPath - path to yaml spec test
|
||||
* @param {Function} testFunc - function to use to generate output
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
[](https://www.npmjs.com/package/@chainsafe/lodestar-types)
|
||||
[](https://opensource.org/licenses/Apache-2.0)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
Lodestar defines all datatypes defined in the [Ethereum Consensus / Eth2 spec](https://github.com/ethereum/eth2.0-specs). This tooling can be used for any Typescript project looking to operate on these types. Both Typescript interfaces _and_ Simple Serialize (SSZ) methods are exported for consumers.
|
||||
Lodestar defines all datatypes defined in the [Ethereum Consensus spec](https://github.com/ethereum/consensus-specs). This tooling can be used for any Typescript project looking to operate on these types. Both Typescript interfaces _and_ Simple Serialize (SSZ) methods are exported for consumers.
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
]
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
]
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Lodestar Validator
|
||||
|
||||
[](https://discord.gg/aMxzVcr)
|
||||

|
||||
[](https://github.com/ethereum/consensus-specs/releases/tag/v1.1.10)
|
||||

|
||||

|
||||

|
||||
|
||||
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
||||
|
||||
Typescript implementation of the Eth2.0 validator client. Enables developers to submit their own
|
||||
eth2 api compatible beacon nodes/databases/loggers.
|
||||
Typescript implementation of the Ethereum Consensus validator client. Enables developers to submit their own
|
||||
eth-consensus api compatible beacon nodes/databases/loggers.
|
||||
|
||||
## Getting started
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
},
|
||||
"keywords": [
|
||||
"ethereum",
|
||||
"eth2",
|
||||
"eth-consensus",
|
||||
"beacon",
|
||||
"blockchain"
|
||||
],
|
||||
|
||||
@@ -78,7 +78,7 @@ export class SyncCommitteeService {
|
||||
* Performs the first step of the attesting process: downloading `SyncCommittee` objects,
|
||||
* signing them and returning them to the validator.
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/validator.md#attesting
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/validator.md#attesting
|
||||
*
|
||||
* Only one `SyncCommittee` is downloaded from the BN. It is then signed by each
|
||||
* validator and the list of individually-signed `SyncCommittee` objects is returned to the BN.
|
||||
@@ -130,7 +130,7 @@ export class SyncCommitteeService {
|
||||
* Performs the second step of the attesting process: downloading an aggregated `SyncCommittee`,
|
||||
* converting it into a `SignedAggregateAndProof` and returning it to the BN.
|
||||
*
|
||||
* https://github.com/ethereum/eth2.0-specs/blob/v0.12.1/specs/phase0/validator.md#broadcast-aggregate
|
||||
* https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/validator.md#broadcast-aggregate
|
||||
*
|
||||
* Only one aggregated `SyncCommittee` is downloaded from the BN. It is then signed
|
||||
* by each validator and the list of individually-signed `SignedAggregateAndProof` objects is
|
||||
|
||||
@@ -71,7 +71,7 @@ export class SyncCommitteeDutiesService {
|
||||
* Note: The range of slots a validator has to perform duties is off by one.
|
||||
* The previous slot wording means that if your validator is in a sync committee for a period that runs from slot
|
||||
* 100 to 200,then you would actually produce signatures in slot 99 - 199.
|
||||
* https://github.com/ethereum/eth2.0-specs/pull/2400
|
||||
* https://github.com/ethereum/consensus-specs/pull/2400
|
||||
*/
|
||||
async getDutiesAtSlot(slot: Slot): Promise<SyncDutyAndProofs[]> {
|
||||
const period = computeSyncPeriodAtSlot(slot + 1); // See note above for the +1 offset
|
||||
|
||||
@@ -17,7 +17,7 @@ export function getLoggerVc(logger: ILogger, clock: IClock): ILoggerVc {
|
||||
error(message: string, context?: LogData, e?: Error) {
|
||||
if (e) {
|
||||
// Returns true if it's an network error with code 503 = Node is syncing
|
||||
// https://github.com/ethereum/eth2.0-APIs/blob/e68a954e1b6f6eb5421abf4532c171ce301c6b2e/types/http.yaml#L62
|
||||
// https://github.com/ethereum/beacon-APIs/blob/e68a954e1b6f6eb5421abf4532c171ce301c6b2e/types/http.yaml#L62
|
||||
if (e instanceof HttpError && e.status === 503) {
|
||||
this.isSyncing(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user