Skip to content

Commit

Permalink
fix(miner): fix scary verified power miscalculation upon extension (f…
Browse files Browse the repository at this point in the history
…ilecoin-project#12720)

* Fix scary verified power calculation

* Update changelog

---------

Co-authored-by: zenground0 <[email protected]>
  • Loading branch information
2 people authored and virajbhartiya committed Nov 28, 2024
1 parent 15810ba commit 332bce5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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))
Expand Down
5 changes: 4 additions & 1 deletion cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 332bce5

Please sign in to comment.