Documentation ¶
Index ¶
- Constants
- func AccumulateRewardsAndCountSigs(bc engine.ChainReader, state *state.DB, header *block.Header, ...) (reward.Reader, error)
- func DecodeSigBitmap(sigBytes bls.SerializedSignature, bitmap []byte, ...) (*bls_core.Sign, *bls.Mask, error)
- func GetCirculatingSupply(ctx context.Context, chain engine.ChainReader) (ret numeric.Dec, err error)
- func GetLockPeriodInEpoch(chain engine.ChainReader, epoch *big.Int) int
- func IsCommitteeSelectionBlock(chain engine.ChainReader, header *block.Header) bool
- func NewEngine() *engineImpl
- func ParseCommitSigAndBitmap(payload []byte) (bls.SerializedSignature, []byte, error)
- func ReadSignatureBitmapByPublicKeys(recvPayload []byte, publicKeys []bls.PublicKeyWrapper) (*bls_core.Sign, *bls.Mask, error)
Constants ¶
const ( // AsyncBlockProposalTimeout is the timeout which will abort the async block proposal. AsyncBlockProposalTimeout = 9 * time.Second )
timeout constant
Variables ¶
This section is empty.
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. The total reward consists of the static block reward This func also do IncrementValidatorSigningCounts for validators
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( ctx context.Context, chain engine.ChainReader, ) (ret numeric.Dec, err error)
GetCirculatingSupply using the following formula: (TotalInitialTokens * percentReleased) + PreStakingBlockRewards + StakingBlockRewards
Note that PreStakingBlockRewards is set to the amount of rewards given out by the LAST BLOCK of the pre-staking era regardless of what the current block height is if network is in the pre-staking era. This is for implementation reasons, reference stakingReward.GetTotalPreStakingTokens for more details.
WARNING: only works on beaconchain if in staking era.
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 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 ¶
This section is empty.