-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
add inspect-deal
command to lotus client
#5833
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the debugging code is removed, LGTM 👍
cli/deal/showdeals.go
Outdated
color.Blue("Proposal CID: %s\n\n", di.ProposalCid.String()) | ||
|
||
for _, stg := range di.DealStages.Stages { | ||
msg := fmt.Sprintf("%s %s: %s (%s)", color.BlueString("Stage:"), color.BlueString(strings.TrimPrefix(stg.Name, "StorageDeal")), stg.Description, color.GreenString(stg.ExpectedDuration)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we'd do a fmt.Fprintf
in the cli.Context.App.Writer
, but if all other commands are writing outputs directly to stdout, then we can keep it like it is.
node/impl/client/client.go
Outdated
@@ -289,6 +292,7 @@ func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v sto | |||
Verified: v.Proposal.VerifiedDeal, | |||
TransferChannelID: v.TransferChannelID, | |||
DataTransfer: transferCh, | |||
DealStages: v.DealStages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data can be quite heavy to transfer over the wire (JSON-RPC) if it's not needed.
Since the CLI only allows to inspect a single deal, why not create an ClientDealInspect
JSON-RPC operation? It's wasteful to send over all the DealStages detail, when we know the CLI will only use a single one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How big can this get?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the deal transfer stages are unbounded (i.e. data transfer keeps crashing, and deal is restarted indefinitely), this will be unbounded. In general for successful deals (or those that have a few failures), the struct looks like the following (see attached file).
output.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is ok for a single deal, but I think that we shouldn't set this in ClientListDeals
(which we do now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am now populating the Stages and DealStages fields only when calling ClientGetDealInfo
and not on ClientListDeals
- not sure if we want omitempty
JSON tags so that they don't appear at all when making JSON RPC calls...
Noting that this is likely in critical path for work next week, so we ideally can get some eyes on it and get it into a version of lotus that a can be run at least on the testnet sooner rather than later. |
b4d4766
to
17ba23e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to take this over the finish line, but I believe it's missing commits. I know we removed the interactive menu, we renamed the command to inspect-deal
, and it takes proposal-cid
or deal-id
flags. But I see none of this in this branch.
17ba23e
to
8ba0bcb
Compare
06379b3
to
fd6d8b3
Compare
91f3bb9
to
82fb81a
Compare
@raulk this is ready for merging, once we get |
I think this is ready for review and merge - all deps have been updated given the latest @dirkmc could you confirm if we should merge this before/after the changes in the |
node/impl/client/client.go
Outdated
@@ -289,6 +292,7 @@ func (a *API) newDealInfoWithTransfer(transferCh *api.DataTransferChannel, v sto | |||
Verified: v.Proposal.VerifiedDeal, | |||
TransferChannelID: v.TransferChannelID, | |||
DataTransfer: transferCh, | |||
DealStages: v.DealStages, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How big can this get?
fc5ff8a
to
df003d4
Compare
This PR is adding a
inspect-deal
subcommand tolotus client
. Its purpose is to provide more information about a specific deal, and filter deals bydeal-id
or byproposal-cid
.At the moment the output looks like: