-
Notifications
You must be signed in to change notification settings - Fork 239
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
VC: Use scoring function to select best attestation data when using multiple BNs. #5101
Conversation
var resultReady = false | ||
let onlineNodes = | ||
try: | ||
if iterations == 0: |
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.
what's the idea with multiple iterations?
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.
We have a period of time which is regulated by timeFut
value, so if we not received any successful responses in one iteration we are trying to request again with same/new set of BNs until timeFut
will not expire.
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.
ok
3e1f5e7
to
a2789bd
Compare
a2789bd
to
50dfd8a
Compare
This needs to merge from
|
BestNodeResponse.init(node, handlerResponse, score)) | ||
if perfectScore(score): | ||
perfectScoreFound = true | ||
break |
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.
break | |
break mainLoop |
?
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.
There some cleanup should be done in inner loop before exiting to mainLoop.
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.
break innerLoop
then?
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.
there is no innerLoop.
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.
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.
Sorry, yep there is, but as i said there should be some cleanup made right after pendingRequests
loop, so it breaks out of pendingRequests
loop and after cleanup it breaks to innerLoop
.
62854b4
to
f3fa417
Compare
if not(future.finished()): | ||
pendingCancel.add(future.cancelAndWait()) | ||
# Awaiting cancellations. | ||
await allFutures(pendingCancel) |
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.
when calling cancelAndWait, is it possible that some of these futures are completed instead of cancelled?
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.
Its only possible to get into this situation
So in this case:
<future not finished> -> <future not finished> -> <future finished>
result future
will be finished, not cancelled, but it sill requires number of async steps to get into this.
And in this case
<future not finished> -> <future not finished> -> <future cancelled>
result future
will be cancelled, but only if some of the intermediate futures will not decide to swallow cancellation or replace it with an error.
Fix registerBlock post-rebase issues.
Add tests for getAttestationDataScore().
With this PR our validator client (VC) will be able to select the best scored attestation data when using configurations with multiple beacon nodes.
To achieve maximum performance you should enable VC's block monitoring feature using
--block-monitor-type=poll
(polling BN's for latest head 3 times per slot) or--block-monitor-type=event
(using BN's/eth/v1/events
interface).When block monitoring is enabled - VC will be able to obtain "perfect" score and continue attesting without waiting for responses from all the beacon nodes. Without this feature VC will wait for all BN responses and selects the best response using scoring algorithm.
"perfect score" - is score when
attestation data slot equal to block's slot
andtarget epoch = source epoch + 1
.