-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add vc bn fallback #4648
Add vc bn fallback #4648
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.
You might be able to use Promise.any
, maybe not worth it tho :P
looks good
Looked into it and doesn't simplify the code that much since I have to track which URL completed the request successfully. Also Promise.any is available in NodeJS >= 15.0.0 and our engine is still > 12.9 |
Performance Report✔️ no performance regression detected Full benchmark results
|
Is there any sort of notification for us we can use when a fallback is triggered? |
Yes, this PRs adds metrics that will clearly show if a URL is down |
resolve(res); | ||
}, | ||
(err) => { | ||
this.urlsScore[i_] = Math.max(URL_SCORE_MIN, this.urlsScore[i_] - URL_SCORE_DELTA_ERROR); |
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.
should the score be reduced by half, so that the url will have to prove working
multiple times to come back to max
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.
Looks like currently score decreases twice as fast as score increases
Motivation
Description
A good vc bn fallback must fulfill these goals
This behaviour is not simple, so classic patterns like Promise.all() or for try catch are not enough.
The solution of this PR appears complex, but that's what's needed to achieve the goals above. Please check the inline comments for pointers on the logic.
A unit tests proves that it works, but I haven't tested yet on a deployed beacon node.
Closes #4337