fix: Estimate deal weight in sector list when upgrading
This commit is contained in:
parent
97c95a4e82
commit
ff14cd3f9d
@ -433,7 +433,7 @@ var sectorsListCmd = &cli.Command{
|
|||||||
const verifiedPowerGainMul = 9
|
const verifiedPowerGainMul = 9
|
||||||
|
|
||||||
dw, vp := .0, .0
|
dw, vp := .0, .0
|
||||||
estimate := st.Expiration-st.Activation <= 0
|
estimate := (st.Expiration-st.Activation <= 0) || sealing.IsUpgradeState(sealing.SectorState(st.State))
|
||||||
if !estimate {
|
if !estimate {
|
||||||
rdw := big.Add(st.DealWeight, st.VerifiedDealWeight)
|
rdw := big.Add(st.DealWeight, st.VerifiedDealWeight)
|
||||||
dw = float64(big.Div(rdw, big.NewInt(int64(st.Expiration-st.Activation))).Uint64())
|
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
|
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