Documentation ¶
Index ¶
- Constants
- type AttesterFlag
- type AttesterStatus
- type BLSDomain
- type BLSDomainType
- type BLSPubkey
- type BLSSignature
- type Bytes
- type Checkpoint
- type Crosslink
- type Deltas
- type DepositIndex
- type Epoch
- type EpochStake
- type Gwei
- type RegistryIndices
- type Root
- type Shard
- type Slot
- type Timestamp
- type ValidatorIndex
- type ValidatorSet
- func (vs *ValidatorSet) Dedup()
- func (vs ValidatorSet) Intersects(target ValidatorSet) bool
- func (vs ValidatorSet) Len() int
- func (vs ValidatorSet) Less(i int, j int) bool
- func (vs ValidatorSet) MergeDisjoint(other ValidatorSet) ValidatorSet
- func (vs ValidatorSet) Swap(i int, j int)
- func (vs ValidatorSet) ZigZagJoin(target ValidatorSet, onIn func(i ValidatorIndex), onOut func(i ValidatorIndex))
- type Version
Constants ¶
const BASE_REWARDS_PER_EPOCH = 5
const BASE_REWARD_FACTOR = generated.BASE_REWARD_FACTOR
Reward and penalty quotients
const BLS_WITHDRAWAL_PREFIX byte = generated.BLS_WITHDRAWAL_PREFIX
const CHURN_LIMIT_QUOTIENT = generated.CHURN_LIMIT_QUOTIENT
const DEPOSIT_CONTRACT_TREE_DEPTH = 32
const FAR_FUTURE_EPOCH = Epoch(^uint64(0))
const GENESIS_EPOCH = Epoch(GENESIS_SLOT / SLOTS_PER_EPOCH)
const HALF_INCREMENT = generated.EFFECTIVE_BALANCE_INCREMENT / 2
const HISTORICAL_ROOTS_LIMIT = generated.HISTORICAL_ROOTS_LIMIT
const INACTIVITY_PENALTY_QUOTIENT = generated.INACTIVITY_PENALTY_QUOTIENT
const MAX_ATTESTATIONS = generated.MAX_ATTESTATIONS
const MAX_ATTESTER_SLASHINGS = generated.MAX_ATTESTER_SLASHINGS
const MAX_DEPOSITS = generated.MAX_DEPOSITS
const MAX_PROPOSER_SLASHINGS = generated.MAX_PROPOSER_SLASHINGS
Max transactions per block
const MAX_TRANSFERS = generated.MAX_TRANSFERS
const MAX_VALIDATORS_PER_COMMITTEE = generated.MAX_VALIDATORS_PER_COMMITTEE
const MAX_VOLUNTARY_EXITS = generated.MAX_VOLUNTARY_EXITS
const MIN_EPOCHS_TO_INACTIVITY_PENALTY = generated.MIN_EPOCHS_TO_INACTIVITY_PENALTY
const MIN_GENESIS_ACTIVE_VALIDATOR_COUNT = generated.MIN_GENESIS_ACTIVE_VALIDATOR_COUNT
Genesis
const MIN_GENESIS_TIME = generated.MIN_GENESIS_TIME
const MIN_PER_EPOCH_CHURN_LIMIT = generated.MIN_PER_EPOCH_CHURN_LIMIT
const MIN_SLASHING_PENALTY_QUOTIENT = generated.MIN_SLASHING_PENALTY_QUOTIENT
const PRESET_NAME = generated.PRESET_NAME
Helper to know what preset is active
const PROPOSER_REWARD_QUOTIENT = generated.PROPOSER_REWARD_QUOTIENT
const SECONDS_PER_DAY = 24 * 60 * 60
const SHUFFLE_ROUND_COUNT uint8 = generated.SHUFFLE_ROUND_COUNT
const TARGET_COMMITTEE_SIZE = generated.TARGET_COMMITTEE_SIZE
const VALIDATOR_REGISTRY_LIMIT = generated.VALIDATOR_REGISTRY_LIMIT
const ValidatorIndexMarker = ValidatorIndex(^uint64(0))
Custom constant, not in spec: An impossible high validator index used to mark special internal cases. (all 1s binary)
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 BLSSignature ¶
type BLSSignature [96]byte
type Checkpoint ¶ added in v0.8.2
type Deltas ¶ added in v0.8.2
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
Return the epoch at which an activation or exit triggered in epoch takes effect.
func (Epoch) GetStartSlot ¶
type EpochStake ¶ added in v0.8.2
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 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
type Timestamp ¶
type Timestamp uint64
Unix timestamp
const SECONDS_PER_SLOT Timestamp = generated.SECONDS_PER_SLOT
Time parameters
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) 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)