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

Retry logic when "wheel" is not good enough #2

Merged
17 commits merged into from
Sep 18, 2024
Merged

Retry logic when "wheel" is not good enough #2

17 commits merged into from
Sep 18, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jun 15, 2024

This PR implements retry logic as explained in the "Fixing Bad Wheels" slide:

  • If no proof is found, we retry up to λ times
  • If number of hashes is greater than some bound, we retry

Retry based on number of hashes works fine for "small" honest set, eg. <= λ². There's a property demonstrating empirically the mean number of retries is close to the theoretical bound (2). But it does not yield the expected number in the large set case (> λ³): The average number of retries is still high, even though the upper limit in the number of hashes is increased.

@ghost ghost requested a review from curiecrypt June 15, 2024 21:37
@ghost ghost force-pushed the retry-logic branch from 27de6d0 to 0d2a15f Compare June 25, 2024 07:22
@curiecrypt curiecrypt mentioned this pull request Jun 26, 2024
@ghost ghost force-pushed the retry-logic branch from 0d2a15f to 157341b Compare July 8, 2024 08:44
* Also add manual serialisation of Proof + roundtrip test as it cannot
be automatically derived anymore
* Write a test that crashes because proof cannot be generated
* Add a retryCount field for the Proof to implement the logic
Property is a bit long to run as it now needs to repeat the whole
proving process several times for a small set.
Even without benchmark, it's obvious from running tests State monad
will be unbearably slow
This completely ditch ST or State monad based computation which are
way too expensive.
Note the test case does not actually matches the expected theoretical
values. The average and max number of proof run should be 1 when n_p
is greater than λ³ but it's not the case.
Also improve readability of benchmarks' label
@ghost ghost force-pushed the retry-logic branch from ebfa270 to c9240f2 Compare September 13, 2024 07:11
@ghost ghost merged commit c9240f2 into main Sep 18, 2024
4 checks passed
@ghost ghost deleted the retry-logic branch September 18, 2024 11:05
This pull request was closed.
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.

1 participant