Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:market:add lotus filplus cli for extend claims terms #11545

Closed
wants to merge 1 commit into from

Conversation

nicelove666
Copy link

Related Issues

resolve #10908

Proposed Changes

Add the CLI command for deal renewal

Additional Info

Name: "extend-claims-terms",
Usage: "extend claims terms",
ArgsUsage: "providerAddress Optional[...claimId]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "from",
Usage: "specify the account to send the message from, it's client address",
Required: true,
},
&cli.Int64Flag{
Name: "extension",
Usage: "try to extend selected sectors by this number of epochs, defaults to 180 days",
Value: 518400,
},
&cli.Int64Flag{
Name: "new-expiration",
Usage: "try to extend selected sectors to this epoch, ignoring extension",
},
&cli.BoolFlag{
Name: "really-do-it",
Usage: "pass this flag to really extend sectors, otherwise will only print out json representation of parameters",
},
},

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

Copy link
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! This broadly looks correct, though I have some suggested improvements.

},
&cli.BoolFlag{
Name: "really-do-it",
Usage: "pass this flag to really extend sectors, otherwise will only print out json representation of parameters",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we just fail if really-do-it isn't passed?

ArgsUsage: "providerAddress Optional[...claimId]",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "from",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd suggest making this a second mandatory parameter called clientAddress, and use that as the sender

return IncorrectNumArgs(cctx)
}

if !cctx.Bool("really-do-it") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, I'd suggest running the logic as before, but calling GasEstimateMessageGas instead of sending the message. This will simulate the message, which is useful to know whether it would pass and what it would cost, without taking any action.

See here for an example of a place we do this.

return err
}

claimIDsMap := make(map[verifreg.ClaimId]struct{}, len(args)-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lotus API already has a method called StateGetClaims, which returns all the claims for a specific provider. Can we use that, instead of decoding the state here?

@LexLuthr
Copy link
Contributor

LexLuthr commented Mar 8, 2024

@nicelove666 Please note that we have one more PR to implement claim extension. I would request you to please checkout my comment #11466 (review) on the other PR.

I would request you and @swift-mx to work together to avoid duplicating efforts and expanding the scope of the command as requested.

@LexLuthr
Copy link
Contributor

Closing this there has been no input from author. #11711 supersedes this now.

@LexLuthr LexLuthr closed this Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ☑️ Done (Archive)
Development

Successfully merging this pull request may close these issues.

Improve Lotus Tooling for Managing Sector Extension & Snap-Deals Following FIP-0045
4 participants