Skip to content

Commit

Permalink
Merge pull request #9941 from beck-8/feat/add_renew_max_sectors
Browse files Browse the repository at this point in the history
add renew max-sectors flag
  • Loading branch information
magik6k authored Jan 4, 2023
2 parents d857057 + f3b5c76 commit 273184b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,10 @@ var sectorsRenewCmd = &cli.Command{
Usage: "use up to this amount of FIL for one message. pass this flag to avoid message congestion.",
Value: "0",
},
&cli.Int64Flag{
Name: "max-sectors",
Usage: "the maximum number of sectors contained in each message message",
},
&cli.BoolFlag{
Name: "really-do-it",
Usage: "pass this flag to really renew sectors, otherwise will only print out json representation of parameters",
Expand Down Expand Up @@ -1020,10 +1024,20 @@ var sectorsRenewCmd = &cli.Command{
for l, exts := range extensions {
for newExp, numbers := range exts {
scount += len(numbers)
addrSectors, err := policy.GetAddressedSectorsMax(nv)
var addrSectors int
sectorsMax, err := policy.GetAddressedSectorsMax(nv)
if err != nil {
return err
}
if cctx.Int("max-sectors") == 0 {
addrSectors = sectorsMax
} else {
addrSectors = cctx.Int("max-sectors")
if addrSectors > sectorsMax {
return xerrors.Errorf("the specified max-sectors exceeds the maximum limit")
}
}

declMax, err := policy.GetDeclarationsMax(nv)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions documentation/en/cli-lotus-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -1897,6 +1897,7 @@ OPTIONS:
--extension value try to extend selected sectors by this number of epochs, defaults to 540 days (default: 1555200)
--from value only consider sectors whose current expiration epoch is in the range of [from, to], <from> defaults to: now + 120 (1 hour) (default: 0)
--max-fee value use up to this amount of FIL for one message. pass this flag to avoid message congestion. (default: "0")
--max-sectors value the maximum number of sectors contained in each message message (default: 0)
--new-expiration value try to extend selected sectors to this epoch, ignoring extension (default: 0)
--only-cc only extend CC sectors (useful for making sector ready for snap upgrade) (default: false)
--really-do-it pass this flag to really renew sectors, otherwise will only print out json representation of parameters (default: false)
Expand Down

0 comments on commit 273184b

Please sign in to comment.