chain

package
v0.1.27 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: LGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AsyncBlockProposalTimeout is the timeout which will abort the async block proposal.
	AsyncBlockProposalTimeout = 9 * time.Second
	// RewardFrequency the number of blocks between each aggregated reward distribution
	RewardFrequency = 64
)

timeout constant

Variables

View Source
var (
	// InaccessibleAddresses are a list of known eth addresses that cannot spend ONE tokens.
	InaccessibleAddresses = []common.Address{

		common.HexToAddress("0x7bDeF7Bdef7BDeF7BDEf7bDef7bdef7bdeF6E7AD"),
	}
)

Circulating supply calculation

Functions

func AccumulateRewardsAndCountSigs

func AccumulateRewardsAndCountSigs(
	bc engine.ChainReader, state *state.DB,
	header *block.Header, beaconChain engine.ChainReader, sigsReady chan bool,
) (reward.Reader, error)

AccumulateRewardsAndCountSigs credits the coinbase of the given block with the mining reward and also does IncrementValidatorSigningCounts for validators. param sigsReady: Signal indicating that commit sigs are already populated in the header object.

func DecodeSigBitmap

func DecodeSigBitmap(sigBytes bls.SerializedSignature, bitmap []byte, pubKeys []bls.PublicKeyWrapper) (*bls_core.Sign, *bls.Mask, error)

DecodeSigBitmap decode and parse the signature, bitmap with the given public keys

func GetCirculatingSupply

func GetCirculatingSupply(chain engine.ChainReader) (numeric.Dec, error)

GetCirculatingSupply get the circulating supply. The value is the total circulating supply sub the tokens burnt at inaccessible addresses. WARNING: only works on beacon chain if in staking era.

func GetInaccessibleTokens

func GetInaccessibleTokens(chain engine.ChainReader) (numeric.Dec, error)

GetInaccessibleTokens get the total inaccessible tokens. The amount is the sum of balance at all inaccessible addresses.

func GetLeaderPubKeyFromCoinbase

func GetLeaderPubKeyFromCoinbase(
	blockchain engine.ChainReader, h *block.Header,
) (*bls.PublicKeyWrapper, error)

retrieve corresponding blsPublicKey from Coinbase Address

func GetLockPeriodInEpoch

func GetLockPeriodInEpoch(chain engine.ChainReader, epoch *big.Int) int

GetLockPeriodInEpoch returns the delegation lock period for the given chain

func IsCommitteeSelectionBlock

func IsCommitteeSelectionBlock(chain engine.ChainReader, header *block.Header) bool

IsCommitteeSelectionBlock checks if the given header is for the committee selection block which can only occur on beacon chain and if epoch > pre-staking epoch.

func NewEngine

func NewEngine() *engineImpl

NewEngine creates Engine with some cache

func ParseCommitSigAndBitmap

func ParseCommitSigAndBitmap(payload []byte) (bls.SerializedSignature, []byte, error)

ParseCommitSigAndBitmap parse the commitSigAndBitmap to signature + bitmap

func ReadSignatureBitmapByPublicKeys

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

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

Types

type InaccessibleAddressInfo

type InaccessibleAddressInfo struct {
	EthAddress common.Address
	Address    string // One address
	Balance    numeric.Dec
	Nonce      uint64
}

InaccessibleAddressInfo is the structure for inaccessible addresses

func GetInaccessibleAddressInfo

func GetInaccessibleAddressInfo(chain engine.ChainReader) ([]*InaccessibleAddressInfo, error)

GetInaccessibleAddressInfo return the information of all inaccessible addresses.

Jump to

Keyboard shortcuts

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