Skip to content

Commit

Permalink
Other Package Godocs for Prysm (#5681)
Browse files Browse the repository at this point in the history
* e2e docs
* slasher docs
* Merge branch 'other-package-godocs' of github.com:prysmaticlabs/prysm into other-package-godocs
* all validator package comments
* Merge branch 'master' into other-package-godocs
* completed all other packages
* Merge branch 'master' into other-package-godocs
* Merge refs/heads/master into other-package-godocs
  • Loading branch information
rauljordan authored Apr 29, 2020
1 parent 4d30519 commit 546196a
Show file tree
Hide file tree
Showing 58 changed files with 103 additions and 9 deletions.
2 changes: 1 addition & 1 deletion endtoend/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# End-to-end Testing Package

This is the main project folder of the end-to-end testing suite for Prysm. This performs a full end-to-end test for Prysm, including spinning up an ETH1 dev chain, sending deposits to the deposit contract, and making sure the beacon node and it's validators are running and performing properly for a few epochs.
This is the main project folder of the end-to-end testing suite for Prysm. This performs a full end-to-end test for Prysm, including spinning up an ETH1 dev chain, sending deposits to the deposit contract, and making sure the beacon node and its validators are running and performing properly for a few epochs.
It also performs a test on a syncing node, and supports featureflags to allow easy E2E testing of experimental features.

## How it works
Expand Down
2 changes: 2 additions & 0 deletions endtoend/components/beacon_node.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package components defines utilities to spin up actual
// beacon node and validator processes as needed by end to end tests.
package components

import (
Expand Down
4 changes: 4 additions & 0 deletions endtoend/endtoend_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Package endtoend performs full a end-to-end test for Prysm,
// including spinning up an ETH1 dev chain, sending deposits to the deposit
// contract, and making sure the beacon node and validators are running and
// performing properly for a few epochs.
package endtoend

import (
Expand Down
2 changes: 2 additions & 0 deletions endtoend/evaluators/node.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package evaluators defines functions which can peer into end to end
// tests to determine if a chain is running as required.
package evaluators

import (
Expand Down
2 changes: 2 additions & 0 deletions endtoend/helpers/helpers.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package helpers defines helper functions to peer into
// end to end processes and kill processes as needed.
package helpers

import (
Expand Down
2 changes: 2 additions & 0 deletions endtoend/params/params.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package params defines all custom parameter configurations
// for running end to end tests.
package params

import (
Expand Down
2 changes: 2 additions & 0 deletions endtoend/types/types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package types includes important structs used by end to end tests, such
// as a configuration type, an evaluator type, and more.
package types

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/attestationutil/attestation_utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package attestationutil contains useful helpers for converting
// attestations into indexed form.
package attestationutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/benchutil/pregen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package benchutil contains useful helpers
// for pregenerating filled data structures such as blocks/states for benchmarks.
package benchutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/bls/spectest/sign_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package spectest includes tests to ensure conformity with the eth2
// bls cryptography specification.
package spectest

import (
Expand Down
1 change: 1 addition & 0 deletions shared/event/feed.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Package event contains an event feed implementation for process communication.
package event

import (
Expand Down
1 change: 1 addition & 0 deletions shared/hashutil/hash.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package hashutil includes all hash-function related helpers for Prysm.
package hashutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/interop/generate_genesis_state.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package interop contains deterministic utilities for generating
// genesis states and keys.
package interop

import (
Expand Down
1 change: 1 addition & 0 deletions shared/iputils/external_ip.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package iputils contains useful functions for ip address formatting.
package iputils

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/keystore/deposit_input.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package keystore contains useful functions for dealing
// with eth2 deposit inputs leveraging go-ethereum's own keystore package.
package keystore

import (
Expand Down
1 change: 1 addition & 0 deletions shared/mathutil/math_helper.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package mathutil includes important helpers for eth2 such as fast integer square roots.
package mathutil

import (
Expand Down
2 changes: 1 addition & 1 deletion shared/mclockutil/mclock.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// Package mclockutil is a wrapper for a monotonic clock source
// Package mclockutil is a wrapper for a monotonic clock source.
package mclockutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/memorypool/memorypool.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package memorypool includes useful tools for creating common
// data structures in eth2 with optimal memory allocation.
package memorypool

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/messagehandler/messagehandler.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package messagehandler contains useful helpers for recovering
// from panic conditions at runtime and logging their trace.
package messagehandler

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/mputil/scatter.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package mputil contains useful helpers for converting
// multi-processor computation.
package mputil

import (
Expand Down
1 change: 1 addition & 0 deletions shared/p2putils/fork.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package p2putils contains useful helpers for eth2 fork-related functionality.
package p2putils

import (
Expand Down
1 change: 1 addition & 0 deletions shared/pagination/pagination.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package pagination contains useful pagination-related helpers.
package pagination

import (
Expand Down
3 changes: 1 addition & 2 deletions shared/params/config.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Package params defines important constants that are essential to the
// Ethereum 2.0 services.
// Package params defines important constants that are essential to eth2 services.
package params

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/params/spectest/config.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package spectest allows for easy switching of chain
// configuration parameters in spec conformity unit tests.
package spectest

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/prometheus/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package prometheus defines a service which is used for metrics collection
// and health of a node in Prysm.
package prometheus

import (
Expand Down
2 changes: 1 addition & 1 deletion shared/roughtime/roughtime.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package roughtime is a wrapper for a roughtime clock source
// Package roughtime is a wrapper for a roughtime clock source.
package roughtime

import (
Expand Down
1 change: 1 addition & 0 deletions shared/runutil/every.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package runutil includes helpers for scheduling runnable, periodic functions.
package runutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/service_registry.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package shared includes useful utilities globally accessible in
// the Prysm monorepo.
package shared

import (
Expand Down
1 change: 1 addition & 0 deletions shared/slotutil/slotticker.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package slotutil includes ticker and timer-related functions for eth2.
package slotutil

import (
Expand Down
1 change: 1 addition & 0 deletions shared/slotutil/testing/mock.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package testing includes useful mocks for slot tickers in unit tests.
package testing

// MockTicker defines a useful struct for mocking the Ticker interface
Expand Down
2 changes: 1 addition & 1 deletion shared/testutil/log.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package testutil defines the testing utils such as asserting logs.
// Package testutil defines common unit test utils such as asserting logs.
package testutil

import (
Expand Down
1 change: 1 addition & 0 deletions shared/traceutil/errors.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package traceutil includes useful functions for opentracing annotations.
package traceutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/tracing/tracer.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package tracing sets up jaeger as an opentracing tool
// for services in Prysm.
package tracing

import (
Expand Down
1 change: 1 addition & 0 deletions shared/trieutil/sparse_merkle.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package trieutil defines utilities for sparse merkle tries for eth2.
package trieutil

import (
Expand Down
2 changes: 2 additions & 0 deletions shared/version/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package version executes and returns the version string
// for the currently running process.
package version

import (
Expand Down
3 changes: 3 additions & 0 deletions slasher/cache/span_cache.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package cache contains critical caches necessary for the runtime
// of the slasher service, being able to keep attestation spans by epoch
// for the validators active in the beacon chain.
package cache

import (
Expand Down
1 change: 1 addition & 0 deletions slasher/db/db.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package db defines a persistent backend for the slasher service.
package db

import (
Expand Down
3 changes: 3 additions & 0 deletions slasher/db/iface/interface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package iface defines an interface for the slasher database,
// providing more advanced interfaces such as a
// ReadOnlyDatabase.
package iface

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/db/kv/kv.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package kv defines a bolt-db, key-value store implementation of
// the slasher database interface.
package kv

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/db/testing/setup_db.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package testing defines useful helper functions for unit tests with
// the slasher database.
package testing

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/db/types/types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package types includes important database-related types for
// slasher-specific logic.
package types

// SlashingStatus enum like structure.
Expand Down
1 change: 1 addition & 0 deletions slasher/detection/attestations/iface/iface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package iface defines an interface for a slashable attestation detector struct.
package iface

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/detection/attestations/spanner.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package attestations defines an implementation of a
// slashable attestation detector using min-max surround vote checking.
package attestations

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/detection/attestations/types/types.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package types includes important type definitions for
// slashable objects detected by slasher.
package types

import "github.com/prysmaticlabs/prysm/shared/bytesutil"
Expand Down
2 changes: 2 additions & 0 deletions slasher/detection/proposals/detector.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package proposals defines an implementation of a double-propose
// detector in the slasher runtime.
package proposals

import (
Expand Down
1 change: 1 addition & 0 deletions slasher/detection/proposals/iface/iface.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package iface defines an interface for a double-proposal detector struct.
package iface

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/detection/testing/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package testing includes useful helpers for slasher-related
// unit tests.
package testing

import (
Expand Down
2 changes: 2 additions & 0 deletions slasher/flags/flags.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package flags contains all configuration runtime flags for
// the slasher service.
package flags

import (
Expand Down
3 changes: 3 additions & 0 deletions slasher/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package main defines slasher server implementation for eth2. A slasher
// listens for all broadcasted messages using a running beacon node in order
// to detect malicious attestations and block proposals.
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions slasher/node/node.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package node is the main process which handles the lifecycle of
// the runtime services in a slasher process, gracefully shutting
// everything down upon close.
package node

import (
Expand Down
3 changes: 3 additions & 0 deletions slasher/rpc/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package rpc defines an implementation of a gRPC slasher service,
// providing endpoints for determining whether or not a block/attestation
// is slashable based on slasher's evidence.
package rpc

import (
Expand Down
1 change: 1 addition & 0 deletions validator/accounts/account.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package accounts defines tools to manage an encrypted validator keystore.
package accounts

import (
Expand Down
2 changes: 2 additions & 0 deletions validator/client/service.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package client defines the entire lifecycle of a validator in eth2 – it is responsible
// for interacting with a beacon node to determine and perform validator duties.
package client

import (
Expand Down
1 change: 1 addition & 0 deletions validator/db/db.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package db defines a persistent backend for the validator service.
package db

import (
Expand Down
2 changes: 1 addition & 1 deletion validator/db/iface/interface.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package iface exists to prevent circular dependencies when implementing the database interface.
// Package iface defines an interface for the validator database.
package iface

import (
Expand Down
2 changes: 2 additions & 0 deletions validator/flags/flags.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Package flags contains all configuration runtime flags for
// the validator service.
package flags

import (
Expand Down
3 changes: 3 additions & 0 deletions validator/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Package main defines a validator client, a critical actor in eth2 which manages
// a keystore of private keys, connects to a beacon node to receive assignments,
// and submits blocks/attestations as needed.
package main

import (
Expand Down
5 changes: 3 additions & 2 deletions validator/node/node.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Package node defines a validator client which connects to a
// full beacon node as part of the Ethereum Serenity specification.
// Package node is the main process which handles the lifecycle of
// the runtime services in a validator client process, gracefully shutting
// everything down upon close.
package node

import (
Expand Down

0 comments on commit 546196a

Please sign in to comment.