Merge pull request #8336 from filecoin-project/fix/snap-list-estimate
fix: miner cli: Estimate deal weight in sector list when upgrading
This commit is contained in:
commit
b26405226e
@ -433,7 +433,7 @@ var sectorsListCmd = &cli.Command{
|
||||
const verifiedPowerGainMul = 9
|
||||
|
||||
dw, vp := .0, .0
|
||||
estimate := st.Expiration-st.Activation <= 0
|
||||
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())
|
||||
|
22
extern/storage-sealing/sector_state.go
vendored
22
extern/storage-sealing/sector_state.go
vendored
@ -169,3 +169,25 @@ func toStatState(st SectorState, finEarly bool) statSectorState {
|
||||
|
||||
return sstFailed
|
||||
}
|
||||
|
||||
func IsUpgradeState(st SectorState) bool {
|
||||
switch st {
|
||||
case SnapDealsWaitDeals,
|
||||
SnapDealsAddPiece,
|
||||
SnapDealsPacking,
|
||||
UpdateReplica,
|
||||
ProveReplicaUpdate,
|
||||
SubmitReplicaUpdate,
|
||||
|
||||
SnapDealsAddPieceFailed,
|
||||
SnapDealsDealsExpired,
|
||||
SnapDealsRecoverDealIDs,
|
||||
AbortUpgrade,
|
||||
ReplicaUpdateFailed,
|
||||
ReleaseSectorKeyFailed,
|
||||
FinalizeReplicaUpdateFailed:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user