Merge pull request #10555 from filecoin-project/asr/fix-extend-sectors-backport

backport: fix: miner: correctly count sector extensions
This commit is contained in:
Aayush Rajasekaran 2023-03-28 09:40:42 -04:00 committed by GitHub
commit 0b018e56cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1160,8 +1160,9 @@ var sectorsExtendCmd = &cli.Command{
} }
sectorsInDecl := int(sectorsWithoutClaimsCount) + len(sectorsWithClaims) sectorsInDecl := int(sectorsWithoutClaimsCount) + len(sectorsWithClaims)
scount += sectorsInDecl
if scount+sectorsInDecl > addrSectors || len(p.Extensions) >= declMax { if scount > addrSectors || len(p.Extensions) >= declMax {
params = append(params, p) params = append(params, p)
p = miner.ExtendSectorExpiration2Params{} p = miner.ExtendSectorExpiration2Params{}
scount = sectorsInDecl scount = sectorsInDecl
@ -1230,7 +1231,7 @@ var sectorsExtendCmd = &cli.Command{
smsg, err := fullApi.MpoolPushMessage(ctx, &types.Message{ smsg, err := fullApi.MpoolPushMessage(ctx, &types.Message{
From: mi.Worker, From: mi.Worker,
To: maddr, To: maddr,
Method: builtin.MethodsMiner.ExtendSectorExpiration, Method: builtin.MethodsMiner.ExtendSectorExpiration2,
Value: big.Zero(), Value: big.Zero(),
Params: sp, Params: sp,
}, spec) }, spec)