Skip to content

Conversation

@remoterami
Copy link
Contributor

No description provided.

@remoterami remoterami force-pushed the BEDS-1519/activation-estimation branch from 621bbe7 to dd91266 Compare May 21, 2025 15:02
@remoterami remoterami force-pushed the BEDS-1519/activation-estimation branch from dd91266 to 43e5f35 Compare May 26, 2025 14:11
@remoterami remoterami force-pushed the BEDS-1519/activation-estimation branch from 43e5f35 to b80726b Compare May 26, 2025 15:17
Copy link
Contributor

@LuccaBitfly LuccaBitfly left a 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 {
Copy link
Contributor

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

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) {

Copy link
Contributor Author

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
Copy link
Contributor

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.

Comment on lines +202 to +204
pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator)
}

Copy link
Contributor

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?

Suggested change
pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator)
}
pendingValidatorsPostPectra = append(pendingValidatorsPostPectra, validator)
}
if len(pendingValidatorsPostPectra) == 0 {return nil}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants