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

fix: Inconsistent Docs for Downloading ZKP Params #6464

Merged
merged 4 commits into from
Apr 7, 2023

Conversation

upbqdn
Copy link
Member

@upbqdn upbqdn commented Apr 5, 2023

Motivation

Close #6340.

Solution

This PR:

  • adjusts the implementation so that PARAMETER_DOWNLOAD_MAX_RETRIES is regarded as the max number of retries instead of attempts;
  • removes the prefix retry_ from functions that download the parameters;
  • cleans up the docs a bit.

Reviewer Checklist

  • Will the PR name make sense to users?
    • Does it need extra CHANGELOG info? (new features, breaking changes, large changes)
  • Are the PR labels correct?
  • Does the code do what the ticket and PR says?
    • Does it change concurrent code, unsafe code, or consensus rules?
  • How do you know it works? Does it have tests?

upbqdn added 2 commits April 5, 2023 14:24
This commit also removes the prefix `retry_` from the function names
that download the parameters. The reason for removing it was that I
consider the retries implicit, and the primary objective of the
functions is to download the params, not retry to download them.
@upbqdn upbqdn requested a review from a team as a code owner April 5, 2023 12:43
@upbqdn upbqdn requested review from teor2345 and removed request for a team April 5, 2023 12:43
@github-actions github-actions bot added the C-bug Category: This is a bug label Apr 5, 2023
@upbqdn upbqdn added A-docs Area: Documentation P-Medium ⚡ C-audit Category: Issues arising from audit findings labels Apr 5, 2023
@upbqdn upbqdn self-assigned this Apr 5, 2023
@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #6464 (f2f4a53) into main (83eb845) will increase coverage by 0.13%.
The diff coverage is 50.00%.

❗ Current head f2f4a53 differs from pull request most recent head 4208704. Consider uploading reports for the commit 4208704 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6464      +/-   ##
==========================================
+ Coverage   77.75%   77.89%   +0.13%     
==========================================
  Files         304      304              
  Lines       39681    39678       -3     
==========================================
+ Hits        30855    30906      +51     
+ Misses       8826     8772      -54     

arya2
arya2 previously approved these changes Apr 5, 2023
Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

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

This looks great, thank you!

I may remember us saying we want to keep these as *_RETRIES and update the code to make retries + 1 attempts for fixes to this finding (e.g. PR #6460), but I'm not sure and that's not a blocker in any case.

zebra-consensus/src/primitives/groth16/params.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/groth16/params.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/groth16/params.rs Outdated Show resolved Hide resolved
zebra-consensus/src/primitives/groth16/params.rs Outdated Show resolved Hide resolved
@upbqdn
Copy link
Member Author

upbqdn commented Apr 6, 2023

I may remember us saying we want to keep these as *_RETRIES and update the code to make retries + 1 attempts for fixes to this finding (e.g. PR #6460)

Thanks for pointing that out, I wasn't aware of that. I switched back to retries, adjusted the code, and edited the PR description.

Copy link
Contributor

@arya2 arya2 left a comment

Choose a reason for hiding this comment

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

Thank you for making the change to retries!

mergify bot added a commit that referenced this pull request Apr 7, 2023
@mergify mergify bot merged commit 044ecb0 into main Apr 7, 2023
@mergify mergify bot deleted the fix-param-download-retries branch April 7, 2023 22:26
@mpguerra mpguerra mentioned this pull request Apr 11, 2023
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation C-audit Category: Issues arising from audit findings C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NCC-E005955-WVM] zebra-consensus: Off-by-One Errors and Inconsistent Usage of PARAMETER_DOWNLOAD_MAX_RETRIES
2 participants