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

Fix proof caching to speed up tests #15

Open
Arinerron opened this issue Feb 19, 2025 · 0 comments
Open

Fix proof caching to speed up tests #15

Arinerron opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Arinerron
Copy link
Member

Arinerron commented Feb 19, 2025

When I generate a proof, verify (successfully) from Solidity, and then verify again, it fail the second time for some reason.

To reproduce it, uncomment this line, and try to run the tests:

//return this.proofCache[cacheKey]; // XXX: somehow verifyProof knows if it's been verified before

Note how I'm deploying all new contracts (including the verifier contract) before each test:

beforeEach(async function() {

I also tried hardhat_reset.


Once this is fixed, I just need to

  • Uncomment this line:
    //return this.proofCache[cacheKey]; // XXX: somehow verifyProof knows if it's been verified before
  • Use a better hash function for the cache key haha
    // TODO: use a better hash function lol
    const hashCode = s => s.split('').reduce((a,b)=>{a=((a<<5)-a)+b.charCodeAt(0);return a&a},0)
@Arinerron Arinerron added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant