(BEDS-1519) activation estimation#1592
Open
remoterami wants to merge 2 commits into
Open
Conversation
621bbe7 to
dd91266
Compare
LuccaBitfly
requested changes
May 26, 2025
dd91266 to
43e5f35
Compare
43e5f35 to
b80726b
Compare
LuccaBitfly
approved these changes
May 27, 2025
LuccaBitfly
left a comment
Contributor
There was a problem hiding this comment.
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 { |
Contributor
There was a problem hiding this comment.
nitpick (non-blocking): I'd probably do this to avoid dealing with pointers, but no strong opinion
Suggested change
| 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) { |
Contributor
Author
There was a problem hiding this comment.
I see, but I'd avoid it just to save those memory allocations
| } | ||
| queuePosition := uint64(metadata.Queues.ActivationIndex.Int64) | ||
|
|
||
| epochsToWait := (queuePosition - 1) / activationChurnRate |
Contributor
There was a problem hiding this comment.
thought: Since we're decrementing queuePosition here, pls confirm that queuePosition can never be 0. Otherwise, should prob. use max(queuePosition, 1) - 1.
Comment on lines
+202
to
+204
| pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator) | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
suggestion: Maybe an early return for when we're pre pectra?
Suggested change
| pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator) | |
| } | |
| pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator) | |
| } | |
| if len(pendingValidatorsPostPectra) == 0 {return nil} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.