collector

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: LGPL-3.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddActivationTxBalanceTransfer

func AddActivationTxBalanceTransfer(c StatsCollector, tx *types.Transaction, amount *big.Int)

func AddBurnTxBurntCoins

func AddBurnTxBurntCoins(c StatsCollector, addr common.Address, tx *types.Transaction)

func AddCandidateReward added in v0.29.0

func AddCandidateReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int)

func AddContractBalanceUpdate added in v0.24.0

func AddContractBalanceUpdate(c StatsCollector, address common.Address, getCurrentBalance GetBalanceFunc, newBalance *big.Int, appState *appstate.AppState)

func AddContractBurntCoins added in v0.24.0

func AddContractBurntCoins(c StatsCollector, address common.Address, getAmount GetBalanceFunc)

func AddContractStake added in v0.24.0

func AddContractStake(c StatsCollector, amount *big.Int)

func AddContractTerminationBurntCoins added in v0.24.0

func AddContractTerminationBurntCoins(c StatsCollector, address common.Address, stake, refund *big.Int)

func AddFeeBurntCoins

func AddFeeBurntCoins(c StatsCollector, addr common.Address, feeAmount *big.Int, burntRate float32,
	tx *types.Transaction)

func AddFinalCommitteeReward

func AddFinalCommitteeReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, stakeWeight *big.Float)

func AddFlipsBasicReward added in v0.31.0

func AddFlipsBasicReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, flipsToReward []*types.FlipToReward)

func AddFlipsExtraReward added in v0.31.0

func AddFlipsExtraReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, flipsToReward []*types.FlipToReward)

func AddFoundationPayout

func AddFoundationPayout(c StatsCollector, addr common.Address, balance *big.Int)

func AddInvitationsReward

func AddInvitationsReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, age uint16,
	txHash *common.Hash, epochHeight uint32, isSavedInviteWinner bool)

func AddInviteBurntCoins

func AddInviteBurntCoins(c StatsCollector, addr common.Address, amount *big.Int, tx *types.Transaction)

func AddInviteeReward added in v0.31.0

func AddInviteeReward(c StatsCollector, addr common.Address, stake *big.Int, age uint16, txHash common.Hash, epochHeight uint32)

func AddKillTxStakeTransfer

func AddKillTxStakeTransfer(c StatsCollector, tx *types.Transaction, amount *big.Int)

func AddKilledBurntCoins

func AddKilledBurntCoins(c StatsCollector, addr common.Address, amount *big.Int)

func AddMintedCoins

func AddMintedCoins(c StatsCollector, amount *big.Int)

func AddMultisigCallAdd added in v0.24.0

func AddMultisigCallAdd(c StatsCollector, address common.Address, newState *byte)

func AddMultisigCallPush added in v0.24.0

func AddMultisigCallPush(c StatsCollector, dest common.Address, amount []byte, voteAddressCnt, voteAmountCnt int)

func AddMultisigCallSend added in v0.24.0

func AddMultisigCallSend(c StatsCollector, dest common.Address, amount []byte)

func AddMultisigDeploy added in v0.24.0

func AddMultisigDeploy(c StatsCollector, contractAddress common.Address, minVotes, maxVotes, state byte)

func AddMultisigTermination added in v0.24.0

func AddMultisigTermination(c StatsCollector, dest common.Address)

func AddNonValidatedStake added in v0.31.0

func AddNonValidatedStake(c StatsCollector, addr common.Address, amount *big.Int)

func AddOracleLockCallCheckOracleVoting added in v0.24.0

func AddOracleLockCallCheckOracleVoting(c StatsCollector, votedValue byte, err error)

func AddOracleLockCallPush added in v0.24.0

func AddOracleLockCallPush(c StatsCollector, success bool, oracleVotingResult byte, transfer *big.Int)

func AddOracleLockDeploy added in v0.24.0

func AddOracleLockDeploy(c StatsCollector, contractAddress common.Address, oracleVotingAddress common.Address,
	value byte, successAddress common.Address, failAddress common.Address)

func AddOracleLockTermination added in v0.24.0

func AddOracleLockTermination(c StatsCollector, dest common.Address)

func AddOracleVotingCallAddStake added in v0.24.0

func AddOracleVotingCallAddStake(c StatsCollector)

func AddOracleVotingCallFinish added in v0.24.0

func AddOracleVotingCallFinish(c StatsCollector, state byte, result *byte, fund, oracleReward, ownerReward *big.Int)

func AddOracleVotingCallProlongation added in v0.24.0

func AddOracleVotingCallProlongation(c StatsCollector, startBlock *uint64, epoch uint16, vrfSeed []byte, committeeSize, networkSize, newCommitteeSize uint64,
	newEpochWithoutGrowth *byte, newProlongVoteCount *uint64)

func AddOracleVotingCallStart added in v0.24.0

func AddOracleVotingCallStart(c StatsCollector, state byte, startBlock uint64, epoch uint16, votingMinPayment *big.Int, vrfSeed []byte,
	committeeSize uint64, networkSize int)

func AddOracleVotingCallVote added in v0.24.0

func AddOracleVotingCallVote(c StatsCollector, vote byte, salt []byte, newOptionVotes *uint64, newOptionAllVotes uint64,
	newSecretVotesCount *uint64, delegatee *common.Address, prevPoolVote []byte, newPrevOptionVotes *uint64, discriminationFlags state.DiscriminationFlag)

func AddOracleVotingCallVoteProof added in v0.24.0

func AddOracleVotingCallVoteProof(c StatsCollector, voteHash []byte, newSecretVotesCount *uint64, discriminationFlags state.DiscriminationFlag)

func AddOracleVotingDeploy added in v0.24.0

func AddOracleVotingDeploy(c StatsCollector, contractAddress common.Address, startTime uint64,
	votingMinPayment *big.Int, fact []byte, state byte, votingDuration, publicVotingDuration uint64, winnerThreshold, quorum byte,
	committeeSize, networkSize uint64, ownerFee byte, ownerDeposit, oracleRewardFund *big.Int, refundRecipient *common.Address, hash []byte)

func AddOracleVotingTermination added in v0.24.0

func AddOracleVotingTermination(c StatsCollector, fund, oracleReward, ownerReward *big.Int)

func AddPenalizedStake added in v1.0.0

func AddPenalizedStake(c StatsCollector, addr common.Address, amount *big.Int)

func AddPenaltyBurntCoins

func AddPenaltyBurntCoins(c StatsCollector, addr common.Address, amount *big.Int)

func AddProposerReward

func AddProposerReward(c StatsCollector, balanceDest, stakeDest common.Address, balance, stake *big.Int, stakeWeight *big.Float)

func AddRefundableOracleLockCallDeposit added in v0.24.0

func AddRefundableOracleLockCallDeposit(c StatsCollector, ownSum, sum, fee *big.Int)

func AddRefundableOracleLockCallPush added in v0.24.0

func AddRefundableOracleLockCallPush(c StatsCollector, state byte, oracleVotingExists bool, oracleVotingResult byte, oracleVotingResultErr error, transfer *big.Int, refundBlock uint64)

func AddRefundableOracleLockCallRefund added in v0.24.0

func AddRefundableOracleLockCallRefund(c StatsCollector, balance *big.Int, coef decimal.Decimal)

func AddRefundableOracleLockDeploy added in v0.24.0

func AddRefundableOracleLockDeploy(c StatsCollector, contractAddress common.Address, oracleVotingAddress common.Address,
	value byte, successAddress common.Address, successAddressErr error, failAddress common.Address, failAddressErr error,
	refundDelay, depositDeadline uint64, oracleVotingFeeOld byte, oracleVotingFee uint64, state byte, sum *big.Int)

func AddRefundableOracleLockTermination added in v0.24.0

func AddRefundableOracleLockTermination(c StatsCollector, dest common.Address)

func AddRemovedTransitiveDelegation added in v0.27.0

func AddRemovedTransitiveDelegation(c StatsCollector, delegator, delegatee common.Address)

func AddReportedFlipsReward added in v0.22.0

func AddReportedFlipsReward(c StatsCollector, balanceDest, stakeDest common.Address, shardId common.ShardId, flipIdx int, balance, stake *big.Int)

func AddStakingReward added in v0.29.0

func AddStakingReward(c StatsCollector, balanceDest, stakeDest common.Address, stakedAmount *big.Int, balance, stake *big.Int)

func AddTimeLockCallTransfer added in v0.24.0

func AddTimeLockCallTransfer(c StatsCollector, dest common.Address, amount *big.Int)

func AddTimeLockDeploy added in v0.24.0

func AddTimeLockDeploy(c StatsCollector, contractAddress common.Address, timestamp uint64)

func AddTimeLockTermination added in v0.24.0

func AddTimeLockTermination(c StatsCollector, dest common.Address)

func AddTxFee added in v0.24.0

func AddTxFee(c StatsCollector, feeAmount *big.Int)

func AddTxReceipt added in v0.24.0

func AddTxReceipt(c StatsCollector, txReceipt *types.TxReceipt, appState *appstate.AppState)

func AddValidationReward

func AddValidationReward(c StatsCollector, balanceDest, stakeDest common.Address, age uint16, balance, stake *big.Int)

func AddZeroWalletFund

func AddZeroWalletFund(c StatsCollector, addr common.Address, balance *big.Int)

func AfterAddStake

func AfterAddStake(c StatsCollector, addr common.Address, amount *big.Int, appState *appstate.AppState)

func BeforeSetPenalty

func BeforeSetPenalty(c StatsCollector, addr common.Address, seconds uint16, inheritedFrom *common.Address, appState *appstate.AppState)

func BeginApplyingTx added in v0.24.0

func BeginApplyingTx(c StatsCollector, tx *types.Transaction, appState *appstate.AppState)

func BeginCommitteeRewardBalanceUpdate added in v0.20.0

func BeginCommitteeRewardBalanceUpdate(c StatsCollector, balanceDest, stakeDest common.Address, potentialPenaltyPayment *big.Int, appState *appstate.AppState)

func BeginDustClearingBalanceUpdate added in v0.20.0

func BeginDustClearingBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginEpochPenaltyResetBalanceUpdate added in v0.20.0

func BeginEpochPenaltyResetBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginEpochRewardBalanceUpdate added in v0.20.0

func BeginEpochRewardBalanceUpdate(c StatsCollector, balanceDest, stakeDest common.Address, appState *appstate.AppState)

func BeginFailedValidationBalanceUpdate added in v0.20.0

func BeginFailedValidationBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginIdentityClearingBalanceUpdate added in v0.30.0

func BeginIdentityClearingBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginPenaltyBalanceUpdate added in v0.20.0

func BeginPenaltyBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginProposerRewardBalanceUpdate added in v0.20.0

func BeginProposerRewardBalanceUpdate(c StatsCollector, balanceDest, stakeDest common.Address, potentialPenaltyPayment *big.Int, appState *appstate.AppState)

func BeginSavedStakeBalanceUpdate added in v0.29.0

func BeginSavedStakeBalanceUpdate(c StatsCollector, addr common.Address, appState *appstate.AppState)

func BeginTxBalanceUpdate added in v0.20.0

func BeginTxBalanceUpdate(c StatsCollector, tx *types.Transaction, appState *appstate.AppState)

func BeginVerifiedStakeTransferBalanceUpdate added in v0.20.0

func BeginVerifiedStakeTransferBalanceUpdate(c StatsCollector, addrFrom, addrTo common.Address, appState *appstate.AppState)

func CompleteApplyingTx added in v0.24.0

func CompleteApplyingTx(c StatsCollector, appState *appstate.AppState)

func CompleteBalanceUpdate added in v0.20.0

func CompleteBalanceUpdate(c StatsCollector, appState *appstate.AppState)

func SetMinScoreForInvite

func SetMinScoreForInvite(c StatsCollector, score float32)

func SetTotalCandidateReward added in v0.29.0

func SetTotalCandidateReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalFlipsBasicReward added in v0.31.0

func SetTotalFlipsBasicReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalFlipsExtraReward added in v0.31.0

func SetTotalFlipsExtraReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalFoundationPayouts

func SetTotalFoundationPayouts(c StatsCollector, amount *big.Int)

func SetTotalInvitationsReward

func SetTotalInvitationsReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalReportsReward added in v0.27.0

func SetTotalReportsReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalReward

func SetTotalReward(c StatsCollector, amount *big.Int)

func SetTotalStakingReward added in v0.29.0

func SetTotalStakingReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalValidationReward

func SetTotalValidationReward(c StatsCollector, amount *big.Int, share *big.Int)

func SetTotalZeroWalletFund

func SetTotalZeroWalletFund(c StatsCollector, amount *big.Int)

func SetValidation

func SetValidation(c StatsCollector, validation *statsTypes.ValidationStats)

func SetValidationResults added in v0.20.0

func SetValidationResults(c StatsCollector, validationResults map[common.ShardId]*types.ValidationResults)

Types

type GetBalanceFunc added in v0.24.0

type GetBalanceFunc func(address common.Address) *big.Int

type StatsCollector

type StatsCollector interface {
	EnableCollecting()
	CompleteCollecting()

	SetValidation(validation *statsTypes.ValidationStats)
	SetMinScoreForInvite(score float32)

	SetValidationResults(validationResults map[common.ShardId]*types.ValidationResults)

	SetTotalReward(amount *big.Int)
	SetTotalValidationReward(amount *big.Int, share *big.Int)
	SetTotalStakingReward(amount *big.Int, share *big.Int)
	SetTotalCandidateReward(amount *big.Int, share *big.Int)
	SetTotalFlipsBasicReward(amount *big.Int, share *big.Int)
	SetTotalFlipsExtraReward(amount *big.Int, share *big.Int)
	SetTotalReportsReward(amount *big.Int, share *big.Int)
	SetTotalInvitationsReward(amount *big.Int, share *big.Int)
	SetTotalFoundationPayouts(amount *big.Int)
	SetTotalZeroWalletFund(amount *big.Int)
	AddValidationReward(balanceDest, stakeDest common.Address, age uint16, balance, stake *big.Int)
	AddCandidateReward(balanceDest, stakeDest common.Address, balance, stake *big.Int)
	AddStakingReward(balanceDest, stakeDest common.Address, stakedAmount *big.Int, balance, stake *big.Int)
	AddFlipsBasicReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, flipsToReward []*types.FlipToReward)
	AddFlipsExtraReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, flipsToReward []*types.FlipToReward)
	AddReportedFlipsReward(balanceDest, stakeDest common.Address, shardId common.ShardId, flipIdx int, balance, stake *big.Int)
	AddInvitationsReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, age uint16, txHash *common.Hash,
		epochHeight uint32, isSavedInviteWinner bool)
	AddInviteeReward(addr common.Address, stake *big.Int, age uint16, txHash common.Hash, epochHeight uint32)
	AddFoundationPayout(addr common.Address, balance *big.Int)
	AddZeroWalletFund(addr common.Address, balance *big.Int)
	AddNonValidatedStake(addr common.Address, amount *big.Int)
	AddPenalizedStake(addr common.Address, amount *big.Int)

	AddProposerReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, stakeWeight *big.Float)
	AddFinalCommitteeReward(balanceDest, stakeDest common.Address, balance, stake *big.Int, stakeWeight *big.Float)

	BeforeSetPenalty(addr common.Address, seconds uint16, inheritedFrom *common.Address, appState *appstate.AppState)

	AddMintedCoins(amount *big.Int)
	AddPenaltyBurntCoins(addr common.Address, amount *big.Int)
	AddInviteBurntCoins(addr common.Address, amount *big.Int, tx *types.Transaction)
	AddFeeBurntCoins(addr common.Address, feeAmount *big.Int, burntRate float32, tx *types.Transaction)
	AddKilledBurntCoins(addr common.Address, amount *big.Int)
	AddBurnTxBurntCoins(addr common.Address, tx *types.Transaction)

	AfterAddStake(addr common.Address, amount *big.Int, appState *appstate.AppState)

	AddActivationTxBalanceTransfer(tx *types.Transaction, amount *big.Int)
	AddKillTxStakeTransfer(tx *types.Transaction, amount *big.Int)

	BeginVerifiedStakeTransferBalanceUpdate(addrFrom, addrTo common.Address, appState *appstate.AppState)
	BeginTxBalanceUpdate(tx *types.Transaction, appState *appstate.AppState)
	BeginProposerRewardBalanceUpdate(balanceDest, stakeDest common.Address, potentialPenaltyPayment *big.Int, appState *appstate.AppState)
	BeginCommitteeRewardBalanceUpdate(balanceDest, stakeDest common.Address, potentialPenaltyPayment *big.Int, appState *appstate.AppState)
	BeginEpochRewardBalanceUpdate(balanceDest, stakeDest common.Address, appState *appstate.AppState)
	BeginFailedValidationBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginPenaltyBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginEpochPenaltyResetBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginIdentityClearingBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginDustClearingBalanceUpdate(addr common.Address, appState *appstate.AppState)
	BeginSavedStakeBalanceUpdate(addr common.Address, appState *appstate.AppState)
	CompleteBalanceUpdate(appState *appstate.AppState)

	BeginApplyingTx(tx *types.Transaction, appState *appstate.AppState)
	CompleteApplyingTx(appState *appstate.AppState)
	AddTxFee(feeAmount *big.Int)

	AddContractStake(amount *big.Int)
	AddContractBalanceUpdate(address common.Address, getCurrentBalance GetBalanceFunc, newBalance *big.Int, appState *appstate.AppState)
	AddContractBurntCoins(address common.Address, getAmount GetBalanceFunc)
	AddContractTerminationBurntCoins(address common.Address, stake, refund *big.Int)

	AddOracleVotingDeploy(contractAddress common.Address, startTime uint64, votingMinPayment *big.Int,
		fact []byte, state byte, votingDuration, publicVotingDuration uint64, winnerThreshold, quorum byte,
		committeeSize, networkSize uint64, ownerFee byte, ownerDeposit, oracleRewardFund *big.Int, refundRecipient *common.Address, hash []byte)
	AddOracleVotingCallStart(state byte, startBlock uint64, epoch uint16, votingMinPayment *big.Int, vrfSeed []byte, committeeSize uint64, networkSize int)
	AddOracleVotingCallVoteProof(voteHash []byte, newSecretVotesCount *uint64, discriminationFlags state.DiscriminationFlag)
	AddOracleVotingCallVote(vote byte, salt []byte, newOptionVotes *uint64, newOptionAllVotes uint64,
		newSecretVotesCount *uint64, delegatee *common.Address, prevPoolVote []byte, newPrevOptionVotes *uint64, discriminationFlags state.DiscriminationFlag)
	AddOracleVotingCallFinish(state byte, result *byte, fund, oracleReward, ownerReward *big.Int)
	AddOracleVotingCallProlongation(startBlock *uint64, epoch uint16, vrfSeed []byte, committeeSize, networkSize, newCommitteeSize uint64,
		newEpochWithoutGrowth *byte, newProlongVoteCount *uint64)
	AddOracleVotingCallAddStake()
	AddOracleVotingTermination(fund, oracleReward, ownerReward *big.Int)

	AddOracleLockDeploy(contractAddress common.Address, oracleVotingAddress common.Address, value byte, successAddress common.Address,
		failAddress common.Address)
	AddOracleLockCallPush(success bool, oracleVotingResult byte, transfer *big.Int)
	AddOracleLockCallCheckOracleVoting(votedValue byte, err error)
	AddOracleLockTermination(dest common.Address)

	AddRefundableOracleLockDeploy(contractAddress common.Address, oracleVotingAddress common.Address, value byte,
		successAddress common.Address, successAddressErr error, failAddress common.Address, failAddressErr error,
		refundDelay, depositDeadline uint64, oracleVotingFeeOld byte, oracleVotingFee uint64, state byte, sum *big.Int)
	AddRefundableOracleLockCallDeposit(ownSum, sum, fee *big.Int)
	AddRefundableOracleLockCallPush(state byte, oracleVotingExists bool, oracleVotingResult byte, oracleVotingResultErr error, transfer *big.Int, refundBlock uint64)
	AddRefundableOracleLockCallRefund(balance *big.Int, coef decimal.Decimal)
	AddRefundableOracleLockTermination(dest common.Address)

	AddMultisigDeploy(contractAddress common.Address, minVotes, maxVotes, state byte)
	AddMultisigCallAdd(address common.Address, newState *byte)
	AddMultisigCallSend(dest common.Address, amount []byte)
	AddMultisigCallPush(dest common.Address, amount []byte, voteAddressCnt, voteAmountCnt int)
	AddMultisigTermination(dest common.Address)

	AddTimeLockDeploy(contractAddress common.Address, timestamp uint64)
	AddTimeLockCallTransfer(dest common.Address, amount *big.Int)
	AddTimeLockTermination(dest common.Address)

	AddTxReceipt(txReceipt *types.TxReceipt, appState *appstate.AppState)

	RemoveMemPoolTx(tx *types.Transaction)
	SubmitVoteCountingStepResult(round uint64, step uint8, votesByBlock map[common.Hash]map[common.Address]*types.Vote, necessaryVotesCount, checkedRoundVotes int)
	SubmitVoteCountingResult(round uint64, step uint8, validators *validators.StepValidators, hash common.Hash, cert *types.FullBlockCert, err error)
	SubmitProofProposal(round uint64, hash common.Hash, proposerPubKey []byte, modifier int)
	SubmitBlockProposal(proposal *types.BlockProposal, receivingTime time.Time)

	AddRemovedTransitiveDelegation(delegator, delegatee common.Address)
}

func NewStatsCollector

func NewStatsCollector() StatsCollector

Jump to

Keyboard shortcuts

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