-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[Optimize] Clear solutions queue and worker solutions on new epoch #3266
Conversation
I think its not a big deal, but given that it's a very small additional diff, I'm weakly in favor of passing in the epoch hash to retain. A brief analysis - we're talking about:
For the solution to have epoch N + 1, at least one validator must have already advanced, and other validators may also advance before provers find the first solution. In other words, retaining the early solutions is a small extra incentive to let miners hit all validators equally with solutions. |
We only need to filter out the Ideally we could do something like:
However, the |
@raychu86 I don't see any way of doing it directly in the |
…/clear-solutions"" This reverts commit 99592f4.
…/clear-solutions"" This reverts commit 99592f4.
Motivation
This PR clears all the solutions from the solutions queue and worker ready queue when a new epoch starts. This prevents the node from being stuck on iteratively processing old solutions that are no longer relevant but is still held in memory.
Note: This is only done for validator nodes who are advancing via consensus. Syncing validators will not run this cleanup because they should not be processing incoming solutions in the first place.
An alternative approachs: