reward

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0, MIT Imports: 12 Imported by: 21

Documentation

Index

Constants

View Source
const MintingInputFixedPoint = 30

Fixed-point precision (in bits) used for minting function's input "t"

View Source
const MintingOutputFixedPoint = 97

Fixed-point precision (in bits) used internally and for output

Variables

View Source
var BaselineTotal = big.Mul(big.NewInt(900e6), big.NewInt(1e18)) // 900M for testnet, PARAM_FINISH

We multiply the fraction ([Seconds per epoch] / (6 * [Seconds per year])) into the rational representation of -ln(1/2) which was just loaded, to produce the final, constant, rational representation of λ.

View Source
var LnTwoDen, _ = big.FromString("10000000000000000000000000000")
View Source
var LnTwoNum, _ = big.FromString("6931471805599453094172321215")

The following are the numerator and denominator of -ln(1/2)=ln(2), represented as a rational with sufficient precision. They are parsed from strings because literals cannot be this long; they are stored as separate variables only because the string parsing function has multiple returns.

View Source
var SimpleTotal = big.Mul(big.NewInt(100e6), big.NewInt(1e18)) // 100M for testnet, PARAM_FINISH

These numbers are placeholders, but should be in units of attoFIL, 10^-18 FIL

Functions

This section is empty.

Types

type Actor

type Actor struct{}

func (Actor) AwardBlockReward

func (a Actor) AwardBlockReward(rt vmr.Runtime, params *AwardBlockRewardParams) *adt.EmptyValue

Awards a reward to a block producer. This method is called only by the system actor, implicitly, as the last message in the evaluation of a block. The system actor thus computes the parameters and attached value.

The reward includes two components: - the epoch block reward, computed and paid from the reward actor's balance, - the block gas reward, expected to be transferred to the reward actor with this invocation.

The reward is reduced before the residual is credited to the block producer, by: - a penalty amount, provided as a parameter, which is burnt,

func (Actor) Constructor

func (a Actor) Constructor(rt vmr.Runtime, _ *adt.EmptyValue) *adt.EmptyValue

func (Actor) Exports

func (a Actor) Exports() []interface{}

func (Actor) LastPerEpochReward

func (a Actor) LastPerEpochReward(rt vmr.Runtime, _ *adt.EmptyValue) *abi.TokenAmount

func (Actor) UpdateNetworkKPI

func (a Actor) UpdateNetworkKPI(rt vmr.Runtime, currRealizedPower *abi.StoragePower) *adt.EmptyValue

Called at the end of each epoch by the power actor (in turn by its cron hook). This is only invoked for non-empty tipsets. The impact of this is that block rewards are paid out over a schedule defined by non-empty tipsets, not by elapsed time/epochs. This is not necessarily what we want, and may change.

type AddrKey

type AddrKey = adt.AddrKey

type AwardBlockRewardParams

type AwardBlockRewardParams struct {
	Miner     address.Address
	Penalty   abi.TokenAmount // penalty for including bad messages in a block
	GasReward abi.TokenAmount // gas reward from all gas fees in a block
}

func (*AwardBlockRewardParams) MarshalCBOR

func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error

func (*AwardBlockRewardParams) UnmarshalCBOR

func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) error

type NetworkTime added in v0.5.1

type NetworkTime = big.Int

Fractional representation of NetworkTime with an implicit denominator of (2^MintingInputFixedPoint).

type State

type State struct {
	BaselinePower        abi.StoragePower
	RealizedPower        abi.StoragePower
	CumsumBaseline       abi.Spacetime
	CumsumRealized       abi.Spacetime
	EffectiveNetworkTime NetworkTime

	SimpleSupply   abi.TokenAmount // current supply
	BaselineSupply abi.TokenAmount // current supply

	// The reward to be paid in total to block producers, if exactly the expected number of them produce a block.
	// The actual reward total paid out depends on the number of winners in any round.
	// This is computed at the end of the previous epoch, and should really be called ThisEpochReward.
	LastPerEpochReward abi.TokenAmount

	// The count of epochs for which a reward has been paid.
	// This should equal the number of non-empty tipsets after the genesis, aka "chain height".
	RewardEpochsPaid abi.ChainEpoch
}

func ConstructState

func ConstructState() *State

func (*State) MarshalCBOR

func (t *State) MarshalCBOR(w io.Writer) error

func (*State) UnmarshalCBOR

func (t *State) UnmarshalCBOR(r io.Reader) error

Jump to

Keyboard shortcuts

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