chain

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// BlockReward is the block reward, to be split evenly among block signers.
	BlockReward = new(big.Int).Mul(big.NewInt(24), big.NewInt(denominations.One))
	// BaseStakedReward is the base block reward for epos.
	BaseStakedReward = numeric.NewDecFromBigInt(new(big.Int).Mul(
		big.NewInt(18), big.NewInt(denominations.One),
	))
)
View Source
var Engine = &engineImpl{nil, nil, nil}

Engine is an algorithm-agnostic consensus engine.

Functions

func AccumulateRewards

func AccumulateRewards(
	bc engine.ChainReader, state *state.DB, header *block.Header,
	rewarder reward.Distributor, slasher slash.Slasher,
	beaconChain engine.ChainReader,
) (*big.Int, error)

AccumulateRewards credits the coinbase of the given block with the mining reward. The total reward consists of the static block reward

func GetPublicKeys

func GetPublicKeys(chain engine.ChainReader, header *block.Header, reCalculate bool) ([]*bls.PublicKey, error)

GetPublicKeys finds the public keys of the committee that signed the block header

func QuorumForBlock

func QuorumForBlock(
	chain engine.ChainReader, h *block.Header, reCalculate bool,
) (quorum int, err error)

QuorumForBlock returns the quorum for the given block header.

func ReadPublicKeysFromLastBlock

func ReadPublicKeysFromLastBlock(bc engine.ChainReader, header *block.Header) ([]*bls.PublicKey, error)

ReadPublicKeysFromLastBlock finds the public keys of last block's committee

func ReadSignatureBitmapByPublicKeys

func ReadSignatureBitmapByPublicKeys(recvPayload []byte, publicKeys []*bls.PublicKey) (*bls.Sign, *bls2.Mask, error)

ReadSignatureBitmapByPublicKeys read the payload of signature and bitmap based on public keys

Types

This section is empty.

Jump to

Keyboard shortcuts

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