Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions cmd/lotus-shed/miner-fees.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ var minerFeesCmd = &cli.Command{
_, _ = fmt.Fprintf(cctx.App.Writer, "Deadline %d:\n", dlIdx)

totalSectorsFee := big.NewInt(0)
totalProvenSectorsFee := big.NewInt(0)
totalFeeDeduction := big.NewInt(0)

// Epoch at which sectors that are within this deadline would have last been proven, so we
// can look for new sectors that have (probably) not been proven yet
dlLastProvenEpoch := dlinfo.PeriodStart + abi.ChainEpoch(dlIdx+1)*dlinfo.WPoStChallengeWindow
if dlLastProvenEpoch > dlinfo.CurrentEpoch {
dlLastProvenEpoch -= dlinfo.WPoStProvingPeriod
}

/** Iterate over partitions **/

partitions, err := dl.PartitionsArray(adtStore)
Expand Down Expand Up @@ -135,6 +143,9 @@ var minerFeesCmd = &cli.Command{
_, _ = fmt.Fprintf(cctx.App.Writer, "%s\n", soci16.DailyFee)
}
totalSectorsFee = big.Add(totalSectorsFee, soci16.DailyFee)
if soci16.Activation < dlLastProvenEpoch {
totalProvenSectorsFee = big.Add(totalProvenSectorsFee, soci16.DailyFee)
} // else the sector is too new, hasn't been proven and won't have paid a fee yet
} else {
_, _ = fmt.Fprintf(cctx.App.Writer, "<legacy, not migrated>\n")
}
Expand Down Expand Up @@ -170,7 +181,7 @@ var minerFeesCmd = &cli.Command{
correct = "✗"
discrepancies = true
}
_, _ = fmt.Fprintf(cctx.App.Writer, "\t%s Deadline daily fee: %s, power: %s (sector fee sum: %s, expiration fee deduction sum: %s)\n", correct, dl.DailyFee, dl.LivePower.QA, totalSectorsFee, totalFeeDeduction)
_, _ = fmt.Fprintf(cctx.App.Writer, "\t%s Deadline daily fee: %s, power: %s (proven sector fee sum: %s, total sector fee sum: %s, expiration fee deduction sum: %s)\n", correct, dl.DailyFee, dl.LivePower.QA, totalProvenSectorsFee, totalSectorsFee, totalFeeDeduction)

if !dl.DailyFee.IsZero() {

Expand Down Expand Up @@ -261,7 +272,7 @@ var minerFeesCmd = &cli.Command{
}
}

expectedFee := dl.DailyFee
expectedFee := totalProvenSectorsFee

rewardPercent := "<cron call not found>"
feeCapDesc := "fee not capped"
Expand Down