availability

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrDivByZero ..
	ErrDivByZero = errors.New("toSign of availability cannot be 0, mistake in protocol")
)

Functions

func BallotResult

func BallotResult(
	bc engine.ChainReader, header *block.Header, shardID uint32,
) (shard.SlotList, shard.SlotList, shard.SlotList, error)

BallotResult returns (parentCommittee.Slots, payable, missing, err)

func BlockSigners

func BlockSigners(
	bitmap []byte, parentCommittee *shard.Committee,
) (shard.SlotList, shard.SlotList, error)

BlockSigners ..

func ComputeCurrentSigning added in v1.3.4

func ComputeCurrentSigning(
	snapshot, wrapper *staking.ValidatorWrapper,
) (*big.Int, *big.Int, numeric.Dec, error)

ComputeCurrentSigning returns (signed, toSign, quotient, error)

func IncrementValidatorSigningCounts

func IncrementValidatorSigningCounts(
	bc Reader,
	staked *shard.StakedSlots,
	state *state.DB,
	signers, missing shard.SlotList,
) error

IncrementValidatorSigningCounts ..

func IsBelowSigningThreshold added in v1.3.4

func IsBelowSigningThreshold(quotient numeric.Dec) bool

IsBelowSigningThreshold ..

Types

type Reader added in v1.3.3

type Reader interface {
	ReadValidatorSnapshot(
		addr common.Address,
	) (*staking.ValidatorWrapper, error)
}

Reader ..

Jump to

Keyboard shortcuts

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