-
Notifications
You must be signed in to change notification settings - Fork 895
[Merged by Bors] - Update node health endpoint #4310
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
Conversation
beacon_node/http_api/src/lib.rs
Outdated
let unhealthy = is_syncing || Some(is_optimistic) || Some(el_offline); | ||
|
||
if (unhealthy) { | ||
Err(warp_utils::reject::not_synced(format!( |
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.
could have returned a different error message for each situation where unhealthy resolves to true, but im not sure how helpful that is
|
Thanks for your contribution. I'd like to note that the Beacon-API specs state that:
So, moving to a Fine-grained information is available at I do agree that a node with a |
Yeah my bad, I didn't distinguish between syncing and EL offline in the original issue. I agree we should return a 206 for syncing/optimistic, and a 503 for |
thanks for the feedback! |
let mock_el = harness.mock_execution_layer.as_ref().unwrap(); | ||
|
||
// EL not synced | ||
mock_el.server.set_syncing_response(Ok(true)); |
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.
This test currently fails. I'm trying to test the situation where the node is syncing and the endpoint returns a 206 status code. However i'm not really sure how to mock syncing
to true
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.
@michaelsproul ideally i'd like to test the situation where the node health endpoint returns a 206, but I'm struggling trying to find a way to mock the situation where the node is syncing/optimistic
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.
You can call mock_el.server.all_payloads_syncing(true)
, then add a block (e.g. with extend_chain
). That new block will result in a SYNCING status from the EL on newPayload
, which will put Lighthouse into optimistic sync
…date-node-health-endpoint
…date-node-health-endpoint
@michaelsproul thanks for the feedback and help. this should be ready for another review |
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.
Nice, thanks!
bors r+ |
Pull request successfully merged into unstable. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page.
|
Issue Addressed
#4292
Proposed Changes
Updated the node health endpoint
will return a 200 status code if
!syncing && !el_offline && !optimistic
wil return a 206 if
(syncing || optimistic) && !el_offline
will return a 503 if
el_offline
Additional Info