committee

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEligibleForEPoSAuction added in v1.3.6

func IsEligibleForEPoSAuction(snapshot *staking.ValidatorSnapshot, validator *staking.ValidatorWrapper) bool

IsEligibleForEPoSAuction ..

Types

type CandidateOrder added in v1.3.5

type CandidateOrder struct {
	*effective.SlotOrder
	StakePerKey *big.Int
	Validator   common.Address
}

CandidateOrder ..

func (CandidateOrder) MarshalJSON added in v1.3.5

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

MarshalJSON ..

type CandidatesForEPoS added in v1.3.5

type CandidatesForEPoS struct {
	Orders                             map[common.Address]effective.SlotOrder
	OpenSlotCountForExternalValidators int
}

CandidatesForEPoS ..

type ChainReader

type ChainReader interface {
	// ReadShardState retrieves sharding state given the epoch number.
	// This api reads the shard state cached or saved on the chaindb.
	// Thus, only should be used to read the shard state of the current chain.
	ReadShardState(epoch *big.Int) (*shard.State, error)
	// GetHeader retrieves a block header from the database by hash and number.
	GetHeaderByHash(common.Hash) *block.Header
	// Config retrieves the blockchain's chain configuration.
	Config() *params.ChainConfig
	// CurrentHeader retrieves the current header from the local chain.
	CurrentHeader() *block.Header
}

ChainReader is a subset of Engine.Blockchain, just enough to do assignment

type CompletedEPoSRound added in v1.3.5

type CompletedEPoSRound struct {
	MedianStake         numeric.Dec              `json:"epos-median-stake"`
	MaximumExternalSlot int                      `json:"max-external-slots"`
	AuctionWinners      []effective.SlotPurchase `json:"epos-slot-winners"`
	AuctionCandidates   []*CandidateOrder        `json:"epos-slot-candidates"`
}

CompletedEPoSRound ..

func NewEPoSRound added in v1.3.5

func NewEPoSRound(epoch *big.Int, stakedReader StakingCandidatesReader) (
	*CompletedEPoSRound, error,
)

NewEPoSRound runs a fresh computation of EPoS using latest data always

type DataProvider

type DataProvider interface {
	StakingCandidatesReader
	ChainReader
}

DataProvider ..

type Reader

type Reader interface {
	ValidatorListProvider
}

Reader is committee.Reader and it is the API that committee membership assignment needs

var (
	// WithStakingEnabled ..
	WithStakingEnabled Reader = partialStakingEnabled{}
	// ErrComputeForEpochInPast ..
	ErrComputeForEpochInPast = errors.New("cannot compute for epoch in past")
)

type StakingCandidatesReader

type StakingCandidatesReader interface {
	CurrentBlock() *types.Block
	ReadValidatorInformation(addr common.Address) (*staking.ValidatorWrapper, error)
	ReadValidatorSnapshot(addr common.Address) (*staking.ValidatorSnapshot, error)
	ValidatorCandidates() []common.Address
}

StakingCandidatesReader ..

type ValidatorListProvider

type ValidatorListProvider interface {
	Compute(
		epoch *big.Int, reader DataProvider,
	) (*shard.State, error)
	ReadFromDB(epoch *big.Int, reader DataProvider) (*shard.State, error)
}

ValidatorListProvider ..

Jump to

Keyboard shortcuts

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