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

Stark: Implement Stone compatible grinding #616

Merged
merged 8 commits into from
Oct 24, 2023

Conversation

schouhy
Copy link
Contributor

@schouhy schouhy commented Oct 20, 2023

Implement Stone compatible grinding

Description

This PR implements the grinding strategy of Stone prover. That means, a nonce is valid if hash(hash(prefix || seed || grinding_factor) || nonce) has at least grinding_factor leading zeros. Where prefix is 0x0123456789abcded and seed is the state of the transcript (References: here and here)

The values of the tests were extacted from running Stone prover case 1 with the different grinding factors.

Type of change

Please delete options that are not relevant.

  • New feature

Checklist

  • Unit tests added
  • This change requires new documentation.
    • Documentation has been added/updated.

@schouhy schouhy marked this pull request as ready for review October 20, 2023 11:51
@schouhy schouhy requested review from ajgara and a team as code owners October 20, 2023 11:51
@schouhy schouhy force-pushed the stone-compatible-proof-of-work branch from 67c4085 to 5f0ac44 Compare October 20, 2023 11:55
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2023

Codecov Report

Merging #616 (db0616d) into main (f940e14) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #616   +/-   ##
=======================================
  Coverage   97.11%   97.12%           
=======================================
  Files         114      114           
  Lines       26540    26599   +59     
=======================================
+ Hits        25775    25834   +59     
  Misses        765      765           
Files Coverage Δ
provers/stark/src/grinding.rs 100.00% <100.00%> (ø)
provers/stark/src/prover.rs 99.91% <100.00%> (-0.01%) ⬇️
provers/stark/src/verifier.rs 99.38% <100.00%> (-0.01%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@schouhy schouhy added this pull request to the merge queue Oct 24, 2023
Merged via the queue into main with commit f1f1341 Oct 24, 2023
7 checks passed
@schouhy schouhy deleted the stone-compatible-proof-of-work branch October 24, 2023 14:16
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.

6 participants