core

package
v0.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const BASE_REWARDS_PER_EPOCH = 5
View Source
const BASE_REWARD_FACTOR = generated.BASE_REWARD_FACTOR

Reward and penalty quotients

View Source
const BLS_WITHDRAWAL_PREFIX byte = generated.BLS_WITHDRAWAL_PREFIX
View Source
const CHURN_LIMIT_QUOTIENT = generated.CHURN_LIMIT_QUOTIENT
View Source
const DEPOSIT_CONTRACT_TREE_DEPTH = 32
View Source
const FAR_FUTURE_EPOCH = Epoch(^uint64(0))
View Source
const GENESIS_EPOCH = Epoch(GENESIS_SLOT / SLOTS_PER_EPOCH)
View Source
const HISTORICAL_ROOTS_LIMIT = generated.HISTORICAL_ROOTS_LIMIT
View Source
const INACTIVITY_PENALTY_QUOTIENT = generated.INACTIVITY_PENALTY_QUOTIENT
View Source
const MAX_ATTESTATIONS = generated.MAX_ATTESTATIONS
View Source
const MAX_ATTESTER_SLASHINGS = generated.MAX_ATTESTER_SLASHINGS
View Source
const MAX_DEPOSITS = generated.MAX_DEPOSITS
View Source
const MAX_PROPOSER_SLASHINGS = generated.MAX_PROPOSER_SLASHINGS

Max transactions per block

View Source
const MAX_TRANSFERS = generated.MAX_TRANSFERS
View Source
const MAX_VALIDATORS_PER_COMMITTEE = generated.MAX_VALIDATORS_PER_COMMITTEE
View Source
const MAX_VOLUNTARY_EXITS = generated.MAX_VOLUNTARY_EXITS
View Source
const MIN_EPOCHS_TO_INACTIVITY_PENALTY = generated.MIN_EPOCHS_TO_INACTIVITY_PENALTY
View Source
const MIN_GENESIS_ACTIVE_VALIDATOR_COUNT = generated.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT

Genesis

View Source
const MIN_GENESIS_TIME = generated.MIN_GENESIS_TIME
View Source
const MIN_PER_EPOCH_CHURN_LIMIT = generated.MIN_PER_EPOCH_CHURN_LIMIT
View Source
const MIN_SLASHING_PENALTY_QUOTIENT = generated.MIN_SLASHING_PENALTY_QUOTIENT
View Source
const PRESET_NAME = generated.PRESET_NAME

Helper to know what preset is active

View Source
const PROPOSER_REWARD_QUOTIENT = generated.PROPOSER_REWARD_QUOTIENT
View Source
const SECONDS_PER_DAY = 24 * 60 * 60
View Source
const SHUFFLE_ROUND_COUNT uint8 = generated.SHUFFLE_ROUND_COUNT
View Source
const TARGET_COMMITTEE_SIZE = generated.TARGET_COMMITTEE_SIZE
View Source
const VALIDATOR_REGISTRY_LIMIT = generated.VALIDATOR_REGISTRY_LIMIT
View Source
const ValidatorIndexMarker = ValidatorIndex(^uint64(0))

Custom constant, not in spec: An impossible high validator index used to mark special internal cases. (all 1s binary)

View Source
const WHISTLEBLOWER_REWARD_QUOTIENT = generated.WHISTLEBLOWER_REWARD_QUOTIENT

Variables

This section is empty.

Functions

This section is empty.

Types

type AttesterFlag added in v0.8.2

type AttesterFlag uint8
const (
	PrevSourceAttester AttesterFlag = 1 << iota
	PrevTargetAttester
	PrevHeadAttester

	CurrSourceAttester
	CurrTargetAttester
	CurrHeadAttester

	UnslashedAttester
	EligibleAttester
)

func (AttesterFlag) HasMarkers added in v0.8.2

func (flags AttesterFlag) HasMarkers(markers AttesterFlag) bool

type AttesterStatus added in v0.8.2

type AttesterStatus struct {
	// The delay of inclusion of the latest attestation by the attester.
	// No delay (i.e. 0) by default
	InclusionDelay Slot
	// The validator index of the proposer of the attested beacon block.
	// Only valid if the validator has an attesting flag set.
	AttestedProposer ValidatorIndex
	// A bitfield of markers describing the recent actions of the validator
	Flags AttesterFlag
}

type BLSDomain

type BLSDomain [8]byte

BLS domain (8 bytes): fork version (32 bits) concatenated with BLS domain type (32 bits)

func ComputeDomain added in v0.8.2

func ComputeDomain(domainType BLSDomainType, forkVersion Version) (out BLSDomain)

type BLSDomainType

type BLSDomainType [4]byte

Mixed into a BLS domain to define its type

var (
	DOMAIN_BEACON_PROPOSER BLSDomainType = parseDomain(generated.DOMAIN_BEACON_PROPOSER)
	DOMAIN_RANDAO          BLSDomainType = parseDomain(generated.DOMAIN_RANDAO)
	DOMAIN_ATTESTATION     BLSDomainType = parseDomain(generated.DOMAIN_ATTESTATION)
	DOMAIN_DEPOSIT         BLSDomainType = parseDomain(generated.DOMAIN_DEPOSIT)
	DOMAIN_VOLUNTARY_EXIT  BLSDomainType = parseDomain(generated.DOMAIN_VOLUNTARY_EXIT)
	DOMAIN_TRANSFER        BLSDomainType = parseDomain(generated.DOMAIN_TRANSFER)
)

Signature domains

type BLSPubkey

type BLSPubkey [48]byte

type BLSSignature

type BLSSignature [96]byte

type Bytes

type Bytes []byte

type Checkpoint added in v0.8.2

type Checkpoint struct {
	Epoch Epoch
	Root  Root
}
type Crosslink struct {
	Shard      Shard
	ParentRoot Root
	// Crosslinking data
	StartEpoch Epoch
	EndEpoch   Epoch
	DataRoot   Root
}

type Deltas added in v0.8.2

type Deltas struct {
	// element for each validator in registry
	Rewards []Gwei
	// element for each validator in registry
	Penalties []Gwei
}

func NewDeltas added in v0.8.2

func NewDeltas(validatorCount uint64) *Deltas

func (*Deltas) Add added in v0.8.2

func (deltas *Deltas) Add(other *Deltas)

type DepositIndex

type DepositIndex uint64

Eth1 deposit ordering

type Epoch

type Epoch uint64
const ACTIVATION_EXIT_DELAY Epoch = generated.ACTIVATION_EXIT_DELAY
const EPOCHS_PER_HISTORICAL_VECTOR Epoch = generated.EPOCHS_PER_HISTORICAL_VECTOR

State list lengths

const EPOCHS_PER_SLASHINGS_VECTOR Epoch = generated.EPOCHS_PER_SLASHINGS_VECTOR
const MAX_EPOCHS_PER_CROSSLINK Epoch = generated.MAX_EPOCHS_PER_CROSSLINK
const MIN_SEED_LOOKAHEAD Epoch = generated.MIN_SEED_LOOKAHEAD
const MIN_VALIDATOR_WITHDRAWABILITY_DELAY Epoch = generated.MIN_VALIDATOR_WITHDRAWABILITY_DELAY
const PERSISTENT_COMMITTEE_PERIOD Epoch = generated.PERSISTENT_COMMITTEE_PERIOD

func (Epoch) ComputeActivationExitEpoch added in v0.8.2

func (e Epoch) ComputeActivationExitEpoch() Epoch

Return the epoch at which an activation or exit triggered in epoch takes effect.

func (Epoch) GetStartSlot

func (e Epoch) GetStartSlot() Slot

func (Epoch) Previous added in v0.8.2

func (e Epoch) Previous() Epoch

type EpochStake added in v0.8.2

type EpochStake struct {
	SourceBalance Gwei
	TargetBalance Gwei
	HeadBalance   Gwei
}

type Gwei

type Gwei uint64
const EFFECTIVE_BALANCE_INCREMENT Gwei = generated.EFFECTIVE_BALANCE_INCREMENT
const EJECTION_BALANCE Gwei = generated.EJECTION_BALANCE

unused const FORK_CHOICE_BALANCE_INCREMENT Gwei = generated.FORK_CHOICE_BALANCE_INCREMENT

const MAX_EFFECTIVE_BALANCE Gwei = generated.MAX_EFFECTIVE_BALANCE
const MIN_DEPOSIT_AMOUNT Gwei = generated.MIN_DEPOSIT_AMOUNT

Gwei values

type RegistryIndices added in v0.8.2

type RegistryIndices []ValidatorIndex

func (*RegistryIndices) Limit added in v0.8.2

func (*RegistryIndices) Limit() uint64

type Root

type Root [32]byte

type Shard

type Shard uint64
const SHARD_COUNT Shard = generated.SHARD_COUNT

Misc.

type Slot

type Slot uint64

Current slot

const GENESIS_SLOT Slot = generated.GENESIS_SLOT

Initial values

const MIN_ATTESTATION_INCLUSION_DELAY Slot = generated.MIN_ATTESTATION_INCLUSION_DELAY
const SLOTS_PER_EPOCH Slot = generated.SLOTS_PER_EPOCH
const SLOTS_PER_ETH1_VOTING_PERIOD Slot = generated.SLOTS_PER_ETH1_VOTING_PERIOD
const SLOTS_PER_HISTORICAL_ROOT Slot = generated.SLOTS_PER_HISTORICAL_ROOT

func (Slot) ToEpoch

func (s Slot) ToEpoch() Epoch

type Timestamp

type Timestamp uint64

Unix timestamp

const SECONDS_PER_SLOT Timestamp = generated.SECONDS_PER_SLOT

Time parameters

func (Timestamp) ToSlot

func (t Timestamp) ToSlot(genesisTime Timestamp) Slot

type ValidatorIndex

type ValidatorIndex uint64

Index of a validator, pointing to a validator registry location

type ValidatorSet

type ValidatorSet []ValidatorIndex

Collection of validators, should always be sorted.

func (*ValidatorSet) Dedup

func (vs *ValidatorSet) Dedup()

De-duplicates entries in the set in-place. (util to make a valid set from a list with duplicates)

func (ValidatorSet) Intersects

func (vs ValidatorSet) Intersects(target ValidatorSet) bool

Joins two validator sets: check if there is any overlap

func (ValidatorSet) Len

func (vs ValidatorSet) Len() int

func (ValidatorSet) Less

func (vs ValidatorSet) Less(i int, j int) bool

func (ValidatorSet) MergeDisjoint added in v0.8.2

func (vs ValidatorSet) MergeDisjoint(other ValidatorSet) ValidatorSet

merges with other disjoint set, producing a new set.

func (ValidatorSet) Swap

func (vs ValidatorSet) Swap(i int, j int)

func (ValidatorSet) ZigZagJoin

func (vs ValidatorSet) ZigZagJoin(target ValidatorSet, onIn func(i ValidatorIndex), onOut func(i ValidatorIndex))

Joins two validator sets: reports all indices of source that are in the target (call onIn), and those that are not (call onOut)

type Version added in v0.8.2

type Version [4]byte

32 bits, not strictly an integer, hence represented as 4 bytes (bytes not necessarily corresponding to versions)

func (Version) ToUint32 added in v0.8.2

func (v Version) ToUint32() uint32

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL