-
Notifications
You must be signed in to change notification settings - Fork 1
Add health check to wait for execution endpoint availability before starting validator #11
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
…logging Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com>
Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com>
Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com>
staking/entrypoint.sh
Outdated
| # Health check function | ||
| check_endpoint_health() { | ||
| local url=$1 | ||
| if curl --silent --fail --max-time "${TIMEOUT}" "${url}" > /dev/null 2>&1; then |
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.
In my case the "healthy" condition is when the domain resolves and the port is opened and listening so the connection can be established, no matter the http code returned by the server
i.e this should considered as healthy
`curl -v --fail --max-time "5" "http://execution.starknet-sepolia.dncore.dappnode:6060/v0_9"
- Host execution.starknet-sepolia.dncore.dappnode:6060 was resolved.
- IPv6: (none)
- IPv4: 172.33.0.31
- Trying 172.33.0.31:6060...
- Connected to execution.starknet-sepolia.dncore.dappnode (172.33.0.31) port 6060
GET /v0_9 HTTP/1.1
Host: execution.starknet-sepolia.dncore.dappnode:6060
User-Agent: curl/8.5.0
Accept: /
< HTTP/1.1 404 Not Found
< Date: Tue, 23 Dec 2025 08:52:49 GMT
< Content-Length: 0
- The requested URL returned error: 404
- Closing connection
curl: (22) The requested URL returned error: 404`
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.
Fixed in c3bc46b. Removed the --fail flag from curl so that any HTTP response (including 404) is considered healthy. The health check now only verifies that the connection can be established and the port is listening, regardless of the HTTP status code returned.
…ncluding 404) Co-authored-by: pablomendezroyo <41727368+pablomendezroyo@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Plan: Add Health Check for PROVIDER_HTTP_URL Endpoint
staking/entrypoint.shto add health check logic before starting the validatorSummary
Successfully implemented a health check mechanism that prevents the Starknet validator from crashing when started before the execution service completes its data download (which can take up to 2 hours).
Key Features:
Configuration Environment Variables:
HEALTH_CHECK_MAX_RETRIES(default: 360)HEALTH_CHECK_SLEEP_INTERVAL(default: 20 seconds)HEALTH_CHECK_TIMEOUT(default: 5 seconds)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.