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

satellite/gracefulexit: Add graceful exit completed/failed receipt verification to satellite CLI #3679

Merged
merged 10 commits into from
Dec 3, 2019

Conversation

ethanadams
Copy link
Collaborator

@ethanadams ethanadams commented Dec 2, 2019

What:
Add graceful exit completed/failed receipt verification to satellite CLI

Why:
We want to be able to verify a completed/failed receipt if a storage node opens a ticket related to payouts for graceful exit.

Please describe the tests:

  • Test 1:
  • Test 2:

Please describe the performance impact:

Code Review Checklist (to be filled out by reviewer)

  • NEW: Are there any Satellite database migrations? Are they forwards and backwards compatible?
  • Does the PR describe what changes are being made?
  • Does the PR describe why the changes are being made?
  • Does the code follow our style guide?
  • Does the code follow our testing guide?
  • Is the PR appropriately sized? (If it could be broken into smaller PRs it should be)
  • Does the new code have enough tests? (every PR should have tests or justification otherwise. Bug-fix PRs especially)
  • Does the new code have enough documentation that answers "how do I use it?" and "what does it do?"? (both source documentation and higher level, diagrams?)
  • Does any documentation need updating?
  • Do the database access patterns make sense?

@ethanadams ethanadams marked this pull request as ready for review December 2, 2019 19:37
@ethanadams ethanadams requested a review from a team December 2, 2019 19:37
@ghost ghost removed their request for review December 2, 2019 19:37
@ethanadams ethanadams added Request Code Review Code review requested Reviewer Can Merge If all checks have passed, non-owner can merge PR labels Dec 2, 2019
@@ -98,3 +104,46 @@ func generateGracefulExitCSV(ctx context.Context, completed bool, start time.Tim
}
return err
}

func verifyGracefulExitReceipt(ctx context.Context, identity *identity.FullIdentity, receipt string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should also have an input for the requested storage node id so we can check that the receipt is actually for that storage node?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added ID checks

VinozzZ
VinozzZ previously approved these changes Dec 3, 2019
}

// Check the receipt is not empty
nodeID, err := storj.NodeIDFromString(args[0])
Copy link
Member

Choose a reason for hiding this comment

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

if the first arg is nodeID, the usage description and minimum args needs to be updated, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Updated.

VinozzZ
VinozzZ previously approved these changes Dec 3, 2019
Copy link
Contributor

@VinozzZ VinozzZ left a comment

Choose a reason for hiding this comment

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

LGTM

zap.S().Fatal(err)
}

// Check the receipt is not empty
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - the comment here is a little misleading?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed. old comment :)

Copy link
Member

@mobyvb mobyvb left a comment

Choose a reason for hiding this comment

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

works for me

@VinozzZ VinozzZ merged commit 9420fa9 into master Dec 3, 2019
@VinozzZ VinozzZ deleted the green/graceful-exit-signature-verify branch December 3, 2019 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Request Code Review Code review requested Reviewer Can Merge If all checks have passed, non-owner can merge PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants