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

Implement parameter derivation for simple lottery. #63

Merged
merged 8 commits into from
Dec 3, 2024

Conversation

tolikzinovyev
Copy link
Member

@tolikzinovyev tolikzinovyev commented Nov 12, 2024

Content

Parameter derivation for simple lottery based on section 4.1 of the paper. Uses binary search to find the optimal value of rs.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)

Comments

Issue(s)

Copy link
Collaborator

@rrtoledo rrtoledo left a comment

Choose a reason for hiding this comment

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

Overall, the code is clean and good.
You have made an error on the dichotomic search lower bound and I think also the mu computation however. You could also process more quickly the case when the lambdas are equal.

src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Show resolved Hide resolved
src/simple_lottery/init.rs Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@curiecrypt curiecrypt left a comment

Choose a reason for hiding this comment

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

Thanks @tolikzinovyev, the algorithm seems simple and efficient. However, we should agree on some coding style.

src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
src/simple_lottery/init.rs Show resolved Hide resolved
src/simple_lottery/init.rs Outdated Show resolved Hide resolved
@rrtoledo rrtoledo linked an issue Nov 12, 2024 that may be closed by this pull request
2 tasks
@rrtoledo rrtoledo mentioned this pull request Nov 26, 2024
2 tasks
Copy link
Collaborator

@rrtoledo rrtoledo left a comment

Choose a reason for hiding this comment

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

Thanks for answering the reviews. I have commented on the opened discussions.

You adopted a very different coding style for the test, as @curiecrypt highlighted. For coherence, I would suggest to stick with one and so modify either the lottery's or the centralized lottery accordingly.

Copy link
Collaborator

@rrtoledo rrtoledo left a comment

Choose a reason for hiding this comment

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

LGTM

@tolikzinovyev tolikzinovyev force-pushed the tolik/simple-lottery-param-derivation branch from 41be680 to ed28d52 Compare December 3, 2024 14:19
Copy link
Collaborator

@curiecrypt curiecrypt left a comment

Choose a reason for hiding this comment

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

LGTM

@tolikzinovyev tolikzinovyev merged commit 0a9bb44 into main Dec 3, 2024
1 check passed
@tolikzinovyev tolikzinovyev deleted the tolik/simple-lottery-param-derivation branch December 3, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alba-rust Implement lottery scheme
4 participants