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

les/vflux/server: fix priority cornercase causing fuzzer timeout #22650

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

zsfelfoldi
Copy link
Contributor

This PR fixes a cornercase that caused two nodes kicking each other out of the priority pool in an infinite loop when the connection bias was very low. There was an earlier attempted fix for this case that tried to ensure that estimatePriority always returns a smaller priority than priority for the same node at the same moment. This was ensured by subtracting 1 from estimatePriority result. However, the negative balance ExpiredValue can change its exponent and lose some precision when adding the bias and in some rare cases this could create a situation when the future priority estimate still wasn't smaller than the current priority. Now the same condition is enforced directly.
A second commit simplifies a ClientPool condition when InactiveAllowance is zero. With the current design there is no need to handle this case separately and increase the risk of creating faulty cornercases in the future. This change is unrelated to the issue detected by the fuzzer, I just realized it during testing but I think it could be in this PR because it is a simple change.

Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@zsfelfoldi zsfelfoldi force-pushed the cp-fuzz-fix branch 2 times, most recently from 94fde32 to 0605a26 Compare April 14, 2021 22:36
@zsfelfoldi zsfelfoldi force-pushed the cp-fuzz-fix branch 4 times, most recently from 33da382 to 3e78d04 Compare April 15, 2021 12:09
@zsfelfoldi zsfelfoldi merged commit 65689e7 into ethereum:master Apr 16, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
…ereum#22650)

* les/vflux/server: fix estimatePriority corner case

* les/vflux/server: simplify inactiveAllowance == 0 case
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