v1.27.0-a #10
@ -141,8 +141,8 @@ func SectorsStatusCmd(getActorAddress ActorAddressGetter, getOnDiskInfo OnDiskIn
|
|||||||
}
|
}
|
||||||
fmt.Printf("\nSector On Chain Info\n")
|
fmt.Printf("\nSector On Chain Info\n")
|
||||||
fmt.Printf("SealProof:\t\t%x\n", status.SealProof)
|
fmt.Printf("SealProof:\t\t%x\n", status.SealProof)
|
||||||
fmt.Printf("Activation:\t\t%v\n", status.Activation)
|
fmt.Printf("Activation:\t\t%v\n", cliutil.EpochTime(head.Height(), status.Activation))
|
||||||
fmt.Printf("Expiration:\t\t%v\n", status.Expiration)
|
fmt.Printf("Expiration:\t\t%s\n", cliutil.EpochTime(head.Height(), status.Expiration))
|
||||||
fmt.Printf("DealWeight:\t\t%v\n", status.DealWeight)
|
fmt.Printf("DealWeight:\t\t%v\n", status.DealWeight)
|
||||||
fmt.Printf("VerifiedDealWeight:\t\t%v\n", status.VerifiedDealWeight)
|
fmt.Printf("VerifiedDealWeight:\t\t%v\n", status.VerifiedDealWeight)
|
||||||
fmt.Printf("InitialPledge:\t\t%v\n", types.FIL(status.InitialPledge))
|
fmt.Printf("InitialPledge:\t\t%v\n", types.FIL(status.InitialPledge))
|
||||||
@ -853,6 +853,7 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
|
|||||||
for l, exts := range extensions {
|
for l, exts := range extensions {
|
||||||
for newExp, numbers := range exts {
|
for newExp, numbers := range exts {
|
||||||
sectorsWithoutClaimsToExtend := bitfield.New()
|
sectorsWithoutClaimsToExtend := bitfield.New()
|
||||||
|
numbersToExtend := make([]abi.SectorNumber, 0, len(numbers))
|
||||||
var sectorsWithClaims []miner.SectorClaim
|
var sectorsWithClaims []miner.SectorClaim
|
||||||
for _, sectorNumber := range numbers {
|
for _, sectorNumber := range numbers {
|
||||||
claimIdsToMaintain := make([]verifreg.ClaimId, 0)
|
claimIdsToMaintain := make([]verifreg.ClaimId, 0)
|
||||||
@ -862,6 +863,7 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
|
|||||||
// Nothing to check, add to ccSectors
|
// Nothing to check, add to ccSectors
|
||||||
if !ok {
|
if !ok {
|
||||||
sectorsWithoutClaimsToExtend.Set(uint64(sectorNumber))
|
sectorsWithoutClaimsToExtend.Set(uint64(sectorNumber))
|
||||||
|
numbersToExtend = append(numbersToExtend, sectorNumber)
|
||||||
} else {
|
} else {
|
||||||
for _, claimId := range claimIds {
|
for _, claimId := range claimIds {
|
||||||
claim, ok := claimsMap[claimId]
|
claim, ok := claimsMap[claimId]
|
||||||
@ -882,13 +884,15 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
|
|||||||
currEpoch <= (claim.TermStart+claim.TermMin) ||
|
currEpoch <= (claim.TermStart+claim.TermMin) ||
|
||||||
// FIP-0045 requires the sector to be in its last 30 days of life
|
// FIP-0045 requires the sector to be in its last 30 days of life
|
||||||
(currEpoch <= sectorInfo.Expiration-builtin.EndOfLifeClaimDropPeriod) {
|
(currEpoch <= sectorInfo.Expiration-builtin.EndOfLifeClaimDropPeriod) {
|
||||||
fmt.Printf("skipping sector %d because claim %d does not live long enough \n", sectorNumber, claimId)
|
fmt.Printf("skipping sector %d because claim %d (client f0%s, piece %s) does not live long enough \n", sectorNumber, claimId, claim.Client, claim.Data)
|
||||||
cannotExtendSector = true
|
cannotExtendSector = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
claimIdsToDrop = append(claimIdsToDrop, claimId)
|
claimIdsToDrop = append(claimIdsToDrop, claimId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
numbersToExtend = append(numbersToExtend, sectorNumber)
|
||||||
}
|
}
|
||||||
if cannotExtendSector {
|
if cannotExtendSector {
|
||||||
continue
|
continue
|
||||||
@ -921,7 +925,7 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
|
|||||||
p.Extensions = append(p.Extensions, miner.ExpirationExtension2{
|
p.Extensions = append(p.Extensions, miner.ExpirationExtension2{
|
||||||
Deadline: l.Deadline,
|
Deadline: l.Deadline,
|
||||||
Partition: l.Partition,
|
Partition: l.Partition,
|
||||||
Sectors: SectorNumsToBitfield(numbers),
|
Sectors: SectorNumsToBitfield(numbersToExtend),
|
||||||
SectorsWithClaims: sectorsWithClaims,
|
SectorsWithClaims: sectorsWithClaims,
|
||||||
NewExpiration: newExp,
|
NewExpiration: newExp,
|
||||||
})
|
})
|
||||||
@ -958,6 +962,19 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
|
|||||||
fmt.Printf("Extending %d sectors: ", scount)
|
fmt.Printf("Extending %d sectors: ", scount)
|
||||||
stotal += scount
|
stotal += scount
|
||||||
|
|
||||||
|
sp, aerr := actors.SerializeParams(¶ms[i])
|
||||||
|
if aerr != nil {
|
||||||
|
return xerrors.Errorf("serializing params: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
m := &types.Message{
|
||||||
|
From: mi.Worker,
|
||||||
|
To: maddr,
|
||||||
|
Method: builtin.MethodsMiner.ExtendSectorExpiration2,
|
||||||
|
Value: big.Zero(),
|
||||||
|
Params: sp,
|
||||||
|
}
|
||||||
|
|
||||||
if !cctx.Bool("really-do-it") {
|
if !cctx.Bool("really-do-it") {
|
||||||
pp, err := NewPseudoExtendParams(¶ms[i])
|
pp, err := NewPseudoExtendParams(¶ms[i])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -970,21 +987,16 @@ func SectorsExtendCmd(getActorAddress ActorAddressGetter) *cli.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("\n", string(data))
|
fmt.Println("\n", string(data))
|
||||||
|
|
||||||
|
_, err = fullApi.GasEstimateMessageGas(ctx, m, spec, types.EmptyTSK)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("simulating message execution: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
sp, aerr := actors.SerializeParams(¶ms[i])
|
smsg, err := fullApi.MpoolPushMessage(ctx, m, spec)
|
||||||
if aerr != nil {
|
|
||||||
return xerrors.Errorf("serializing params: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
smsg, err := fullApi.MpoolPushMessage(ctx, &types.Message{
|
|
||||||
From: mi.Worker,
|
|
||||||
To: maddr,
|
|
||||||
Method: builtin.MethodsMiner.ExtendSectorExpiration2,
|
|
||||||
Value: big.Zero(),
|
|
||||||
Params: sp,
|
|
||||||
}, spec)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("mpool push message: %w", err)
|
return xerrors.Errorf("mpool push message: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user