diff --git a/CHANGELOG.md b/CHANGELOG.md index 30186efbba3..5db5a4b1977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # Lotus changelog # UNRELEASED + +- Correct erroneous sector qap calculation upon sector extension in lotus-miner cli. ([filecoin-project/lotus#12698](https://github.com/filecoin-project/lotus/pull/12720)) + - Improve eth filter performance for nodes serving many clients. ([filecoin-project/lotus#12603](https://github.com/filecoin-project/lotus/pull/12603)) + + ## Improvements - The miner actor builtin `QAPowerForWeight` no longer accepts the unused "dealWeight" parameter, the function signature now only takes 3 arguments: sectorSize, sectorDuration, verifiedWeight. ([filecoin-project/lotus#12445](https://github.com/filecoin-project/lotus/pull/12445)) diff --git a/cmd/lotus-miner/sectors.go b/cmd/lotus-miner/sectors.go index 2ee4e9bf4a5..fa23e5f268f 100644 --- a/cmd/lotus-miner/sectors.go +++ b/cmd/lotus-miner/sectors.go @@ -220,9 +220,11 @@ var sectorsListCmd = &cli.Command{ if err != nil { return err } + powerBaseEpochs := make(map[abi.SectorNumber]abi.ChainEpoch, len(sset)) commitedIDs := make(map[abi.SectorNumber]struct{}, len(sset)) for _, info := range sset { commitedIDs[info.SectorNumber] = struct{}{} + powerBaseEpochs[info.SectorNumber] = info.PowerBaseEpoch } sort.Slice(list, func(i, j int) bool { @@ -290,7 +292,8 @@ var sectorsListCmd = &cli.Command{ estimate := (st.Expiration-st.Activation <= 0) || sealing.IsUpgradeState(sealing.SectorState(st.State)) if !estimate { rdw := big.Add(st.DealWeight, st.VerifiedDealWeight) - dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.Activation))).Uint64()) + powerBaseEpoch := powerBaseEpochs[st.SectorID] + dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-powerBaseEpoch))).Uint64()) vp = float64(big.Div(big.Mul(st.VerifiedDealWeight, big.NewInt(verifiedPowerGainMul)), big.NewInt(int64(st.Expiration-st.Activation))).Uint64()) } else { for _, piece := range st.Pieces {