Documentation ¶
Index ¶
- Constants
- Variables
- type Actor
- func (a Actor) AwardBlockReward(rt vmr.Runtime, params *AwardBlockRewardParams) *adt.EmptyValue
- func (a Actor) Constructor(rt vmr.Runtime, _ *adt.EmptyValue) *adt.EmptyValue
- func (a Actor) Exports() []interface{}
- func (a Actor) LastPerEpochReward(rt vmr.Runtime, _ *adt.EmptyValue) *abi.TokenAmount
- func (a Actor) UpdateNetworkKPI(rt vmr.Runtime, currRealizedPower *abi.StoragePower) *adt.EmptyValue
- type AddrKey
- type AwardBlockRewardParams
- type NetworkTime
- type State
Constants ¶
const MintingInputFixedPoint = 30
Fixed-point precision (in bits) used for minting function's input "t"
const MintingOutputFixedPoint = 97
Fixed-point precision (in bits) used internally and for output
Variables ¶
var BaselineTotal = big.Mul(big.NewInt(900e6), big.NewInt(1e18)) // 900M for testnet, PARAM_FINISH
var LambdaDen = big.Mul(big.NewInt(6*builtin.SecondsInYear), LnTwoDen)
var LambdaNum = big.Mul(big.NewInt(builtin.EpochDurationSeconds), LnTwoNum)
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 λ.
var LnTwoDen, _ = big.FromString("10000000000000000000000000000")
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.
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) 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 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
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