-
Notifications
You must be signed in to change notification settings - Fork 16
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
Naming of property and variable parts
and part
is possibly misleading
#31
Comments
Totally agree with the comments here @iancoleman 👍 I haven't been at this one for a while, but seems at minimum this can be made clearer, could be more things. I can have a look later and see what I find. |
I did some experimental variable renaming and found that the heart of my confusion is captured in the last part of this line: A To me this is lacking a necessary chronology in the naming. Perhaps duplicating ProposalState type into something like AckedState or JustifiedState or FinalState or CommitmentState, not sure but the
It seems as a general point this is code for managing commitments-with-metadata. The Hope this clarifies a bit further where my confusion comes from when reading the source. I think I am still a little confused but am making progress on understanding. Also in 18a4ff0 there is a comment "Aligns with original paper"; is that original paper linked in the readme? I'm not sure what this is referring to but it would be helpful to know so I can appreciate what in the variables is domain language (so fairly fixed) and what is open to negotiation. edit: I am making suggestions about changes here but they are not coming from a place of full understanding so are not 'real suggestions', just trying to capture my misunderstanding in a tangible way. If you feel these suggestions are misplaced I would accept that decision of course! For example I just realised I made an incorrect assumption that |
See Still not sure if it's 100% there, some variables are maybe too long.
|
The property
KeyGen.parts
(code below) is misleading and may benefit from being renamedproposal_states
since the type being used isProposalState
.https://github.com/maidsafe/BLS-DKG/blob/988d9f0c3362d57cfd5bc807a1aad37252e03eb6/src/key_gen/mod.rs#L306-L307
There's a struct
Part
(code below) which seems likeKeyGen.parts
would be, but it's not, it's a set ofProposalState
https://github.com/maidsafe/BLS-DKG/blob/988d9f0c3362d57cfd5bc807a1aad37252e03eb6/src/key_gen/mod.rs#L73-L84
KeyGen.parts
is used ingenerate_keys
(code below) to get a variable calledpart
which is aProposalState
and not aPart
. That's very confusing to me!https://github.com/maidsafe/BLS-DKG/blob/988d9f0c3362d57cfd5bc807a1aad37252e03eb6/src/key_gen/mod.rs#L876-L880
It's especially confusing since
Part
andProposalState
both have the propertycommitment
so could easily be using the wrong commitment without knowing it. Is it worth changing those properties toPart.our_commitment
andProposalState.proposed_commitment
so they cannot be accidentally used interchangeably?The text was updated successfully, but these errors were encountered: