Skip to content
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

Replace validator wait for activation stream with polling #14514

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Oct 7, 2024

What type of PR is this?

Other

What does this PR do? Why is it needed?

deprecates the wait for activation event stream. This PR simplifies the checks for validator activation by polling against the status every epoch instead of receiving gRPC streams. By implementing this way we move one step closer to migrating to a full REST based validator client that can more easily connect with beacon nodes from other clients.

tested with web UI in holesky

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have made an appropriate entry to CHANGELOG.md.
  • I have added a description to this PR with sufficient context for reviewers to understand this PR.

@james-prysm james-prysm added the Cleanup Code health! label Oct 7, 2024
@james-prysm james-prysm requested a review from a team as a code owner October 7, 2024 15:56
@james-prysm james-prysm added the API Api related tasks label Oct 7, 2024
@james-prysm james-prysm changed the title Remove validator wait activation Replace validator wait for activation stream with polling Oct 7, 2024
@james-prysm james-prysm marked this pull request as draft October 7, 2024 15:58
@@ -341,46 +327,6 @@ func TestCanonicalHeadSlot_OK(t *testing.T) {
assert.Equal(t, primitives.Slot(0), headSlot, "Mismatch slots")
}

func TestWaitMultipleActivation_LogsActivationEpochOK(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate test no longer needed, covered in activation_test


func (v *validator) handleReconnection(ctx context.Context, span octrace.Span, err error, message string, accountsChangedChan <-chan [][fieldparams.BLSPubkeyLength]byte) error {
tracing.AnnotateError(span, err)
attempts := streamAttempts(ctx)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should i rename this streamAttempts variable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block is small enough that I don't think it matters too much. It should be very clear what it is

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 guess it's not really a stream

@james-prysm james-prysm marked this pull request as ready for review October 7, 2024 16:11
@james-prysm james-prysm added the Ready For Review A pull request ready for code review label Oct 7, 2024
CHANGELOG.md Outdated Show resolved Hide resolved

func (v *validator) handleReconnection(ctx context.Context, span octrace.Span, err error, message string, accountsChangedChan <-chan [][fieldparams.BLSPubkeyLength]byte) error {
tracing.AnnotateError(span, err)
attempts := streamAttempts(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code block is small enough that I don't think it matters too much. It should be very clear what it is

}

someAreActive = v.checkAndLogValidatorStatus(valCount)
func (v *validator) waitForAccountsChange(ctx context.Context, accountsChangedChan <-chan [][fieldparams.BLSPubkeyLength]byte) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have some of these unexported functions with comments and others not. Should we just add comments to the rest of them?

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 don't think comments are required on unexported, it's probably fine to keep whatever we have.

validator/client/wait_for_activation.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Cleanup Code health! Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants