-
-
Notifications
You must be signed in to change notification settings - Fork 38
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 vdf not calculated last iteration of assignment #254
Fix vdf not calculated last iteration of assignment #254
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent catch. @janzill , can you take a second look before we merge it?
Tests that fail are due to the lack of GitHub secrets in the contributing repo, so all good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @barisdemirdelen , good catch. I think we still need to change this slightly and move the calculation of the vdf after the convergence metric calculation to not use the updated costs. We will also want the convergence report to be updated, so my suggestion is to move the convergence check (l428 in your code) to the end of the the iteration loop, and also invert the application of the vdf and the calculation of convergence statistics. Does that make sense?
For the first suggestion, I think it makes sense to put the l428 if to the end of the loop. |
Yes, this is on purpose, I think we want the costs that were used to calculate the current all-or-nothing |
In linear_approximation.py, vdf calculation happens after convergence is checked. If an assignment is converged the function breaks out of the loop, that means no vdf calculation can be made for the last iteration of the assignment.
This pull request moves applying the vdf before convergence checking and breaking, so that the last iterations vdf can also be calculated before assignment finishes.