effective

package
v0.0.0-...-bf01c4b Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Unknown ..
	Unknown Candidacy = iota
	// ForeverBanned ..
	ForeverBanned
	// Candidate ..
	Candidate = iota
	// NotCandidate ..
	NotCandidate
	// Elected ..
	Elected
)

Variables

This section is empty.

Functions

func Median

func Median(stakes []SlotPurchase) numeric.Dec

Median ..

Types

type BootedStatus

type BootedStatus byte

BootedStatus ..

const (
	// Booted ..
	Booted BootedStatus = iota
	// NotBooted ..
	NotBooted
	// LostEPoSAuction ..
	LostEPoSAuction
	// TurnedInactiveOrInsufficientUptime ..
	TurnedInactiveOrInsufficientUptime
	// BannedForDoubleSigning ..
	BannedForDoubleSigning
)

func (BootedStatus) String

func (r BootedStatus) String() string

type Candidacy

type Candidacy byte

Candidacy is a more semantically meaningful value that is derived from core protocol logic but meant more for the presentation of user, like at RPC

func ValidatorStatus

func ValidatorStatus(currentlyInCommittee bool, status Eligibility) Candidacy

ValidatorStatus ..

func (Candidacy) String

func (c Candidacy) String() string

type Eligibility

type Eligibility byte

Eligibility represents ability to participate in EPoS auction that occurs just once an epoch on beaconchain

const (
	// Nil is a default state that represents a no-op
	Nil Eligibility = iota
	// Active means allowed in epos auction
	Active
	// Inactive means validator did not sign enough over 66%
	// of the time in an epoch and so they are removed from
	// the possibility of being in the epos auction, which happens
	// only once an epoch and only
	// by beaconchain, aka shard.BeaconChainShardID
	Inactive
	// Banned records whether this validator is banned
	// from the network because they double-signed
	// it can never be undnet
	Banned
)

func (Eligibility) String

func (e Eligibility) String() string

type SlotOrder

type SlotOrder struct {
	Stake       *big.Int                  `json:"stake"`
	SpreadAmong []bls.SerializedPublicKey `json:"keys-at-auction"`
	Percentage  numeric.Dec               `json:"percentage-of-total-auction-stake"`
}

SlotOrder ..

type SlotPurchase

type SlotPurchase struct {
	Addr      common.Address
	Key       bls.SerializedPublicKey
	RawStake  numeric.Dec
	EPoSStake numeric.Dec
}

SlotPurchase ..

func Apply

func Apply(shortHand map[common.Address]*SlotOrder, pull int) (
	numeric.Dec, []SlotPurchase,
)

Apply ..

func Compute

func Compute(
	shortHand map[common.Address]*SlotOrder, pull int,
) (numeric.Dec, []SlotPurchase)

Compute ..

func (SlotPurchase) MarshalJSON

func (p SlotPurchase) MarshalJSON() ([]byte, error)

MarshalJSON ..

Jump to

Keyboard shortcuts

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