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

Reduce service memory requirements by not keeping randomx all the time #174

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

poszu
Copy link
Collaborator

@poszu poszu commented Jan 3, 2024

Don't keep an instance of pow verifier (randomx) all the time in the service. Instead, it is re-created on demand (which is to verify the proof after it's finished). Initialization of randomx in light mode takes about ~300ms which is a reasonable tradeoff to save ~250MiB for the rest of the epoch.

Copy link

codecov bot commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (071ea55) 93.68% compared to head (947f1d1) 93.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #174      +/-   ##
==========================================
+ Coverage   93.68%   93.73%   +0.04%     
==========================================
  Files          24       24              
  Lines        3026     3047      +21     
==========================================
+ Hits         2835     2856      +21     
  Misses        191      191              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@poszu poszu requested a review from dshulyak January 3, 2024 10:55
@pigmej pigmej self-requested a review January 3, 2024 11:30
@poszu poszu merged commit 3ef1ae5 into main Jan 3, 2024
20 checks passed
@poszu poszu deleted the dont-keep-verifier-in-service branch January 3, 2024 12:24
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