Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
Remove methods from FilterEstimate so struct can be aliased from prio…
Browse files Browse the repository at this point in the history
…r versions (#1564)
  • Loading branch information
anorth authored Jan 13, 2022
1 parent a193179 commit 9f1bed0
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 534 deletions.
237 changes: 0 additions & 237 deletions actors/builtin/cbor_gen.go

This file was deleted.

2 changes: 1 addition & 1 deletion actors/builtin/miner/miner_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ func (a Actor) ReportConsensusFault(rt Runtime, params *ReportConsensusFaultPara
rewardStats := requestCurrentEpochBlockReward(rt)
// The policy amounts we should burn and send to reporter
// These may differ from actual funds send when miner goes into fee debt
thisEpochReward := rewardStats.ThisEpochRewardSmoothed.Estimate()
thisEpochReward := smoothing.Estimate(&rewardStats.ThisEpochRewardSmoothed)
faultPenalty := ConsensusFaultPenalty(thisEpochReward)
slasherReward := RewardForConsensusSlashReport(thisEpochReward)
pledgeDelta := big.Zero()
Expand Down
2 changes: 1 addition & 1 deletion actors/builtin/miner/miner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4743,7 +4743,7 @@ func (h *actorHarness) reportConsensusFault(rt *mock.Runtime, from addr.Address,
}
rt.ExpectSend(builtin.RewardActorAddr, builtin.MethodsReward.ThisEpochReward, nil, big.Zero(), &currentReward, exitcode.Ok)

thisEpochReward := h.epochRewardSmooth.Estimate()
thisEpochReward := smoothing.Estimate(&h.epochRewardSmooth)
penaltyTotal := miner.ConsensusFaultPenalty(thisEpochReward)
rewardTotal := miner.RewardForConsensusSlashReport(thisEpochReward)
rt.ExpectSend(from, builtin.MethodSend, nil, rewardTotal, nil, exitcode.Ok)
Expand Down
6 changes: 3 additions & 3 deletions actors/builtin/miner/monies.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ var BasePenaltyForDisputedWindowPoSt = big.Mul(big.NewInt(20), builtin.TokenPrec
// ProjectedRewardFraction(t) is the sum of estimated reward over estimated total power
// over all epochs in the projection period [t t+projectionDuration]
func ExpectedRewardForPower(rewardEstimate, networkQAPowerEstimate smoothing.FilterEstimate, qaSectorPower abi.StoragePower, projectionDuration abi.ChainEpoch) abi.TokenAmount {
networkQAPowerSmoothed := networkQAPowerEstimate.Estimate()
networkQAPowerSmoothed := smoothing.Estimate(&networkQAPowerEstimate)
if networkQAPowerSmoothed.IsZero() {
return rewardEstimate.Estimate()
return smoothing.Estimate(&rewardEstimate)
}
expectedRewardForProvingPeriod := smoothing.ExtrapolatedCumSumOfRatio(projectionDuration, 0, rewardEstimate, networkQAPowerEstimate)
br128 := big.Mul(qaSectorPower, expectedRewardForProvingPeriod) // Q.0 * Q.128 => Q.128
Expand Down Expand Up @@ -170,7 +170,7 @@ func InitialPledgeForPower(qaPower, baselinePower abi.StoragePower, rewardEstima
lockTargetNum := big.Mul(InitialPledgeLockTarget.Numerator, circulatingSupply)
lockTargetDenom := InitialPledgeLockTarget.Denominator
pledgeShareNum := qaPower
networkQAPower := networkQAPowerEstimate.Estimate()
networkQAPower := smoothing.Estimate(&networkQAPowerEstimate)
pledgeShareDenom := big.Max(big.Max(networkQAPower, baselinePower), qaPower) // use qaPower in case others are 0
additionalIPNum := big.Mul(lockTargetNum, pledgeShareNum)
additionalIPDenom := big.Mul(lockTargetDenom, pledgeShareDenom)
Expand Down
90 changes: 0 additions & 90 deletions actors/builtin/power/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9f1bed0

Please sign in to comment.