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) #17

Closed

Conversation

VagabondBushido
Copy link

Improve Test Performance with Proof Caching

This PR fixes issue #15 by adding a caching system for zero-knowledge proofs, significantly speeding up test execution.

🔧 What’s Changed?
• Introduced a ProofCache class to handle proof caching
• Integrated caching into the Node class
• Implemented automatic cache key generation based on proof inputs
• Ensured persistent caching across test runs
• Added a way to clear the cache when needed

🛠 New Features

✅ Auto-generates cache keys based on input parameters
✅ Stores proofs for faster reuse in future tests
✅ Supports clearing the cache when necessary
✅ Uses thread-safe file operations

✅ Testing & Results

Added unit tests to verify:
• Cache key consistency
• Proof storage & retrieval
• Proper handling of cache misses
• Cache clearing functionality

Performance Impact

The caching system improves test performance by:

  • Avoiding redundant proof generation
  • Persisting proofs between test runs
  • Using efficient cache key generation

Additional Notes

  • Cache is stored in a cache directory
  • Cache keys are generated using SHA-256 hashing
  • Cache can be cleared manually if needed

All tests pass successfully and show major performance gains for repeated operations

- Add ProofCache class for managing proof caches
- Integrate caching in Node class operations
- Add unit tests for cache functionality
- Cache proofs based on input parameters
- Add automatic cache key generation
@Arinerron
Copy link
Member

Thank you! Will review these PRs tomorrow morning.

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.

2 participants