filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.83k stars 1.26k forks source link

[Enhancement] UX-friendly context in `lotus-miner sectors extend`cmd #10967

Open rjan90 opened 1 year ago

rjan90 commented 1 year ago

Checklist

Lotus component

What is the motivation behind this feature request? Is your feature request related to a problem? Please describe.

When a storage provider wants to extend the lifetime of a sector/sectors they need to use the lotus-miner sectors extend command.

Currently this command will simulate which sectors will be extended, but the command does not tell the user that they would need add the --really-do-it flag to actually send the message.

Current behaviour:

lotus-miner sectors extend
Extending 1 sectors:
 {
  "Extensions": [
    {
      "Deadline": 32,
      "Partition": 0,
      "Sectors": "81853",
      "NewExpiration": 4484712
    }
  ]
}
1 sectors extended

Describe the solution you'd like

When using the lotus-miner sectors extend we should make it clear that the --really-do-it flag needs to be passed to actually send the message, and give an estimate for how much the message will cost. Example:

lotus-miner sectors extend
Simulating extending 1 sectors:
 {
  "Extensions": [
    {
      "Deadline": 32,
      "Partition": 0,
      "Sectors": "81853",
      "NewExpiration": 4484712
    }
  ]
}
Simulating extending 1 sector - estimated costs xx.xxxFIL
You need to pass the --really-do-it flag to actully send the message

User story:

Techincal scope:

beck-8 commented 1 year ago

https://github.com/filecoin-project/lotus/blob/517c0a53b15749f366f271edf6513f9253559678/cmd/lotus-miner/sectors.go#L882 https://github.com/filecoin-project/lotus/blob/517c0a53b15749f366f271edf6513f9253559678/cmd/lotus-miner/sectors.go#L1391 SectorsWithClaims Is it necessary to show it?