-
Notifications
You must be signed in to change notification settings - Fork 995
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
Validator client builder support #10749
Changes from 1 commit
fabd6f2
0973e08
0a834ef
ffb3ef2
e4dcbc4
81a6c3f
d1fc816
ca71dc0
e2aa4b1
253c773
fb8f064
4935b1d
8340c01
288f338
e566041
5205f9b
9d29280
50b4244
bd09469
3cfa2de
449d12d
1e7785e
4961971
73cdbb4
fdd8848
1a06daa
8c9b1f6
bdc2d81
9e16452
8e59afc
14c412e
e242eb0
37193be
a4981f0
399f216
b2ef039
b47fd56
6da4f35
e54dd78
5612b2f
e5792ea
174cacb
34e6dc2
eb9ef3b
dc49906
eb37daa
8e4499d
3e1b328
108c9c8
3c9ce71
50abab8
0721273
f9b6815
bb31852
d6df7b4
2382712
57bb6e6
35c4311
0b932fe
91efa80
e005b4a
ca02322
575408d
a89317f
5f4836c
fc5abb0
e6eed94
e1b9e43
a8b9937
db80ef1
2aba632
5867cf8
a93a8d7
a37f4cb
90a5f73
0c74cdd
a3b167b
eb841aa
4372811
5cd4d6a
1aec13a
2cd333f
6d634d5
e24f6db
74f1ed3
992f89f
c41ca76
4778b7c
c3699d9
263f5ac
60e36d6
baa79b9
701e09a
98962ee
178f441
3a2326d
e971034
49c07b1
3209082
2609a21
fc1b0b6
6b2630a
64f4a57
a8d1082
7e943a5
5c570e5
321d57e
b120c33
f33dfba
eb09781
82ba338
c2ef93d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -980,18 +980,17 @@ func (v *validator) PushProposerSettings(ctx context.Context, km keymanager.IKey | |
return err | ||
} | ||
log.Infoln("Successfully prepared beacon proposer with fee recipient to validator index mapping.") | ||
failedRegistrationPubkeys := make([]string, 0) | ||
failedRegistrationCount := 0 | ||
for _, request := range registerValidatorRequests { | ||
// calls beacon API but used for custom builders | ||
if err := SubmitValidatorRegistration(ctx, v.validatorClient, v.node, km.Sign, request); err != nil { | ||
// log the error and keep going | ||
hexKey := hexutil.Encode(request.Pubkey) | ||
failedRegistrationPubkeys = append(failedRegistrationPubkeys, hexKey) | ||
log.Warnf("failed to register validator for custom builder for %s, error: %v ", hexKey, err) | ||
failedRegistrationCount++ | ||
log.Warnf("failed to register validator for custom builder for %s, error: %v ", hexutil.Encode(request.Pubkey), err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought the plan was to make all requests (so that a bad request doesn't ruin it for the rest), but at the end of the method return an error if any of the requests failed. @terencechain if some of the requests fail, should this method return an error? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to address this, lt me know if this works , unit test added |
||
} | ||
} | ||
if len(failedRegistrationPubkeys) != 0 { | ||
return errors.Errorf("Register Validator requests failed for the following publickeys: %v", failedRegistrationPubkeys) | ||
if failedRegistrationCount != 0 { | ||
return errors.Errorf("Register validator requests failed %v times out of %v requests", failedRegistrationCount, len(registerValidatorRequests)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: it's nice to use the typed string formatters (eg There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
} | ||
log.Infoln("Successfully submitted builder validator registration settings for custom builders.") | ||
return nil | ||
|
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.
Is this running in a separate goroutine or blocking an unrelated thread? If the latter, should we consider running this in the background in its own goroutine on a timer?
Should we retry failures? What is the upper bound on the number of requests we could do here - maybe we should consider adding a context deadline?
Should the entire batch fail upon any individual request failing? The one validator that is due to be proposer in the next epoch could be at the end of the list and be not updated due to a previous unimportant validator registration failing. It would be cool to order the list so that proposers come first, but failing that I think we should put some thought into retries and how to deal with partial failures. For instance we could log the individual failures at debug log level, and at the end of the batch return an error that indicates
x out of y validator registrations failed
(maybe a different error message with the pubkey if just one failed).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 it runs per epoch I have it running in its own go routine you can see that in the runner.go file line 190. otherwise it runs when status updates and on startup which are not on their on go routine.
I think those are all possible future improvements, with it being set every6.4 minutes and on startup as well I wonder if that's 100% needed at this moment. I can make a note on the tracking of this feature but I don't think it should be part of this particular PR.
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.
Are we building a prototype for integration testing, or is this something we want to be usable by end-users once this is merged? If it's a prototype then I agree that we can punt on resiliency, but I think accounting for retries and partial failures are basic requirements we need in place before this is used in production. I'll defer to @terencechain on clarifying the goal.