mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Reduce Usage of Eth2 Terminology in Prysm (#9104)
* remove all mentions * more changes * folder by folder Co-authored-by: terence tsao <terence@prysmaticlabs.com> Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
parent
dd0ae1bbef
commit
a860648960
@ -175,7 +175,7 @@ We consider two types of contributions to our repo and categorize them as follow
|
||||
|
||||
### Part-Time Contributors
|
||||
|
||||
Anyone can become a part-time contributor and help out on implementing eth2. The responsibilities of a part-time contributor include:
|
||||
Anyone can become a part-time contributor and help out on implementing Ethereum consensus. The responsibilities of a part-time contributor include:
|
||||
|
||||
- Engaging in Gitter conversations, asking the questions on how to begin contributing to the project
|
||||
- Opening up github issues to express interest in code to implement
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Prysm Client Interoperability Guide
|
||||
|
||||
This README details how to setup Prysm for interop testing for usage with other Ethereum 2.0 clients.
|
||||
This README details how to setup Prysm for interop testing for usage with other Ethereum consensus clients.
|
||||
|
||||
## Installation & Setup
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
# Prysm: An Ethereum 2.0 Implementation Written in Go
|
||||
# Prysm: An Ethereum Consensus Implementation Written in Go
|
||||
|
||||
[![Build status](https://badge.buildkite.com/b555891daf3614bae4284dcf365b2340cefc0089839526f096.svg?branch=master)](https://buildkite.com/prysmatic-labs/prysm)
|
||||
[![Go Report Card](https://goreportcard.com/badge/github.com/prysmaticlabs/prysm)](https://goreportcard.com/report/github.com/prysmaticlabs/prysm)
|
||||
[![ETH2.0_Spec_Version 1.0.0](https://img.shields.io/badge/ETH2.0%20Spec%20Version-v1.0.0-blue.svg)](https://github.com/ethereum/eth2.0-specs/tree/v1.0.0)
|
||||
[![Discord](https://user-images.githubusercontent.com/7288322/34471967-1df7808a-efbb-11e7-9088-ed0b04151291.png)](https://discord.gg/CTYGPUJ)
|
||||
|
||||
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the [Ethereum 2.0](https://ethereum.org/en/eth2/) specification, developed by [Prysmatic Labs](https://prysmaticlabs.com). See the [Changelog](https://github.com/prysmaticlabs/prysm/releases) for details of the latest releases and upcoming breaking changes.
|
||||
This is the core repository for Prysm, a [Golang](https://golang.org/) implementation of the [Ethereum Consensus](https://ethereum.org/en/eth2/) specification, developed by [Prysmatic Labs](https://prysmaticlabs.com). See the [Changelog](https://github.com/prysmaticlabs/prysm/releases) for details of the latest releases and upcoming breaking changes.
|
||||
|
||||
### Getting Started
|
||||
|
||||
|
@ -5,7 +5,7 @@ Effective as of Oct 14, 2020
|
||||
By downloading, accessing or using the Prysm implementation (“Prysm”), you (referenced herein as “you” or the “user”) certify that you have read and agreed to the terms and conditions below (the “Terms”) which form a binding contract between you and Prysmatic Labs (referenced herein as “we” or “us”). If you do not agree to the Terms, do not download or use Prysm.
|
||||
|
||||
### About Prysm
|
||||
Prysm is a client implementation for Ethereum 2.0 Phase 0 protocol for a proof-of-stake blockchain. To participate in the network, a user must send ETH from the Eth1.0 chain into a validator deposit contract, which will queue in the user as a validator in the system. Validators participate in proposing and voting on blocks in the protocol, and the network applies rewards/penalties based on their behavior. A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the official documentation portal, however, we do not warrant the accuracy, completeness or usefulness of this documentation. Any reliance you place on such information is strictly at your own risk.
|
||||
Prysm is a client implementation for Ethereum consensus protocol for a proof-of-stake blockchain. To participate in the network, a user must send ETH from the Eth1.0 chain into a validator deposit contract, which will queue in the user as a validator in the system. Validators participate in proposing and voting on blocks in the protocol, and the network applies rewards/penalties based on their behavior. A detailed set of installation and usage instructions as well as breakdowns of each individual component are available in the official documentation portal, however, we do not warrant the accuracy, completeness or usefulness of this documentation. Any reliance you place on such information is strictly at your own risk.
|
||||
|
||||
### Licensing Terms
|
||||
Prysm is a fully open-source software program licensed pursuant to the GNU General Public License v3.0.
|
||||
@ -13,7 +13,7 @@ Prysm is a fully open-source software program licensed pursuant to the GNU Gener
|
||||
The Prysmatic Labs name, the term “Prysm” and all related names, logos, product and service names, designs and slogans are trademarks of Prysmatic Labs or its affiliates and/or licensors. You must not use such marks without our prior written permission.
|
||||
|
||||
### Risks of Operating Prysm
|
||||
The use of Prysm and acting as a validator on the Ethereum 2.0 network can lead to loss of money. Ethereum is still an experimental system and ETH remains a risky investment. You alone are responsible for your actions on Prysm including the security of your ETH and meeting any applicable minimum system requirements.
|
||||
The use of Prysm and acting as a validator on the Ethereum network can lead to loss of money. Ethereum is still an experimental system and ETH remains a risky investment. You alone are responsible for your actions on Prysm including the security of your ETH and meeting any applicable minimum system requirements.
|
||||
|
||||
Use of Prysm and the ability to receive rewards or penalties may be affected at any time by mistakes made by the user or other users, software problems such as bugs, errors, incorrectly constructed transactions, unsafe cryptographic libraries or malware affecting the network, technical failures in the hardware of a user, security problems experienced by a user and/or actions or inactions of third parties and/or events experienced by third parties, among other risks. We cannot and do not guarantee that any user of Prysm will make money, that the Prysm network will operate in accordance with the documentation or that transactions will be effective or secure.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Prysmatic Labs Beacon Chain Implementation
|
||||
|
||||
This is the main project folder for the beacon chain implementation of eth2 written in Go by [Prysmatic Labs](https://prysmaticlabs.com).
|
||||
This is the main project folder for the beacon chain implementation of Ethereum written in Go by [Prysmatic Labs](https://prysmaticlabs.com).
|
||||
|
||||
You can also read our main [README](https://github.com/prysmaticlabs/prysm/blob/master/README.md) and join our active chat room on Discord.
|
||||
|
||||
|
@ -26,13 +26,13 @@ type ChainInfoFetcher interface {
|
||||
CanonicalFetcher
|
||||
}
|
||||
|
||||
// TimeFetcher retrieves the Eth2 data that's related to time.
|
||||
// TimeFetcher retrieves the Ethereum consensus data that's related to time.
|
||||
type TimeFetcher interface {
|
||||
GenesisTime() time.Time
|
||||
CurrentSlot() types.Slot
|
||||
}
|
||||
|
||||
// GenesisFetcher retrieves the eth2 data related to its genesis.
|
||||
// GenesisFetcher retrieves the Ethereum consensus data related to its genesis.
|
||||
type GenesisFetcher interface {
|
||||
GenesisValidatorRoot() [32]byte
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
// Package blockchain defines the life-cycle of the blockchain at the core of
|
||||
// eth2, including processing of new blocks and attestations using casper
|
||||
// proof of stake.
|
||||
// Ethereum, including processing of new blocks and attestations using proof of stake.
|
||||
package blockchain
|
||||
|
||||
import (
|
||||
|
2
beacon-chain/cache/doc.go
vendored
2
beacon-chain/cache/doc.go
vendored
@ -1,5 +1,5 @@
|
||||
// Package cache includes all important caches for the runtime
|
||||
// of an eth2 beacon node, ensuring the node does not spend
|
||||
// of an Ethereum Beacon Node, ensuring the node does not spend
|
||||
// resources computing duplicate operations such as committee
|
||||
// calculations for validators during the same epoch, etc.
|
||||
package cache
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package blocks contains block processing libraries according to
|
||||
// the eth2spec.
|
||||
// the Ethereum beacon chain spec.
|
||||
package blocks
|
||||
|
||||
import (
|
||||
|
@ -127,7 +127,7 @@ func weighJustificationAndFinalization(state iface.BeaconState,
|
||||
}
|
||||
}
|
||||
|
||||
// Process finalization according to ETH2.0 specifications.
|
||||
// Process finalization according to Ethereum Beacon Chain specification.
|
||||
justification := state.JustificationBits().Bytes()[0]
|
||||
|
||||
// 2nd/3rd/4th (0b1110) most recent epochs are justified, the 2nd using the 4th as source.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package helpers contains helper functions outlined in the eth2 beacon chain spec, such as
|
||||
// Package helpers contains helper functions outlined in the Ethereum Beacon Chain spec, such as
|
||||
// computing committees, randao, rewards/penalties, and more.
|
||||
package helpers
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Package state implements the whole state transition
|
||||
// function which consists of per slot, per-epoch transitions, and
|
||||
// bootstrapping the genesis state according to the eth2 spec.
|
||||
// bootstrapping the genesis state according to the Ethereum Beacon chain spec.
|
||||
package state
|
||||
|
||||
import (
|
||||
|
@ -46,7 +46,7 @@ var processExitFunc = func(ctx context.Context, s iface.BeaconState, blk interfa
|
||||
return b.ProcessVoluntaryExits(ctx, s, blk.Block().Body().VoluntaryExits())
|
||||
}
|
||||
|
||||
// This defines the processing block routine as outlined in eth2 spec:
|
||||
// This defines the processing block routine as outlined in the Ethereum Beacon Chain spec:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#block-processing
|
||||
var processingPipeline = []processFunc{
|
||||
b.ProcessBlockHeader,
|
||||
|
@ -2,15 +2,15 @@ package db
|
||||
|
||||
import "github.com/prysmaticlabs/prysm/beacon-chain/db/iface"
|
||||
|
||||
// ReadOnlyDatabase exposes Prysm's eth2 data backend for read access only, no information about
|
||||
// ReadOnlyDatabase exposes Prysm's Ethereum data backend for read access only, no information about
|
||||
// head info. For head info, use github.com/prysmaticlabs/prysm/blockchain.HeadFetcher.
|
||||
type ReadOnlyDatabase = iface.ReadOnlyDatabase
|
||||
|
||||
// NoHeadAccessDatabase exposes Prysm's eth2 data backend for read/write access, no information
|
||||
// NoHeadAccessDatabase exposes Prysm's Ethereum data backend for read/write access, no information
|
||||
// about head info. For head info, use github.com/prysmaticlabs/prysm/blockchain.HeadFetcher.
|
||||
type NoHeadAccessDatabase = iface.NoHeadAccessDatabase
|
||||
|
||||
// HeadAccessDatabase exposes Prysm's eth2 backend for read/write access with information about
|
||||
// HeadAccessDatabase exposes Prysm's Ethereum backend for read/write access with information about
|
||||
// chain head information. This interface should be used sparingly as the HeadFetcher is the source
|
||||
// of truth around chain head information while this interface serves as persistent storage for the
|
||||
// head fetcher.
|
||||
@ -18,7 +18,7 @@ type NoHeadAccessDatabase = iface.NoHeadAccessDatabase
|
||||
// See github.com/prysmaticlabs/prysm/blockchain.HeadFetcher
|
||||
type HeadAccessDatabase = iface.HeadAccessDatabase
|
||||
|
||||
// Database defines the necessary methods for Prysm's eth2 backend which may be implemented by any
|
||||
// Database defines the necessary methods for Prysm's Ethereum backend which may be implemented by any
|
||||
// key-value or relational database in practice. This is the full database interface which should
|
||||
// not be used often. Prefer a more restrictive interface in this package.
|
||||
type Database = iface.Database
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package db defines the ability to create a new database
|
||||
// for an eth2 beacon node.
|
||||
// for an Ethereum Beacon Node.
|
||||
package db
|
||||
|
||||
import (
|
||||
|
@ -52,7 +52,7 @@ type QueryFilter struct {
|
||||
}
|
||||
|
||||
// NewFilter instantiates a new QueryFilter type used to build filters for
|
||||
// certain eth2 data types by attribute.
|
||||
// certain Ethereum data types by attribute.
|
||||
func NewFilter() *QueryFilter {
|
||||
return &QueryFilter{
|
||||
queries: make(map[FilterType]interface{}),
|
||||
|
@ -107,7 +107,7 @@ type HeadAccessDatabase interface {
|
||||
EnsureEmbeddedGenesis(ctx context.Context) error
|
||||
}
|
||||
|
||||
// SlasherDatabase interface for persisting data related to detecting slashable offenses on eth2.
|
||||
// SlasherDatabase interface for persisting data related to detecting slashable offenses on Ethereum.
|
||||
type SlasherDatabase interface {
|
||||
io.Closer
|
||||
SaveLastEpochWrittenForValidators(
|
||||
|
@ -42,7 +42,7 @@ func (s *Store) Block(ctx context.Context, blockRoot [32]byte) (interfaces.Signe
|
||||
return interfaces.WrappedPhase0SignedBeaconBlock(block), err
|
||||
}
|
||||
|
||||
// HeadBlock returns the latest canonical block in eth2.
|
||||
// HeadBlock returns the latest canonical block in the Ethereum Beacon Chain.
|
||||
func (s *Store) HeadBlock(ctx context.Context) (interfaces.SignedBeaconBlock, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "BeaconDB.HeadBlock")
|
||||
defer span.End()
|
||||
|
@ -54,7 +54,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
// Store defines an implementation of the Prysm Database interface
|
||||
// using BoltDB as the underlying persistent kv-store for eth2.
|
||||
// using BoltDB as the underlying persistent kv-store for Ethereum Beacon Nodes.
|
||||
type Store struct {
|
||||
db *bolt.DB
|
||||
databasePath string
|
||||
|
@ -29,7 +29,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
// Store defines an implementation of the Prysm Database interface
|
||||
// using BoltDB as the underlying persistent kv-store for eth2.
|
||||
// using BoltDB as the underlying persistent kv-store for Ethereum consensus.
|
||||
type Store struct {
|
||||
db *bolt.DB
|
||||
databasePath string
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Package forkchoice implements the service to support fork choice for the eth2 beacon chain. This contains the
|
||||
Package forkchoice implements the service to support fork choice for the Ethereum beacon chain. This contains the
|
||||
necessary components to track latest validators votes, and balances. Then a store object to be used
|
||||
to calculate head. High level fork choice summary:
|
||||
https://notes.ethereum.org/@vbuterin/rkhCgQteN?type=view#LMD-GHOST-fork-choice-rule
|
||||
|
@ -18,7 +18,7 @@ func PowchainPreregistration(cliCtx *cli.Context) (depositContractAddress string
|
||||
|
||||
if cliCtx.String(flags.HTTPWeb3ProviderFlag.Name) == "" && len(cliCtx.StringSlice(flags.FallbackWeb3ProviderFlag.Name)) == 0 {
|
||||
log.Error(
|
||||
"No ETH1 node specified to run with the beacon node. Please consider running your own ETH1 node for better uptime, security, and decentralization of ETH2. Visit https://docs.prylabs.network/docs/prysm-usage/setup-eth1 for more information.",
|
||||
"No ETH1 node specified to run with the beacon node. Please consider running your own Ethereum proof-of-work node for better uptime, security, and decentralization of Ethereum. Visit https://docs.prylabs.network/docs/prysm-usage/setup-eth1 for more information.",
|
||||
)
|
||||
log.Error(
|
||||
"You will need to specify --http-web3provider and/or --fallback-web3provider to attach an eth1 node to the prysm node. Without an eth1 node block proposals for your validator will be affected and the beacon node will not be able to initialize the genesis state.",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Package p2p implements the Ethereum 2.0 networking specification.
|
||||
Package p2p implements the Ethereum consensus networking specification.
|
||||
|
||||
Canonical spec reference: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/p2p-interface.md
|
||||
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"io"
|
||||
)
|
||||
|
||||
// NetworkEncoding represents an encoder compatible with Ethereum 2.0 p2p.
|
||||
// NetworkEncoding represents an encoder compatible with Ethereum consensus p2p.
|
||||
type NetworkEncoding interface {
|
||||
// DecodeGossip to the provided gossip message. The interface must be a pointer to the decoding destination.
|
||||
DecodeGossip([]byte, interface{}) error
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
// ENR key used for eth2-related fork data.
|
||||
// ENR key used for Ethereum consensus-related fork data.
|
||||
var eth2ENRKey = params.BeaconNetworkConfig().ETH2Key
|
||||
|
||||
// ForkDigest returns the current fork digest of
|
||||
@ -78,7 +78,7 @@ func (s *Service) compareForkENR(record *enr.Record) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Adds a fork entry as an ENR record under the eth2EnrKey for
|
||||
// Adds a fork entry as an ENR record under the Ethereum consensus EnrKey for
|
||||
// the local node. The fork entry is an ssz-encoded enrForkID type
|
||||
// which takes into account the current fork version from the current
|
||||
// epoch to create a fork digest, the next fork version,
|
||||
@ -123,7 +123,7 @@ func addForkEntry(
|
||||
}
|
||||
|
||||
// Retrieves an enrForkID from an ENR record by key lookup
|
||||
// under the eth2EnrKey.
|
||||
// under the Ethereum consensus EnrKey
|
||||
func forkEntry(record *enr.Record) (*pb.ENRForkID, error) {
|
||||
sszEncodedForkEntry := make([]byte, 16)
|
||||
entry := enr.WithEntry(eth2ENRKey, &sszEncodedForkEntry)
|
||||
|
@ -58,7 +58,7 @@ func TestStartDiscv5_DifferentForkDigests(t *testing.T) {
|
||||
|
||||
// We give every peer a different genesis validators root, which
|
||||
// will cause each peer to have a different ForkDigest, preventing
|
||||
// them from connecting according to our discovery rules for eth2.
|
||||
// them from connecting according to our discovery rules for Ethereum consensus.
|
||||
root := make([]byte, 32)
|
||||
copy(root, strconv.Itoa(port))
|
||||
s = &Service{
|
||||
@ -149,7 +149,7 @@ func TestStartDiscv5_SameForkDigests_DifferentNextForkData(t *testing.T) {
|
||||
|
||||
// We give every peer a different genesis validators root, which
|
||||
// will cause each peer to have a different ForkDigest, preventing
|
||||
// them from connecting according to our discovery rules for eth2.
|
||||
// them from connecting according to our discovery rules for Ethereum consensus.
|
||||
s = &Service{
|
||||
cfg: cfg,
|
||||
genesisTime: genesisTime,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package peers provides information about peers at the eth2 protocol level.
|
||||
// Package peers provides information about peers at the Ethereum consensus protocol level.
|
||||
//
|
||||
// "Protocol level" is the level above the network level, so this layer never sees or interacts with
|
||||
// (for example) hosts that are uncontactable due to being down, firewalled, etc. Instead, this works
|
||||
|
@ -123,7 +123,7 @@ func (s *Service) peerInspector(peerMap map[peer.ID]*pubsub.PeerScoreSnapshot) {
|
||||
|
||||
// Content addressable ID function.
|
||||
//
|
||||
// ETH2 spec defines the message ID as:
|
||||
// Ethereum Beacon Chain spec defines the message ID as:
|
||||
// The `message-id` of a gossipsub message MUST be the following 20 byte value computed from the message data:
|
||||
// If `message.data` has a valid snappy decompression, set `message-id` to the first 20 bytes of the `SHA256` hash of
|
||||
// the concatenation of `MESSAGE_DOMAIN_VALID_SNAPPY` with the snappy decompressed message data,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package p2p defines the network protocol implementation for eth2
|
||||
// Package p2p defines the network protocol implementation for Ethereum consensus
|
||||
// used by beacon nodes, including peer discovery using discv5, gossip-sub
|
||||
// using libp2p, and handing peer lifecycles + handshakes.
|
||||
package p2p
|
||||
|
@ -40,7 +40,7 @@ pkg_deb(
|
||||
"etc/prysm/beacon-chain.yaml",
|
||||
],
|
||||
data = ":debian-data",
|
||||
description = "Prysm Beacon Chain - Ethereum 2.0 network communications",
|
||||
description = "Prysm Beacon Chain - Ethereum consensus network communications",
|
||||
homepage = "https://prysmaticlabs.com/",
|
||||
maintainer = "Prysmatic Labs <contact@prysmaticlabs.com>",
|
||||
package = "prysm-beacon-chain",
|
||||
|
@ -1,5 +1,5 @@
|
||||
[Unit]
|
||||
Description=Prysm Eth2 Beacon Chain
|
||||
Description=Prysm Ethereum Beacon Chain
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
|
@ -85,7 +85,7 @@ type ChainStartFetcher interface {
|
||||
ClearPreGenesisData()
|
||||
}
|
||||
|
||||
// ChainInfoFetcher retrieves information about eth1 metadata at the eth2 genesis time.
|
||||
// ChainInfoFetcher retrieves information about eth1 metadata at the Ethereum consensus genesis time.
|
||||
type ChainInfoFetcher interface {
|
||||
Eth2GenesisPowchainInfo() (uint64, *big.Int)
|
||||
IsConnectedToETH1() bool
|
||||
|
@ -383,7 +383,7 @@ func (bs *Server) collectReceivedAttestations(ctx context.Context) {
|
||||
// yet processed. Pool attestations eventually expire as the slot
|
||||
// advances, so an attestation missing from this request does not imply
|
||||
// that it was included in a block. The attestation may have expired.
|
||||
// Refer to the ethereum 2.0 specification for more details on how
|
||||
// Refer to the ethereum consensus specification for more details on how
|
||||
// attestations are processed and when they are no longer valid.
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
|
||||
func (bs *Server) AttestationPool(
|
||||
|
@ -24,8 +24,7 @@ import (
|
||||
)
|
||||
|
||||
// Server defines a server implementation of the gRPC Beacon Chain service,
|
||||
// providing RPC endpoints to access data relevant to the Ethereum 2.0 phase 0
|
||||
// beacon chain.
|
||||
// providing RPC endpoints to access data relevant to the Ethereum beacon chain.
|
||||
type Server struct {
|
||||
BeaconDB db.ReadOnlyDatabase
|
||||
Ctx context.Context
|
||||
|
@ -16,8 +16,7 @@ import (
|
||||
)
|
||||
|
||||
// Server defines a server implementation of the gRPC Beacon Chain service,
|
||||
// providing RPC endpoints to access data relevant to the Ethereum 2.0 phase 0
|
||||
// beacon chain.
|
||||
// providing RPC endpoints to access data relevant to the Ethereum Beacon Chain.
|
||||
type Server struct {
|
||||
BeaconDB db.ReadOnlyDatabase
|
||||
ChainInfoFetcher blockchain.ChainInfoFetcher
|
||||
|
@ -10,8 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// Server defines a server implementation of the gRPC Beacon Chain service,
|
||||
// providing RPC endpoints to access data relevant to the Ethereum 2.0 phase 0
|
||||
// beacon chain.
|
||||
// providing RPC endpoints to access data relevant to the Ethereum Beacon Chain.
|
||||
type Server struct {
|
||||
BeaconDB db.ReadOnlyDatabase
|
||||
HeadFetcher blockchain.HeadFetcher
|
||||
|
@ -39,7 +39,7 @@ var casesHandled = map[string]bool{
|
||||
ChainReorgTopic: true,
|
||||
}
|
||||
|
||||
// StreamEvents allows requesting all events from a set of topics defined in the eth2.0-apis standard.
|
||||
// StreamEvents allows requesting all events from a set of topics defined in the Ethereum consensus API standard.
|
||||
// The topics supported include block events, attestations, chain reorgs, voluntary exits,
|
||||
// chain finality, and more.
|
||||
func (s *Server) StreamEvents(
|
||||
|
@ -51,7 +51,7 @@ func (ns *Server) GetSyncStatus(_ context.Context, _ *empty.Empty) (*ethpb.SyncS
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetGenesis fetches genesis chain information of Ethereum 2.0. Returns unix timestamp 0
|
||||
// GetGenesis fetches genesis chain information of Ethereum. Returns unix timestamp 0
|
||||
// if a genesis time has yet to be determined.
|
||||
func (ns *Server) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) {
|
||||
contractAddr, err := ns.BeaconDB.DepositContractAddress(ctx)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package rpc defines a gRPC server implementing the eth2 API as needed
|
||||
// Package rpc defines a gRPC server implementing the Ethereum consensus API as needed
|
||||
// by validator clients and consumers of chain data.
|
||||
package rpc
|
||||
|
||||
|
@ -352,7 +352,7 @@ func TestServer_GetAttestationData_InvalidRequestSlot(t *testing.T) {
|
||||
|
||||
func TestServer_GetAttestationData_HeadStateSlotGreaterThanRequestSlot(t *testing.T) {
|
||||
// There exists a rare scenario where the validator may request an attestation for a slot less
|
||||
// than the head state's slot. The ETH2 spec constraints require that the block root the
|
||||
// than the head state's slot. The Ethereum consensus spec constraints require the block root the
|
||||
// attestation is referencing be less than or equal to the attestation data slot.
|
||||
// See: https://github.com/prysmaticlabs/prysm/issues/5164
|
||||
ctx := context.Background()
|
||||
|
@ -22,8 +22,8 @@ var nonExistentIndex = types.ValidatorIndex(^uint64(0))
|
||||
|
||||
// ValidatorStatus returns the validator status of the current epoch.
|
||||
// The status response can be one of the following:
|
||||
// DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum 2.
|
||||
// PENDING - validator is in Ethereum 2's activation queue.
|
||||
// DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum.
|
||||
// PENDING - validator is in Ethereum's activation queue.
|
||||
// ACTIVE - validator is active.
|
||||
// EXITING - validator has initiated an an exit request, or has dropped below the ejection balance and is being kicked out.
|
||||
// EXITED - validator is no longer validating.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package stateV0 defines how the beacon chain state for eth2
|
||||
// Package stateV0 defines how the beacon chain state for Ethereum
|
||||
// functions in the running beacon node, using an advanced,
|
||||
// immutable implementation of the state data structure.
|
||||
//
|
||||
|
@ -37,7 +37,7 @@ func (b *BeaconState) eth1Data() *ethpb.Eth1Data {
|
||||
return copyutil.CopyETH1Data(b.state.Eth1Data)
|
||||
}
|
||||
|
||||
// Eth1DataVotes corresponds to votes from eth2 on the canonical proof-of-work chain
|
||||
// Eth1DataVotes corresponds to votes from Ethereum on the canonical proof-of-work chain
|
||||
// data retrieved from eth1.
|
||||
func (b *BeaconState) Eth1DataVotes() []*ethpb.Eth1Data {
|
||||
if !b.hasInnerState() {
|
||||
@ -53,7 +53,7 @@ func (b *BeaconState) Eth1DataVotes() []*ethpb.Eth1Data {
|
||||
return b.eth1DataVotes()
|
||||
}
|
||||
|
||||
// eth1DataVotes corresponds to votes from eth2 on the canonical proof-of-work chain
|
||||
// eth1DataVotes corresponds to votes from Ethereum on the canonical proof-of-work chain
|
||||
// data retrieved from eth1.
|
||||
// This assumes that a lock is already held on BeaconState.
|
||||
func (b *BeaconState) eth1DataVotes() []*ethpb.Eth1Data {
|
||||
@ -96,7 +96,7 @@ func (b *BeaconState) eth1DepositIndex() uint64 {
|
||||
}
|
||||
|
||||
// eth1Root computes the HashTreeRoot Merkleization of
|
||||
// a BeaconBlockHeader struct according to the eth2
|
||||
// a BeaconBlockHeader struct according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func eth1Root(hasher htrutils.HashFn, eth1Data *ethpb.Eth1Data) ([32]byte, error) {
|
||||
if eth1Data == nil {
|
||||
@ -122,7 +122,7 @@ func eth1Root(hasher htrutils.HashFn, eth1Data *ethpb.Eth1Data) ([32]byte, error
|
||||
}
|
||||
|
||||
// eth1DataVotesRoot computes the HashTreeRoot Merkleization of
|
||||
// a list of Eth1Data structs according to the eth2
|
||||
// a list of Eth1Data structs according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func eth1DataVotesRoot(eth1DataVotes []*ethpb.Eth1Data) ([32]byte, error) {
|
||||
hashKey, err := stateutil.Eth1DatasEncKey(eth1DataVotes)
|
||||
|
@ -159,7 +159,7 @@ func (b *BeaconState) balancesLength() int {
|
||||
}
|
||||
|
||||
// RootsArrayHashTreeRoot computes the Merkle root of arrays of 32-byte hashes, such as [64][32]byte
|
||||
// according to the Simple Serialize specification of eth2.
|
||||
// according to the Simple Serialize specification of Ethereum.
|
||||
func RootsArrayHashTreeRoot(vals [][]byte, length uint64, fieldName string) ([32]byte, error) {
|
||||
if featureconfig.Get().EnableSSZCache {
|
||||
return cachedHasher.arraysRoot(vals, length, fieldName)
|
||||
|
@ -362,7 +362,7 @@ func (h *stateRootHasher) validatorRoot(hasher htrutils.HashFn, validator *ethpb
|
||||
}
|
||||
|
||||
// ValidatorRegistryRoot computes the HashTreeRoot Merkleization of
|
||||
// a list of validator structs according to the eth2
|
||||
// a list of validator structs according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func ValidatorRegistryRoot(vals []*ethpb.Validator) ([32]byte, error) {
|
||||
if featureconfig.Get().EnableSSZCache {
|
||||
|
@ -195,7 +195,7 @@ func (b *BeaconState) Copy() iface.BeaconState {
|
||||
}
|
||||
|
||||
// HashTreeRoot of the beacon state retrieves the Merkle root of the trie
|
||||
// representation of the beacon state based on the eth2 Simple Serialize specification.
|
||||
// representation of the beacon state based on the Ethereum Simple Serialize specification.
|
||||
func (b *BeaconState) HashTreeRoot(ctx context.Context) ([32]byte, error) {
|
||||
ctx, span := trace.StartSpan(ctx, "beaconState.HashTreeRoot")
|
||||
defer span.End()
|
||||
|
@ -76,7 +76,7 @@ var fieldMap map[fieldIndex]dataType
|
||||
// operations can be performed on state.
|
||||
var ErrNilInnerState = errors.New("nil inner state")
|
||||
|
||||
// BeaconState defines a struct containing utilities for the eth2 chain state, defining
|
||||
// BeaconState defines a struct containing utilities for the Ethereum Beacon Chain state, defining
|
||||
// getters and setters for its respective values and helpful functions such as HashTreeRoot().
|
||||
type BeaconState struct {
|
||||
state *pbp2p.BeaconState
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// BlockHeaderRoot computes the HashTreeRoot Merkleization of
|
||||
// a BeaconBlockHeader struct according to the eth2
|
||||
// a BeaconBlockHeader struct according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func BlockHeaderRoot(header *ethpb.BeaconBlockHeader) ([32]byte, error) {
|
||||
fieldRoots := make([][]byte, 5)
|
||||
|
@ -187,7 +187,7 @@ func (s *Service) validateUnaggregatedAttWithState(ctx context.Context, a *eth.A
|
||||
}
|
||||
|
||||
// Attestation must be unaggregated and the bit index must exist in the range of committee indices.
|
||||
// Note: eth2 spec suggests (len(get_attesting_indices(state, attestation.data, attestation.aggregation_bits)) == 1)
|
||||
// Note: The Ethereum Beacon Chain spec suggests (len(get_attesting_indices(state, attestation.data, attestation.aggregation_bits)) == 1)
|
||||
// however this validation can be achieved without use of get_attesting_indices which is an O(n) lookup.
|
||||
if a.AggregationBits.Count() != 1 || a.AggregationBits.BitIndices()[0] >= len(committee) {
|
||||
return pubsub.ValidationReject
|
||||
|
@ -14,7 +14,7 @@ var log = logrus.WithField("prefix", "db")
|
||||
var Commands = &cli.Command{
|
||||
Name: "db",
|
||||
Category: "db",
|
||||
Usage: "defines commands for interacting with eth2 beacon node database",
|
||||
Usage: "defines commands for interacting with the Ethereum Beacon Node database",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "restore",
|
||||
|
@ -70,7 +70,7 @@ var (
|
||||
Usage: "The port on which the gateway server runs on",
|
||||
Value: 3500,
|
||||
}
|
||||
// ApiMiddlewarePort specifies the port for an HTTP proxy server which acts as a middleware between Eth2 API clients and Prysm's gRPC gateway.
|
||||
// ApiMiddlewarePort specifies the port for an HTTP proxy server which acts as a middleware between Ethereum consensus API clients and Prysm's gRPC gateway.
|
||||
// The middleware serves JSON values conforming to the specification: https://ethereum.github.io/eth2.0-APIs/
|
||||
ApiMiddlewarePort = &cli.IntFlag{
|
||||
Name: "api-middleware-port",
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package beacon-chain defines the entire runtime of an eth2 beacon node.
|
||||
// Package beacon-chain defines the entire runtime of an Ethereum beacon node.
|
||||
package main
|
||||
|
||||
import (
|
||||
@ -120,7 +120,7 @@ func init() {
|
||||
func main() {
|
||||
app := cli.App{}
|
||||
app.Name = "beacon-chain"
|
||||
app.Usage = "this is a beacon chain implementation for Ethereum 2.0"
|
||||
app.Usage = "this is a beacon chain implementation for Ethereum"
|
||||
app.Action = startNode
|
||||
app.Version = version.Version()
|
||||
app.Commands = []*cli.Command{
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package main defines slasher server implementation for eth2. A slasher
|
||||
// Package main defines slasher server implementation for Ethereum. A slasher
|
||||
// listens for all broadcasted messages using a running beacon node in order
|
||||
// to detect malicious attestations and block proposals.
|
||||
package main
|
||||
|
@ -18,7 +18,7 @@ var log = logrus.WithField("prefix", "accounts")
|
||||
var Commands = &cli.Command{
|
||||
Name: "accounts",
|
||||
Category: "accounts",
|
||||
Usage: "defines commands for interacting with eth2 validator accounts",
|
||||
Usage: "defines commands for interacting with Ethereum validator accounts",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "delete",
|
||||
@ -116,7 +116,7 @@ var Commands = &cli.Command{
|
||||
},
|
||||
{
|
||||
Name: "import",
|
||||
Description: `imports eth2 validator accounts stored in EIP-2335 keystore.json files from an external directory`,
|
||||
Description: `imports Ethereum validator accounts stored in EIP-2335 keystore.json files from an external directory`,
|
||||
Flags: cmd.WrapFlags([]cli.Flag{
|
||||
flags.WalletDirFlag,
|
||||
flags.KeysDirFlag,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package main defines a validator client, a critical actor in eth2 which manages
|
||||
// Package main defines a validator client, a critical actor in Ethereum which manages
|
||||
// a keystore of private keys, connects to a beacon node to receive assignments,
|
||||
// and submits blocks/attestations as needed.
|
||||
package main
|
||||
@ -109,7 +109,7 @@ func init() {
|
||||
func main() {
|
||||
app := cli.App{}
|
||||
app.Name = "validator"
|
||||
app.Usage = `launches an Ethereum 2.0 validator client that interacts with a beacon chain, starts proposer and attester services, p2p connections, and more`
|
||||
app.Usage = `launches an Ethereum validator client that interacts with a beacon chain, starts proposer and attester services, p2p connections, and more`
|
||||
app.Version = version.Version()
|
||||
app.Action = startNode
|
||||
app.Commands = []*cli.Command{
|
||||
|
@ -16,7 +16,7 @@ var log = logrus.WithField("prefix", "wallet")
|
||||
var Commands = &cli.Command{
|
||||
Name: "wallet",
|
||||
Category: "wallet",
|
||||
Usage: "defines commands for interacting with eth2 validator wallets",
|
||||
Usage: "defines commands for interacting with Ethereum validator wallets",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "create",
|
||||
|
@ -1,6 +1,6 @@
|
||||
## Prysm Internal Validator Deposit Contract
|
||||
|
||||
**NOTE: THIS IS NOT THE OFFICIAL ETH2 VALIDATOR DEPOSIT CONTRACT. THE OFFICIAL CONTRACT CAN ONLY BE FOUND [HERE](https://github.com/ethereum/eth2.0-specs/blob/e4a9c5fa29def20c4264cd860868f131d6f40e72/solidity_deposit_contract/deposit_contract.sol). THE ONLY DEPOSIT CONTRACT ON MAINNET HAS ADDRESS 0x00000000219ab540356cbb839cbe05303d7705fa. DO NOT USE THE CONTRACT IN THIS FOLDER OUTSIDE OF DEVELOPMENT**
|
||||
**NOTE: THIS IS NOT THE OFFICIAL ETHEREUM VALIDATOR DEPOSIT CONTRACT. THE OFFICIAL CONTRACT CAN ONLY BE FOUND [HERE](https://github.com/ethereum/eth2.0-specs/blob/e4a9c5fa29def20c4264cd860868f131d6f40e72/solidity_deposit_contract/deposit_contract.sol). THE ONLY DEPOSIT CONTRACT ON MAINNET HAS ADDRESS 0x00000000219ab540356cbb839cbe05303d7705fa. DO NOT USE THE CONTRACT IN THIS FOLDER OUTSIDE OF DEVELOPMENT**
|
||||
|
||||
## How to execute tests
|
||||
|
||||
|
@ -26,7 +26,7 @@ option java_outer_classname = "BeaconBlockProto";
|
||||
option java_package = "org.ethereum.eth.v1";
|
||||
option php_namespace = "Ethereum\\Eth\\v1";
|
||||
|
||||
// The Ethereum 2.0 beacon block. The message does not contain a validator signature.
|
||||
// The Ethereum consensus beacon block. The message does not contain a validator signature.
|
||||
message BeaconBlock {
|
||||
// Beacon chain slot that this block represents.
|
||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
|
||||
@ -44,7 +44,7 @@ message BeaconBlock {
|
||||
BeaconBlockBody body = 5;
|
||||
}
|
||||
|
||||
// The Ethereum 2.0 beacon block for Hard Fork 1. The message does not contain a validator signature.
|
||||
// The Ethereum consensus beacon block for Hard Fork 1. The message does not contain a validator signature.
|
||||
message BeaconBlockV1 {
|
||||
// Beacon chain slot that this block represents.
|
||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
|
||||
@ -80,7 +80,7 @@ message SignedBeaconBlockV1 {
|
||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
}
|
||||
|
||||
// The block body of an Ethereum 2.0 beacon block.
|
||||
// The block body of an Ethereum consensus beacon block.
|
||||
message BeaconBlockBody {
|
||||
// The validators RANDAO reveal 96 byte value.
|
||||
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
@ -111,7 +111,7 @@ message BeaconBlockBody {
|
||||
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
|
||||
}
|
||||
|
||||
// The block body of an Ethereum 2.0 beacon block for Hard Fork 1.
|
||||
// The block body of an Ethereum consensus beacon block for Hard Fork 1.
|
||||
message BeaconBlockBodyV1 {
|
||||
// The validators RANDAO reveal 96 byte value.
|
||||
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
@ -169,7 +169,7 @@ message AttesterSlashing {
|
||||
IndexedAttestation attestation_2 = 2;
|
||||
}
|
||||
|
||||
// Deposit into the Ethereum 2.0 from the Ethereum 1.x deposit contract.
|
||||
// Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract.
|
||||
message Deposit {
|
||||
message Data {
|
||||
// 48 byte BLS public key of the validator.
|
||||
|
@ -38,7 +38,7 @@ option php_namespace = "Ethereum\\Eth\\v1";
|
||||
// The config API endpoints can be used to query the beacon chain state and information. Such as spec, current fork,
|
||||
// blocks, and the validator spec.
|
||||
//
|
||||
// This service is defined in the upstream eth2.0-apis repository (eth2.0-APIs/apis/).
|
||||
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/).
|
||||
service BeaconChain {
|
||||
// Beacon state API related endpoints.
|
||||
|
||||
|
@ -34,7 +34,7 @@ option php_namespace = "Ethereum\\Eth\\v1";
|
||||
//
|
||||
// The beacon chain debug API is a set of endpoints to debug chain and shouldn't be exposed publicly.
|
||||
//
|
||||
// This service is defined in the upstream eth2.0-apis repository (eth2.0-APIs/apis/debug).
|
||||
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/debug).
|
||||
service BeaconDebug {
|
||||
// GetBeaconState returns full BeaconState object for given stateId.
|
||||
rpc GetBeaconState(StateRequest) returns (BeaconStateResponse) {
|
||||
|
@ -29,7 +29,7 @@ option php_namespace = "Ethereum\\Eth\\v1";
|
||||
|
||||
// Events API
|
||||
//
|
||||
// This service is defined in the upstream eth2.0-apis repository (eth2.0-APIs/apis/debug).
|
||||
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/debug).
|
||||
service Events {
|
||||
rpc StreamEvents(StreamEventsRequest) returns (stream gateway.EventSource) {
|
||||
option (google.api.http) = {
|
||||
|
@ -33,7 +33,7 @@ message ValidatorContainer {
|
||||
Validator validator = 4;
|
||||
}
|
||||
|
||||
// An Ethereum 2.0 validator.
|
||||
// An Ethereum validator.
|
||||
message Validator {
|
||||
// 48 byte BLS public key used for the validator's activities.
|
||||
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
|
||||
@ -48,24 +48,24 @@ message Validator {
|
||||
bool slashed = 4;
|
||||
|
||||
// Epoch when the validator became eligible for activation. This field may
|
||||
// be zero if the validator was present in the Ethereum 2.0 genesis. This
|
||||
// be zero if the validator was present in the Ethereum proof of stake genesis. This
|
||||
// field is FAR_FUTURE_EPOCH if the validator has not been activated.
|
||||
uint64 activation_eligibility_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
// Epoch when the validator was activated. This field may be zero if the
|
||||
// validator was present in the Ethereum 2.0 genesis. This field is
|
||||
// validator was present in the Ethereum proof of stake genesis. This field is
|
||||
// FAR_FUTURE_EPOCH if the validator has not been activated.
|
||||
uint64 activation_epoch = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
// Epoch when the validator was exited. This field is FAR_FUTURE_EPOCH if
|
||||
// the validator has not exited.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum 2.0 specification:
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 exit_epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
// Epoch when the validator is eligible to withdraw their funds. This field
|
||||
// is FAR_FUTURE_EPOCH if the validator has not exited.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum 2.0 specification:
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 withdrawable_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ option php_namespace = "Ethereum\\Eth\\v1";
|
||||
//
|
||||
// The beacon chain validator API is a set of endpoints to be used by validators for performing their roles.
|
||||
//
|
||||
// This service is defined in the upstream eth2.0-apis repository (eth2.0-APIs/apis/validator).
|
||||
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/validator).
|
||||
service BeaconValidator {
|
||||
// GetAttesterDuties requests the beacon node to provide a set of attestation duties, which should be performed
|
||||
// by validators, for a particular epoch. Duties should only need to be checked once per epoch, however
|
||||
|
@ -25,7 +25,7 @@ option java_outer_classname = "BeaconBlockProto";
|
||||
option java_package = "org.ethereum.eth.v1alpha1";
|
||||
option php_namespace = "Ethereum\\Eth\\v1alpha1";
|
||||
|
||||
// The Ethereum 2.0 beacon block. The message does not contain a validator signature.
|
||||
// The Ethereum consensus beacon block. The message does not contain a validator signature.
|
||||
message BeaconBlock {
|
||||
// Beacon chain slot that this block represents.
|
||||
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
|
||||
@ -52,7 +52,7 @@ message SignedBeaconBlock {
|
||||
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
}
|
||||
|
||||
// The block body of an Ethereum 2.0 beacon block.
|
||||
// The block body of an Ethereum consensus beacon block.
|
||||
message BeaconBlockBody {
|
||||
// The validators RANDAO reveal 96 byte value.
|
||||
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
|
||||
@ -103,7 +103,7 @@ message AttesterSlashing {
|
||||
IndexedAttestation attestation_2 = 2;
|
||||
}
|
||||
|
||||
// Deposit into the Ethereum 2.0 from the Ethereum 1.x deposit contract.
|
||||
// Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract.
|
||||
message Deposit {
|
||||
// DepositData that is encoded into a deposit signature.
|
||||
message Data {
|
||||
|
@ -32,8 +32,7 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1";
|
||||
|
||||
// Beacon chain API
|
||||
//
|
||||
// The beacon chain API can be used to access data relevant to the Ethereum 2.0
|
||||
// phase 0 beacon chain.
|
||||
// The beacon chain API can be used to access data relevant to the Ethereum Beacon Chain.
|
||||
service BeaconChain {
|
||||
// TODO(preston): Batch requests?
|
||||
|
||||
@ -83,7 +82,7 @@ service BeaconChain {
|
||||
// yet processed. Pool attestations eventually expire as the slot
|
||||
// advances, so an attestation missing from this request does not imply
|
||||
// that it was included in a block. The attestation may have expired.
|
||||
// Refer to the ethereum 2.0 specification for more details on how
|
||||
// Refer to the Ethereum Beacon Chain specification for more details on how
|
||||
// attestations are processed and when they are no longer valid.
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
|
||||
rpc AttestationPool(AttestationPoolRequest) returns (AttestationPoolResponse) {
|
||||
@ -582,7 +581,7 @@ message GetValidatorRequest {
|
||||
message Validators {
|
||||
// Epoch which the state was considered to determine the active validator
|
||||
// set. This field is not optional. Zero value epoch indicates the validator
|
||||
// set is from the Ethereum 2.0 genesis set.
|
||||
// set is from the Ethereum proof of stake genesis set.
|
||||
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
message ValidatorContainer {
|
||||
|
@ -40,14 +40,14 @@ service Node {
|
||||
};
|
||||
}
|
||||
|
||||
// Retrieve information about the genesis of Ethereum 2.0.
|
||||
// Retrieve information about the genesis of Ethereum proof of stake.
|
||||
rpc GetGenesis(google.protobuf.Empty) returns (Genesis) {
|
||||
option (google.api.http) = {
|
||||
get: "/eth/v1alpha1/node/genesis"
|
||||
};
|
||||
}
|
||||
|
||||
// Retrieve information about the running Ethereum 2.0 node.
|
||||
// Retrieve information about the running Ethereum Beacon Node.
|
||||
rpc GetVersion(google.protobuf.Empty) returns (Version) {
|
||||
option (google.api.http) = {
|
||||
get: "/eth/v1alpha1/node/version"
|
||||
@ -93,7 +93,7 @@ message SyncStatus {
|
||||
bool syncing = 1;
|
||||
}
|
||||
|
||||
// Information about the genesis of Ethereum 2.0.
|
||||
// Information about the genesis of Ethereum proof of stake.
|
||||
message Genesis {
|
||||
// UTC time specified in the chain start event in the deposit contract.
|
||||
google.protobuf.Timestamp genesis_time = 1;
|
||||
|
@ -34,7 +34,7 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
|
||||
};
|
||||
external_docs: {
|
||||
url: "https://github.com/ethereum/eth2.0-specs";
|
||||
description: "Ethereum 2.0 Specification on Github";
|
||||
description: "Ethereum Consensus Specification on Github";
|
||||
};
|
||||
host: "api.prylabs.net",
|
||||
schemes: HTTPS;
|
||||
|
@ -58,7 +58,7 @@
|
||||
}
|
||||
},
|
||||
"externalDocs": {
|
||||
"description": "Ethereum 2.0 Specification on Github",
|
||||
"description": "Ethereum Consensus Specification on Github",
|
||||
"url": "https://github.com/ethereum/eth2.0-specs"
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ At the core of Ethereum Serenity lies the "Beacon Chain", a proof-of-stake based
|
||||
|
||||
| Package | Service | Version | Description |
|
||||
|---------|---------|---------|-------------|
|
||||
| eth | BeaconChain | v1alpha1 | This service is used to retrieve critical data relevant to the Ethereum 2.0 phase 0 beacon chain, including the most recent head block, current pending deposits, the chain state and more. |
|
||||
| eth | BeaconChain | v1alpha1 | This service is used to retrieve critical data relevant to the Ethereum Beacon Chain, including the most recent head block, current pending deposits, the chain state and more. |
|
||||
| eth | Node | v1alpha1 | The Node service returns information about the Ethereum node itself, including versioning and general information as well as network sync status and a list of services currently implemented on the node.
|
||||
| eth | Validator | v1alpha1 | This API provides the information a validator needs to retrieve throughout its lifecycle, including recieved assignments from the network, its current index in the state, as well the rewards and penalties that have been applied to it.
|
||||
|
||||
|
@ -32,7 +32,7 @@ option php_namespace = "Ethereum\\Eth\\v1alpha1";
|
||||
// Beacon node validator API
|
||||
//
|
||||
// The beacon node validator API enables a validator to connect
|
||||
// and perform its obligations on the Ethereum 2.0 phase 0 beacon chain.
|
||||
// and perform its obligations on the Ethereum Beacon Chain.
|
||||
service BeaconNodeValidator {
|
||||
// Retrieves validator duties for the requested validators.
|
||||
//
|
||||
@ -111,8 +111,8 @@ service BeaconNodeValidator {
|
||||
// The request can specify either a validator's public key or validator index.
|
||||
//
|
||||
// The status response can be one of the following:
|
||||
// DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum 2.
|
||||
// PENDING - validator is in Ethereum 2's activation queue.
|
||||
// DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum.
|
||||
// PENDING - validator is in Ethereum's activation queue.
|
||||
// ACTIVE - validator is active.
|
||||
// EXITING - validator has initiated an an exit request, or has dropped below the ejection balance and is being kicked out.
|
||||
// EXITED - validator is no longer validating.
|
||||
@ -455,7 +455,7 @@ message CommitteeSubnetsSubscribeRequest {
|
||||
repeated bool is_aggregator = 3;
|
||||
}
|
||||
|
||||
// An Ethereum 2.0 validator.
|
||||
// An Ethereum validator.
|
||||
message Validator {
|
||||
// 48 byte BLS public key used for the validator's activities.
|
||||
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
|
||||
@ -470,24 +470,24 @@ message Validator {
|
||||
bool slashed = 4;
|
||||
|
||||
// Epoch when the validator became eligible for activation. This field may
|
||||
// be zero if the validator was present in the Ethereum 2.0 genesis. This
|
||||
// be zero if the validator was present in the Ethereum proof of stake genesis. This
|
||||
// field is FAR_FUTURE_EPOCH if the validator has not been activated.
|
||||
uint64 activation_eligibility_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
// Epoch when the validator was activated. This field may be zero if the
|
||||
// validator was present in the Ethereum 2.0 genesis. This field is
|
||||
// validator was present in the Ethereum proof of stake genesis. This field is
|
||||
// FAR_FUTURE_EPOCH if the validator has not been activated.
|
||||
uint64 activation_epoch = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
// Epoch when the validator was exited. This field is FAR_FUTURE_EPOCH if
|
||||
// the validator has not exited.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum 2.0 specification:
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 exit_epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
|
||||
// Epoch when the validator is eligible to withdraw their funds. This field
|
||||
// is FAR_FUTURE_EPOCH if the validator has not exited.
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum 2.0 specification:
|
||||
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
|
||||
// https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
|
||||
uint64 withdrawable_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
|
||||
}
|
||||
@ -538,7 +538,7 @@ message ValidatorInfo {
|
||||
// The unix timestamp when the validator enters the next state.
|
||||
// This could be in the past. Some values depend on chain operation and so will vary from epoch to epoch.
|
||||
// Specific times for each state are as follows:
|
||||
// - state == DEPOSITED: time at which Ethereum 1 deposit will be stored on-chain by Ethereum 2 (variable, can be 0).
|
||||
// - state == DEPOSITED: time at which Ethereum 1 deposit will be stored on-chain by Ethereum (variable, can be 0).
|
||||
// - state == PENDING: time at which validator will be activated (variable).
|
||||
// - state == ACTIVE: no value (next transition depends on user and network actions).
|
||||
// - state == EXITING: time at which validator will exit.
|
||||
|
@ -37,7 +37,7 @@ option php_namespace = "Ethereum\\Prysm\\v2";
|
||||
// Beacon node validator API
|
||||
//
|
||||
// The beacon node validator API enables a validator to connect
|
||||
// and perform its obligations on the Ethereum 2.0 phase 0 beacon chain.
|
||||
// and perform its obligations on the Ethereum Beacon Chain.
|
||||
service BeaconNodeValidatorAltair {
|
||||
// Retrieves the latest valid beacon block to be proposed on the beacon chain.
|
||||
//
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Package bls implements a go-wrapper around a library implementing the
|
||||
// the BLS12-381 curve and signature scheme. This package exposes a public API for
|
||||
// verifying and aggregating BLS signatures used by Ethereum 2.0.
|
||||
// verifying and aggregating BLS signatures used by Ethereum.
|
||||
package bls
|
||||
|
||||
import (
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Package blst implements a go-wrapper around a library implementing the
|
||||
// the BLS12-381 curve and signature scheme. This package exposes a public API for
|
||||
// verifying and aggregating BLS signatures used by Ethereum 2.0.
|
||||
// verifying and aggregating BLS signatures used by Ethereum.
|
||||
//
|
||||
// This implementation uses the library written by Supranational, blst.
|
||||
//
|
||||
|
@ -71,7 +71,7 @@ func IsZero(sKey []byte) bool {
|
||||
// Sign(SK, message) -> signature: a signing algorithm that generates
|
||||
// a deterministic signature given a secret key SK and a message.
|
||||
//
|
||||
// In ETH2.0 specification:
|
||||
// In Ethereum proof of stake specification:
|
||||
// def Sign(SK: int, message: Bytes) -> BLSSignature
|
||||
func (s *bls12SecretKey) Sign(msg []byte) common.Signature {
|
||||
if featureconfig.Get().SkipBLSVerify {
|
||||
|
@ -52,7 +52,7 @@ func SignatureFromBytes(sig []byte) (common.Signature, error) {
|
||||
// algorithm that outputs VALID if signature is a valid signature of
|
||||
// message under public key PK, and INVALID otherwise.
|
||||
//
|
||||
// In ETH2.0 specification:
|
||||
// In the Ethereum proof of stake specification:
|
||||
// def Verify(PK: BLSPubkey, message: Bytes, signature: BLSSignature) -> bool
|
||||
func (s *Signature) Verify(pubKey common.PublicKey, msg []byte) bool {
|
||||
if featureconfig.Get().SkipBLSVerify {
|
||||
@ -75,7 +75,7 @@ func (s *Signature) Verify(pubKey common.PublicKey, msg []byte) bool {
|
||||
// signature for a collection of public keys and messages, and
|
||||
// outputs INVALID otherwise.
|
||||
//
|
||||
// In ETH2.0 specification:
|
||||
// In the Ethereum proof of stake specification:
|
||||
// def AggregateVerify(pairs: Sequence[PK: BLSPubkey, message: Bytes], signature: BLSSignature) -> bool
|
||||
//
|
||||
// Deprecated: Use FastAggregateVerify or use this method in spectests only.
|
||||
@ -108,7 +108,7 @@ func (s *Signature) AggregateVerify(pubKeys []common.PublicKey, msgs [][32]byte)
|
||||
// signatures on the same message. This function is faster than
|
||||
// AggregateVerify.
|
||||
//
|
||||
// In ETH2.0 specification:
|
||||
// In the Ethereum proof of stake specification:
|
||||
// def FastAggregateVerify(PKs: Sequence[BLSPubkey], message: Bytes, signature: BLSSignature) -> bool
|
||||
func (s *Signature) FastAggregateVerify(pubKeys []common.PublicKey, msg [32]byte) bool {
|
||||
if featureconfig.Get().SkipBLSVerify {
|
||||
@ -158,7 +158,7 @@ func AggregateSignatures(sigs []common.Signature) common.Signature {
|
||||
// aggregation algorithm that compresses a collection of signatures
|
||||
// into a single signature.
|
||||
//
|
||||
// In ETH2.0 specification:
|
||||
// In the Ethereum proof of stake specification:
|
||||
// def Aggregate(signatures: Sequence[BLSSignature]) -> BLSSignature
|
||||
//
|
||||
// Deprecated: Use AggregateSignatures.
|
||||
|
@ -8,12 +8,12 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// MinimalConfigFlag declares to use the minimal config for running Eth2.0.
|
||||
// MinimalConfigFlag declares to use the minimal config for running Ethereum consensus.
|
||||
MinimalConfigFlag = &cli.BoolFlag{
|
||||
Name: "minimal-config",
|
||||
Usage: "Use minimal config with parameters as defined in the spec.",
|
||||
}
|
||||
// E2EConfigFlag declares to use a testing specific config for running Eth2.0 in end-to-end testing.
|
||||
// E2EConfigFlag declares to use a testing specific config for running Ethereum consensus in end-to-end testing.
|
||||
E2EConfigFlag = &cli.BoolFlag{
|
||||
Name: "e2e-config",
|
||||
Usage: "Use the E2E testing config, only for use within end-to-end testing.",
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package depositutil contains useful functions for dealing
|
||||
// with eth2 deposit inputs.
|
||||
// with Ethereum deposit inputs.
|
||||
package depositutil
|
||||
|
||||
import (
|
||||
|
@ -129,7 +129,7 @@ func configureTestnet(ctx *cli.Context, cfg *Flags) {
|
||||
params.UsePraterConfig()
|
||||
params.UsePraterNetworkConfig()
|
||||
} else {
|
||||
log.Warn("Running on ETH2 Mainnet")
|
||||
log.Warn("Running on Ethereum Consensus Mainnet")
|
||||
params.UseMainnetConfig()
|
||||
}
|
||||
}
|
||||
|
@ -7,17 +7,17 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// ToledoTestnet flag for the multiclient eth2 testnet.
|
||||
// ToledoTestnet flag for the multiclient Ethereum consensus testnet.
|
||||
ToledoTestnet = &cli.BoolFlag{
|
||||
Name: "toledo",
|
||||
Usage: "This defines the flag through which we can run on the Toledo Multiclient Testnet",
|
||||
}
|
||||
// PyrmontTestnet flag for the multiclient eth2 testnet.
|
||||
// PyrmontTestnet flag for the multiclient Ethereum consensus testnet.
|
||||
PyrmontTestnet = &cli.BoolFlag{
|
||||
Name: "pyrmont",
|
||||
Usage: "This defines the flag through which we can run on the Pyrmont Multiclient Testnet",
|
||||
}
|
||||
// PraterTestnet flag for the multiclient eth2 testnet.
|
||||
// PraterTestnet flag for the multiclient Ethereum consensus testnet.
|
||||
PraterTestnet = &cli.BoolFlag{
|
||||
Name: "prater",
|
||||
Usage: "Run Prysm configured for the Prater test network",
|
||||
@ -26,7 +26,7 @@ var (
|
||||
Mainnet = &cli.BoolFlag{
|
||||
Value: true,
|
||||
Name: "mainnet",
|
||||
Usage: "Run on Ethereum 2.0 Main Net. This is the default and can be omitted.",
|
||||
Usage: "Run on Ethereum Beacon Chain Main Net. This is the default and can be omitted.",
|
||||
}
|
||||
devModeFlag = &cli.BoolFlag{
|
||||
Name: "dev",
|
||||
|
@ -8,10 +8,10 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// ApiProxyMiddleware is a proxy between an Eth2 API HTTP client and grpc-gateway.
|
||||
// ApiProxyMiddleware is a proxy between an Ethereum consensus API HTTP client and grpc-gateway.
|
||||
// The purpose of the proxy is to handle HTTP requests and gRPC responses in such a way that:
|
||||
// - Eth2 API requests can be handled by grpc-gateway correctly
|
||||
// - gRPC responses can be returned as spec-compliant Eth2 API responses
|
||||
// - Ethereum consensus API requests can be handled by grpc-gateway correctly
|
||||
// - gRPC responses can be returned as spec-compliant Ethereum consensus API responses
|
||||
type ApiProxyMiddleware struct {
|
||||
GatewayAddress string
|
||||
ProxyAddress string
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// Uint64Root computes the HashTreeRoot Merkleization of
|
||||
// a simple uint64 value according to the eth2
|
||||
// a simple uint64 value according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func Uint64Root(val uint64) [32]byte {
|
||||
buf := make([]byte, 8)
|
||||
@ -24,7 +24,7 @@ func Uint64Root(val uint64) [32]byte {
|
||||
}
|
||||
|
||||
// ForkRoot computes the HashTreeRoot Merkleization of
|
||||
// a Fork struct value according to the eth2
|
||||
// a Fork struct value according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func ForkRoot(fork *pb.Fork) ([32]byte, error) {
|
||||
fieldRoots := make([][]byte, 3)
|
||||
@ -42,7 +42,7 @@ func ForkRoot(fork *pb.Fork) ([32]byte, error) {
|
||||
}
|
||||
|
||||
// CheckpointRoot computes the HashTreeRoot Merkleization of
|
||||
// a InitWithReset struct value according to the eth2
|
||||
// a InitWithReset struct value according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func CheckpointRoot(hasher HashFn, checkpoint *ethpb.Checkpoint) ([32]byte, error) {
|
||||
fieldRoots := make([][]byte, 2)
|
||||
@ -58,7 +58,7 @@ func CheckpointRoot(hasher HashFn, checkpoint *ethpb.Checkpoint) ([32]byte, erro
|
||||
}
|
||||
|
||||
// HistoricalRootsRoot computes the HashTreeRoot Merkleization of
|
||||
// a list of [32]byte historical block roots according to the eth2
|
||||
// a list of [32]byte historical block roots according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func HistoricalRootsRoot(historicalRoots [][]byte) ([32]byte, error) {
|
||||
result, err := BitwiseMerkleize(hashutil.CustomSHA256Hasher(), historicalRoots, uint64(len(historicalRoots)), params.BeaconConfig().HistoricalRootsLimit)
|
||||
@ -77,7 +77,7 @@ func HistoricalRootsRoot(historicalRoots [][]byte) ([32]byte, error) {
|
||||
}
|
||||
|
||||
// SlashingsRoot computes the HashTreeRoot Merkleization of
|
||||
// a list of uint64 slashing values according to the eth2
|
||||
// a list of uint64 slashing values according to the Ethereum
|
||||
// Simple Serialize specification.
|
||||
func SlashingsRoot(slashings []uint64) ([32]byte, error) {
|
||||
slashingMarshaling := make([][]byte, params.BeaconConfig().EpochsPerSlashingsVector)
|
||||
|
@ -21,7 +21,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// This is the recommended mock eth1 block hash according to the Eth2 interop guidelines.
|
||||
// This is the recommended mock eth1 block hash according to the Ethereum consensus interop guidelines.
|
||||
// https://github.com/ethereum/eth2.0-pm/blob/a085c9870f3956d6228ed2a40cd37f0c6580ecd7/interop/mocked_start/README.md
|
||||
mockEth1BlockHash = []byte{66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66}
|
||||
)
|
||||
|
@ -16,7 +16,7 @@ const (
|
||||
)
|
||||
|
||||
// DeterministicallyGenerateKeys creates BLS private keys using a fixed curve order according to
|
||||
// the algorithm specified in the Eth2.0-Specs interop mock start section found here:
|
||||
// the algorithm specified in the Ethereum beacon chain specification interop mock start section found here:
|
||||
// https://github.com/ethereum/eth2.0-pm/blob/a085c9870f3956d6228ed2a40cd37f0c6580ecd7/interop/mocked_start/README.md
|
||||
func DeterministicallyGenerateKeys(startIndex, numKeys uint64) ([]bls.SecretKey, []bls.PublicKey, error) {
|
||||
privKeys := make([]bls.SecretKey, numKeys)
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package mathutil includes important helpers for eth2 such as fast integer square roots.
|
||||
// Package mathutil includes important helpers for Ethereum such as fast integer square roots.
|
||||
package mathutil
|
||||
|
||||
import (
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package p2putils contains useful helpers for eth2 fork-related functionality.
|
||||
// Package p2putils contains useful helpers for Ethereum consensus fork-related functionality.
|
||||
package p2putils
|
||||
|
||||
import (
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package params defines important constants that are essential to eth2 services.
|
||||
// Package params defines important constants that are essential to Prysm services.
|
||||
package params
|
||||
|
||||
import (
|
||||
@ -44,7 +44,7 @@ type BeaconChainConfig struct {
|
||||
ZeroHash [32]byte // ZeroHash is used to represent a zeroed out 32 byte array.
|
||||
|
||||
// Time parameters constants.
|
||||
GenesisDelay uint64 `yaml:"GENESIS_DELAY" spec:"true"` // GenesisDelay is the minimum number of seconds to delay starting the ETH2 genesis. Must be at least 1 second.
|
||||
GenesisDelay uint64 `yaml:"GENESIS_DELAY" spec:"true"` // GenesisDelay is the minimum number of seconds to delay starting the Ethereum Beacon Chain genesis. Must be at least 1 second.
|
||||
MinAttestationInclusionDelay types.Slot `yaml:"MIN_ATTESTATION_INCLUSION_DELAY" spec:"true"` // MinAttestationInclusionDelay defines how many slots validator has to wait to include attestation for beacon block.
|
||||
SecondsPerSlot uint64 `yaml:"SECONDS_PER_SLOT" spec:"true"` // SecondsPerSlot is how many seconds are in a single slot.
|
||||
SlotsPerEpoch types.Slot `yaml:"SLOTS_PER_EPOCH" spec:"true"` // SlotsPerEpoch is the number of slots in an epoch.
|
||||
|
@ -21,7 +21,7 @@ type NetworkConfig struct {
|
||||
MessageDomainValidSnappy [4]byte `yaml:"MESSAGE_DOMAIN_VALID_SNAPPY"` // MessageDomainValidSnappy is the 4-byte domain for gossip message-id isolation of valid snappy messages.
|
||||
|
||||
// DiscoveryV5 Config
|
||||
ETH2Key string // ETH2Key is the ENR key of the eth2 object in an enr.
|
||||
ETH2Key string // ETH2Key is the ENR key of the Ethereum consensus object in an enr.
|
||||
AttSubnetKey string // AttSubnetKey is the ENR key of the subnet bitfield in the enr.
|
||||
MinimumPeersInSubnet uint64 // MinimumPeersInSubnet is the required amount of peers that a node is to have its in subnet.
|
||||
MinimumPeersInSubnetSearch uint64 // PeersInSubnetSearch is the required amount of peers that we need to be able to lookup in a subnet search.
|
||||
|
@ -3,7 +3,7 @@ package slashutil
|
||||
import ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
||||
|
||||
// IsSurround checks if an attestation, a, is surrounding
|
||||
// another one, b, based on the eth2 slashing conditions specified
|
||||
// another one, b, based on the Ethereum slashing conditions specified
|
||||
// by @protolambda https://github.com/protolambda/eth2-surround#definition.
|
||||
//
|
||||
// s: source
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package slotutil includes ticker and timer-related functions for eth2.
|
||||
// Package slotutil includes ticker and timer-related functions for Ethereum consensus.
|
||||
package slotutil
|
||||
|
||||
import (
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package trieutil defines utilities for sparse merkle tries for eth2.
|
||||
// Package trieutil defines utilities for sparse merkle tries for Ethereum consensus.
|
||||
package trieutil
|
||||
|
||||
import (
|
||||
@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
// SparseMerkleTrie implements a sparse, general purpose Merkle trie to be used
|
||||
// across ETH2.0 Phase 0 functionality.
|
||||
// across Ethereum consensus functionality.
|
||||
type SparseMerkleTrie struct {
|
||||
depth uint
|
||||
branches [][][]byte
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Slasher Implementation
|
||||
|
||||
This is the main project folder for a slasher implementation for eth2 written in Go by [Prysmatic Labs](https://prysmaticlabs.com). A slasher listens for all broadcasted messages using a running beacon node in order to detect slashable attestations and block proposals.
|
||||
This is the main project folder for a slasher implementation for Ethereum written in Go by [Prysmatic Labs](https://prysmaticlabs.com). A slasher listens for all broadcasted messages using a running beacon node in order to detect slashable attestations and block proposals.
|
||||
It uses the [min-max-surround](https://github.com/protolambda/eth2-surround#min-max-surround) method by Protolambda.
|
||||
|
||||
The slasher requires a connection to a synced beacon node in order to listen for attestations and block proposals. To run the slasher, type:
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
var DatabaseCommands = &cli.Command{
|
||||
Name: "db",
|
||||
Category: "db",
|
||||
Usage: "defines commands for interacting with eth2 slasher database",
|
||||
Usage: "defines commands for interacting with the Prysm slasher database",
|
||||
Subcommands: []*cli.Command{
|
||||
{
|
||||
Name: "restore",
|
||||
|
@ -24,7 +24,7 @@ const (
|
||||
)
|
||||
|
||||
// Store defines an implementation of the slasher Database interface
|
||||
// using BoltDB as the underlying persistent kv-store for eth2.
|
||||
// using BoltDB as the underlying persistent kv-store for Ethereum.
|
||||
type Store struct {
|
||||
highestAttCacheEnabled bool
|
||||
spanCacheEnabled bool
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
Package detection defines a service that reacts to incoming blocks/attestations
|
||||
by running slashing detection for double proposals, double votes, and surround votes
|
||||
according to the eth2 specification. As soon as slashing objects are found, they are
|
||||
according to the Ethereum Beacon Chain specification. As soon as slashing objects are found, they are
|
||||
sent over a feed for the beaconclient service to submit to a beacon node via gRPC.
|
||||
*/
|
||||
package detection
|
||||
|
@ -35,7 +35,7 @@ import (
|
||||
)
|
||||
|
||||
// SlasherNode defines a struct that handles the services running a slashing detector
|
||||
// for eth2. It handles the lifecycle of the entire system and registers
|
||||
// for Ethereum. It handles the lifecycle of the entire system and registers
|
||||
// services to a service registry.
|
||||
type SlasherNode struct {
|
||||
cliCtx *cli.Context
|
||||
|
@ -1,3 +1,3 @@
|
||||
// Package bls includes tests to ensure conformity with the eth2 BLS cryptography specification.
|
||||
// Package bls includes tests to ensure conformity with the Ethereum BLS cryptography specification.
|
||||
// See https://github.com/ethereum/eth2.0-spec-tests/tree/master/tests/general/phase0/bls for details.
|
||||
package bls
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Package shuffle contains all conformity specification tests
|
||||
// for validator shuffling logic according to the eth2 beacon spec.
|
||||
// for validator shuffling logic according to the Ethereum Beacon Node spec.
|
||||
package shuffle
|
||||
|
||||
import (
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
// DepositDataJSON representing a json object of hex string and uint64 values for
|
||||
// validators on eth2. This file can be generated using the official eth2.0-deposit-cli.
|
||||
// validators on Ethereum. This file can be generated using the official eth2.0-deposit-cli.
|
||||
type DepositDataJSON struct {
|
||||
PubKey string `json:"pubkey"`
|
||||
Amount uint64 `json:"amount"`
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Package main provides a tool named split-keys which allows for generating any number of eth2 validator keys
|
||||
// Package main provides a tool named split-keys which allows for generating any number of Ethereum validator keys
|
||||
// from a list of BIP39 mnemonics and spreading them across any number of Prysm wallets. This is useful for creating
|
||||
// custom allocations of keys across containers running in a cloud environment, such as for public testnets.
|
||||
// An example of why you would use this tool is as follows. Let's say we have 1 mnemonic contained inside of a file.
|
||||
|
@ -1,7 +1,7 @@
|
||||
// This tool allows for simple encrypting and decrypting of EIP-2335 compliant, BLS12-381
|
||||
// keystore.json files which as password protected. This is helpful in development to inspect
|
||||
// the contents of keystores created by eth2 wallets or to easily produce keystores from a
|
||||
// specified secret to move them around in a standard format between eth2 clients.
|
||||
// the contents of keystores created by Ethereum validator wallets or to easily produce keystores from a
|
||||
// specified secret to move them around in a standard format between Ethereum consensus clients.
|
||||
package main
|
||||
|
||||
import (
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user