-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
api/client/event/eventStream.go
Outdated
var eventType, data string // Variables to store event type and data | ||
|
||
// Iterate over lines of the event stream | ||
for scanner.Scan() { |
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.
is a span enough...
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.
Please fix the TODOs in this PR, delete the TODOs, or create associated issues to track them.
@@ -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") |
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.
_, 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.
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.
Also, should you set some deadline, perhaps the server should respond within 10 seconds or give up waiting?
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.
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>
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.
this is a big change