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

Rename m to threshold and n to shares #2774

Merged
merged 2 commits into from
Aug 20, 2021
Merged

Conversation

fjarri
Copy link
Contributor

@fjarri fjarri commented Aug 15, 2021

Based on top of #2773

Type of PR:

  • Documentation

Required reviews:

  • 2

What this does:
Gets rid of vague one-letter names for the threshold and the total number of kfrags.

Trying to gauge the amount of work that needs to be done.

fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 15, 2021
@fjarri fjarri force-pushed the threshold-renaming branch from 0faaa9d to 451ec9d Compare August 15, 2021 22:22
fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 15, 2021
@fjarri fjarri force-pushed the threshold-renaming branch 4 times, most recently from cdab398 to b05d103 Compare August 16, 2021 03:12
fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 19, 2021
@fjarri fjarri force-pushed the threshold-renaming branch from b05d103 to 8b37b71 Compare August 19, 2021 20:24
fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 19, 2021
@fjarri fjarri force-pushed the threshold-renaming branch from 8b37b71 to 3df6463 Compare August 19, 2021 21:08
fjarri added a commit to fjarri/nucypher that referenced this pull request Aug 19, 2021
@fjarri fjarri force-pushed the threshold-renaming branch from 3df6463 to a8ab308 Compare August 19, 2021 21:45
Copy link
Member

@KPrasch KPrasch left a comment

Choose a reason for hiding this comment

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

I like the direction we're going in here, but we can improve on the name num_kfrags. Here's some ideas we've had collectively to consider:

  • overhead
  • redundancy
  • total
  • shares

Personally, I think overhead is an excellent choice to continue the API metaphor here (it's intuitive and descriptive) but am also not opposed to keeping n.

@KPrasch KPrasch added the Naming stuff The hardest part about code authorship label Aug 19, 2021
@fjarri
Copy link
Contributor Author

fjarri commented Aug 19, 2021

See also nucypher/rust-umbral#48

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

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

Looks good - but requesting addition/update to newsfragment for a removal newsfragment.

I quite like "shares" (and I'm ok with "num_kfrags") as opposed to "overhead". Until now, we've had "n" representing the total number of kfrags, changing that to be "threshold + overhead" seems a bit heavy to me, and would be less natural for existing users. Aside from that, saving users from doing the math (albeit simple math 😄 ) I think is worth it - particularly when you think about how we tend to explain the threshold concept "m-of-n", "threshold out of a number of shares" etc.

@@ -19,11 +19,11 @@
from nucypher.cli import types


class M(PositiveInteger):
class Threshold(PositiveInteger):
Copy link
Member

@derekpierre derekpierre Aug 20, 2021

Choose a reason for hiding this comment

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

I think I'll get rid of the Threshold and NumKFrags classes in #2768. PostiveInteger is sufficient.

@@ -0,0 +1 @@
Changed the names of `m` and `n` parameters to `threshold` and `num_kfrags`.
Copy link
Member

Choose a reason for hiding this comment

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

I think either we add an additional removal newsfragment or this might need to be changed to a removal newsfragment, since we are deprecating/modifying public-facing APIs that is potentially currently used:

  1. Character control: "m" and "n" parameters can no longer be used
  2. CLI: "--m" and "--n" are no longer valid -> "-m" and "-n"
  3. Python API: no longer takes "m" and "n" as parameter.

All in favour of threshold and `num_kfrags'

@fjarri fjarri force-pushed the threshold-renaming branch from 46b9ef0 to 339feae Compare August 20, 2021 22:15
@fjarri
Copy link
Contributor Author

fjarri commented Aug 20, 2021

Alright, I think the consensus is to go with "shares". I updated the newsfragments and added a removal one. Waiting for CI to pass.

@fjarri fjarri changed the title Rename m to threshold and n to num_kfrags Rename m to threshold and n to shares Aug 20, 2021
Copy link
Member

@KPrasch KPrasch left a comment

Choose a reason for hiding this comment

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

🤠

@KPrasch KPrasch requested a review from derekpierre August 20, 2021 22:30
@fjarri fjarri force-pushed the threshold-renaming branch from 339feae to e733aae Compare August 20, 2021 22:34
@vepkenez vepkenez self-requested a review August 20, 2021 22:38
Copy link
Contributor

@vepkenez vepkenez left a comment

Choose a reason for hiding this comment

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

❤️

Copy link
Member

@derekpierre derekpierre left a comment

Choose a reason for hiding this comment

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

🎸 - minor comment - @fjarri up to you if you want to update the constant in the test.

M: int = 1
N: int = 1
THRESHOLD: int = 1
NUM_KFRAGS: int = 1
Copy link
Member

Choose a reason for hiding this comment

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

Could probably change this to "SHARES", but...only if you want to...

@fjarri fjarri force-pushed the threshold-renaming branch from e733aae to 6164137 Compare August 20, 2021 23:27
@fjarri
Copy link
Contributor Author

fjarri commented Aug 20, 2021

Changed that to SHARES.

@KPrasch KPrasch merged commit f50b743 into nucypher:main Aug 20, 2021
@fjarri fjarri deleted the threshold-renaming branch August 23, 2021 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Naming stuff The hardest part about code authorship
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants