-
Notifications
You must be signed in to change notification settings - Fork 22
(BEDS-1519) activation estimation #1592
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
base: staging
Are you sure you want to change the base?
Conversation
621bbe7 to
dd91266
Compare
dd91266 to
43e5f35
Compare
43e5f35 to
b80726b
Compare
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.
lgtm, still have minor comments left
| } | ||
|
|
||
| // fills the activation epochs for a set of validators. Tries to estimate pending validators based on current queue simulation | ||
| func (d *DataAccessService) getValidatorActivationEpochs(ctx context.Context, validators map[uint64]*uint64) 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.
nitpick (non-blocking): I'd probably do this to avoid dealing with pointers, but no strong opinion
| func (d *DataAccessService) getValidatorActivationEpochs(ctx context.Context, validators map[uint64]*uint64) error { | |
| func (d *DataAccessService) getValidatorActivationEpochs(ctx context.Context, validators []uint64) (map[uint64]uint64, 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.
I see, but I'd avoid it just to save those memory allocations
| } | ||
| queuePosition := uint64(metadata.Queues.ActivationIndex.Int64) | ||
|
|
||
| epochsToWait := (queuePosition - 1) / activationChurnRate |
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.
thought: Since we're decrementing queuePosition here, pls confirm that queuePosition can never be 0. Otherwise, should prob. use max(queuePosition, 1) - 1.
| pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator) | ||
| } | ||
|
|
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.
suggestion: Maybe an early return for when we're pre pectra?
| pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator) | |
| } | |
| pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator) | |
| } | |
| if len(pendingValidatorsPostPectra) == 0 {return nil} | |
No description provided.