Documentation ¶
Index ¶
- Constants
- Variables
- func BaselinePowerFromPrev(prevEpochBaselinePower abi.StoragePower, nv network.Version) abi.StoragePower
- func InitBaselinePower() abi.StoragePower
- func SlowConvenientBaselineForEpoch(targetEpoch abi.ChainEpoch, nv network.Version) abi.StoragePower
- type Actor
- func (a Actor) AwardBlockReward(rt runtime.Runtime, params *AwardBlockRewardParams) *abi.EmptyValue
- func (a Actor) Code() cid.Cid
- func (a Actor) Constructor(rt runtime.Runtime, currRealizedPower *abi.StoragePower) *abi.EmptyValue
- func (a Actor) Exports() []interface{}
- func (a Actor) IsSingleton() bool
- func (a Actor) State() cbor.Er
- func (a Actor) ThisEpochReward(rt runtime.Runtime, _ *abi.EmptyValue) *ThisEpochRewardReturn
- func (a Actor) UpdateNetworkKPI(rt runtime.Runtime, currRealizedPower *abi.StoragePower) *abi.EmptyValue
- type AwardBlockRewardParams
- type Spacetime
- type State
- type ThisEpochRewardReturn
Constants ¶
const InitialRewardPositionEstimateStr = "36266260308195979333"
36.266260308195979333 FIL https://www.wolframalpha.com/input/?i=IntegerPart%5B330%2C000%2C000+*+%281+-+Exp%5B-Log%5B2%5D+%2F+%286+*+%281+year+%2F+30+seconds%29%29%5D%29+*+10%5E18%5D
Variables ¶
var BaselineExponentV0 = big.MustFromString("340282722551251692435795578557183609728") // Q.128
Floor(e^(ln[1 + 200%] / epochsInYear) * 2^128 Q.128 formatted number such that f(epoch) = baseExponent^epoch grows 200% in one year of epochs Calculation here: https://www.wolframalpha.com/input/?i=IntegerPart%5BExp%5BLog%5B1%2B200%25%5D%2F%28%28365+days%29%2F%2830+seconds%29%29%5D*2%5E128%5D
var BaselineExponentV3 = big.MustFromString("340282591298641078465964189926313473653") // Q.128
Floor(e^(ln[1 + 100%] / epochsInYear) * 2^128 Q.128 formatted number such that f(epoch) = baseExponent^epoch grows 100% in one year of epochs Calculation here: https://www.wolframalpha.com/input/?i=IntegerPart%5BExp%5BLog%5B1%2B100%25%5D%2F%28%28365+days%29%2F%2830+seconds%29%29%5D*2%5E128%5D
var BaselineInitialValueV0 = big.Lsh(big.NewInt(1), 60) // Q.0
1EiB
var BaselineInitialValueV3 = big.NewInt(2_888_888_880_000_000_000) // Q.0
2.5057116798121726 EiB
var BaselineTotal = big.Mul(big.NewInt(770e6), big.NewInt(1e18)) // 770M for testnet, PARAM_FINISH
var InitialRewardPositionEstimate = big.MustFromString(InitialRewardPositionEstimateStr)
var InitialRewardVelocityEstimate = abi.NewTokenAmount(-109897758509)
-1.0982489*10^-7 FIL per epoch. Change of simple minted tokens between epochs 0 and 1 https://www.wolframalpha.com/input/?i=IntegerPart%5B%28Exp%5B-Log%5B2%5D+%2F+%286+*+%281+year+%2F+30+seconds%29%29%5D+-+1%29+*+10%5E18%5D
var SimpleTotal = big.Mul(big.NewInt(330e6), big.NewInt(1e18)) // 330M for testnet, PARAM_FINISH
These numbers are placeholders, but should be in units of attoFIL, 10^-18 FIL
Functions ¶
func BaselinePowerFromPrev ¶ added in v0.8.1
func BaselinePowerFromPrev(prevEpochBaselinePower abi.StoragePower, nv network.Version) abi.StoragePower
Compute BaselinePower(t) from BaselinePower(t-1) with an additional multiplication of the base exponent.
func InitBaselinePower ¶ added in v0.8.1
func InitBaselinePower() abi.StoragePower
Initialize baseline power for epoch -1 so that baseline power at epoch 0 is BaselineInitialValue.
func SlowConvenientBaselineForEpoch ¶ added in v0.8.1
func SlowConvenientBaselineForEpoch(targetEpoch abi.ChainEpoch, nv network.Version) abi.StoragePower
SlowConvenientBaselineForEpoch computes baseline power for use in epoch t by calculating the value of ThisEpochBaselinePower that shows up in block at t - 1 It multiplies ~t times so it should not be used in actor code directly. It is exported as convenience for consuming node.
Types ¶
type Actor ¶
type Actor struct{}
func (Actor) AwardBlockReward ¶
func (a Actor) AwardBlockReward(rt runtime.Runtime, params *AwardBlockRewardParams) *abi.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 runtime.Runtime, currRealizedPower *abi.StoragePower) *abi.EmptyValue
func (Actor) IsSingleton ¶ added in v0.9.12
func (Actor) ThisEpochReward ¶ added in v0.7.2
func (a Actor) ThisEpochReward(rt runtime.Runtime, _ *abi.EmptyValue) *ThisEpochRewardReturn
The award value used for the current epoch, updated at the end of an epoch through cron tick. In the case previous epochs were null blocks this is the reward value as calculated at the last non-null epoch.
func (Actor) UpdateNetworkKPI ¶
func (a Actor) UpdateNetworkKPI(rt runtime.Runtime, currRealizedPower *abi.StoragePower) *abi.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, but catches up any number of null epochs to compute the next epoch reward.
type AwardBlockRewardParams ¶
type AwardBlockRewardParams struct { Miner address.Address Penalty abi.TokenAmount // penalty for including bad messages in a block, >= 0 GasReward abi.TokenAmount // gas reward from all gas fees in a block, >= 0 WinCount int64 // number of reward units won, > 0 }
func (*AwardBlockRewardParams) MarshalCBOR ¶
func (t *AwardBlockRewardParams) MarshalCBOR(w io.Writer) error
func (*AwardBlockRewardParams) UnmarshalCBOR ¶
func (t *AwardBlockRewardParams) UnmarshalCBOR(r io.Reader) error
type Spacetime ¶ added in v0.7.2
A quantity of space * time (in byte-epochs) representing power committed to the network for some duration.
type State ¶
type State struct { // CumsumBaseline is a target CumsumRealized needs to reach for EffectiveNetworkTime to increase // CumsumBaseline and CumsumRealized are expressed in byte-epochs. CumsumBaseline Spacetime // CumsumRealized is cumulative sum of network power capped by BalinePower(epoch) CumsumRealized Spacetime // EffectiveNetworkTime is ceiling of real effective network time `theta` based on // CumsumBaselinePower(theta) == CumsumRealizedPower // Theta captures the notion of how much the network has progressed in its baseline // and in advancing network time. EffectiveNetworkTime abi.ChainEpoch // EffectiveBaselinePower is the baseline power at the EffectiveNetworkTime epoch EffectiveBaselinePower abi.StoragePower // The reward to be paid in per WinCount to block producers. // The actual reward total paid out depends on the number of winners in any round. // This value is recomputed every non-null epoch and used in the next non-null epoch. ThisEpochReward abi.TokenAmount // Smoothed ThisEpochReward ThisEpochRewardSmoothed *smoothing.FilterEstimate // The baseline power the network is targeting at st.Epoch ThisEpochBaselinePower abi.StoragePower // Epoch tracks for which epoch the Reward was computed Epoch abi.ChainEpoch // TotalMined tracks the total FIL awared to block miners TotalMined abi.TokenAmount }
func ConstructState ¶
func ConstructState(currRealizedPower abi.StoragePower) *State
type ThisEpochRewardReturn ¶ added in v0.8.0
type ThisEpochRewardReturn struct { ThisEpochReward abi.TokenAmount ThisEpochRewardSmoothed *smoothing.FilterEstimate ThisEpochBaselinePower abi.StoragePower }
func (*ThisEpochRewardReturn) MarshalCBOR ¶ added in v0.8.0
func (t *ThisEpochRewardReturn) MarshalCBOR(w io.Writer) error
func (*ThisEpochRewardReturn) UnmarshalCBOR ¶ added in v0.8.0
func (t *ThisEpochRewardReturn) UnmarshalCBOR(r io.Reader) error