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 receive slot with event stream #13563

Merged
merged 107 commits into from Mar 13, 2024
Merged

replace receive slot with event stream #13563

merged 107 commits into from Mar 13, 2024

Conversation

james-prysm
Copy link
Contributor

@james-prysm james-prysm commented Jan 31, 2024

What type of PR is this?

Feature

What does this PR do? Why is it needed?

/eth/v1/events

Removes the receive slot function and replaces it with an event stream.

  • The gRPC implementation of the event stream still uses the stream slot endpoint but wraps it as a head event. this is a TODO item to fix in the following PR to potentially introduce a temporary event endpoint for gRPC.
  • introduces a basic health checker to properly restart the event stream if disconnected.

this is a big change

@james-prysm james-prysm changed the title Remove stream slot replace stream slot with event stream Jan 31, 2024
var eventType, data string // Variables to store event type and data

// Iterate over lines of the event stream
for scanner.Scan() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

is a span enough...

@james-prysm james-prysm changed the title replace stream slot with event stream replace receive slot with event stream Feb 7, 2024
Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

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

Please fix the TODOs in this PR, delete the TODOs, or create associated issues to track them.

validator/client/beacon-api/beacon_api_validator_client.go Outdated Show resolved Hide resolved
@@ -45,6 +49,29 @@ type Server struct {
BeaconMonitoringPort int
}

// GetHealth checks the health of the node
func (ns *Server) GetHealth(ctx context.Context, request *ethpb.HealthRequest) (*empty.Empty, error) {
_, span := trace.StartSpan(ctx, "node.GetHealth")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
_, span := trace.StartSpan(ctx, "node.GetHealth")
ctx, span := trace.StartSpan(ctx, "node.GetHealth")

If you don't overwrite the context, then the span details are not carried forward to other requests.

Copy link
Member

Choose a reason for hiding this comment

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

Also, should you set some deadline, perhaps the server should respond within 10 seconds or give up waiting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a deadline in the function if that's what you're suggesting, i don't think other similar functions have deadlines though, it might default to something for grpc. more tests were added though.

Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
@james-prysm james-prysm added this pull request to the merge queue Mar 13, 2024
Merged via the queue into develop with commit d6ae838 Mar 13, 2024
16 of 17 checks passed
@james-prysm james-prysm deleted the remove-stream-slot branch March 13, 2024 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants