Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- fix(spcli): send SettleDealPayments msg to f05 for `lotus-miner actor settle-deal` ([filecoin-project/lotus#13142](https://github.com/filecoin-project/lotus/pull/13142))
- feat: ExpectedRewardForPower builtin utility function and `lotus-shed miner expected-reward` CLI command ([filecoin-project/lotus#13138](https://github.com/filecoin-project/lotus/pull/13138))
- feat(gateway): add CORS headers if --cors is provided ([filecoin-project/lotus#13145](https://github.com/filecoin-project/lotus/pull/13145))
- feat(spcli): make settle-deal optionally take deal id ranges ([filecoin-project/lotus#13146](https://github.com/filecoin-project/lotus/pull/13146))

# Node v1.33.0 / 2025-05-08
The Lotus v1.33.0 release introduces experimental v2 APIs with F3 awareness, featuring a new TipSet selection mechanism that significantly enhances how applications interact with the Filecoin blockchain. This release candidate also adds F3-aware Ethereum APIs via the /v2 endpoint. All of the /v2 APIs implement intelligent fallback mechanisms between F3 and Expected Consensus and are exposed through the Lotus Gateway.
Expand Down
41 changes: 35 additions & 6 deletions cli/spcli/actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"strconv"
"strings"

"github.com/docker/go-units"
cbor "github.com/ipfs/go-ipld-cbor"
Expand Down Expand Up @@ -39,7 +40,7 @@ import (
func ActorDealSettlementCmd(getActor ActorAddressGetter) *cli.Command {
return &cli.Command{
Name: "settle-deal",
Usage: "Settle deals manually, if dealIds are not provided all deals will be settled",
Usage: "Settle deals manually, if dealIds are not provided all deals will be settled. Deal IDs can be specified as individual numbers or ranges (e.g., '123 124 125-200 220')",
ArgsUsage: "[...dealIds]",
Flags: []cli.Flag{
&cli.IntFlag{
Expand Down Expand Up @@ -70,12 +71,40 @@ func ActorDealSettlementCmd(getActor ActorAddressGetter) *cli.Command {
// if no deal ids are provided, get all the deals for the miner
if dealsIdArgs := cctx.Args().Slice(); len(dealsIdArgs) != 0 {
for _, d := range dealsIdArgs {
dealId, err = strconv.ParseUint(d, 10, 64)
if err != nil {
return xerrors.Errorf("Error parsing deal id: %w", err)
// Check if it's a range (e.g., "125-200")
if strings.Contains(d, "-") {
parts := strings.Split(d, "-")
if len(parts) != 2 {
return xerrors.Errorf("Invalid range format: %s (expected format: start-end)", d)
}

start, err := strconv.ParseUint(strings.TrimSpace(parts[0]), 10, 64)
if err != nil {
return xerrors.Errorf("Error parsing start of range %s: %w", d, err)
}

end, err := strconv.ParseUint(strings.TrimSpace(parts[1]), 10, 64)
if err != nil {
return xerrors.Errorf("Error parsing end of range %s: %w", d, err)
}

if start > end {
return xerrors.Errorf("Invalid range %s: start must be less than or equal to end", d)
}

// Add all deal IDs in the range (inclusive)
for id := start; id <= end; id++ {
dealIDs = append(dealIDs, id)
}
} else {
// Parse as a single deal ID
dealId, err = strconv.ParseUint(d, 10, 64)
if err != nil {
return xerrors.Errorf("Error parsing deal id: %w", err)
}

dealIDs = append(dealIDs, dealId)
}

dealIDs = append(dealIDs, dealId)
}
} else {
if dealIDs, err = GetMinerAllDeals(ctx, api, maddr, types.EmptyTSK); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions documentation/en/cli-lotus-miner.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading