Skip to content

Conversation

@avi-starkware
Copy link
Collaborator

Add standard Kubernetes-style health check endpoints:

  • GET /health: liveness probe, always returns 200 OK
  • GET /ready: readiness probe, returns 200 OK when ready

@reviewable-StarkWare
Copy link

This change is Reviewable

@avi-starkware avi-starkware force-pushed the avi/privacy/extract-proving-service-business-logic branch from d097dfe to 0fd0c28 Compare January 26, 2026 15:36
@avi-starkware avi-starkware force-pushed the avi/privacy/add-health-enpoints branch from 5c6495b to d35aa75 Compare January 26, 2026 15:37
@avi-starkware avi-starkware force-pushed the avi/privacy/extract-proving-service-business-logic branch 3 times, most recently from a851aa9 to 6574780 Compare January 27, 2026 09:54
@avi-starkware avi-starkware force-pushed the avi/privacy/add-health-enpoints branch 2 times, most recently from 96a962c to 59665b9 Compare January 27, 2026 11:13
@github-actions
Copy link

Artifacts upload workflows:

Base automatically changed from avi/privacy/extract-proving-service-business-logic to main January 27, 2026 11:18
@avi-starkware avi-starkware force-pushed the avi/privacy/add-health-enpoints branch from 59665b9 to 66fcaca Compare January 27, 2026 12:20
Add liveness/readiness endpoints with structured status checks:

- GET /gateway/is_alive checks bootloader file availability

- GET /gateway/is_ready checks RPC availability and chain id match
@avi-starkware avi-starkware force-pushed the avi/privacy/add-health-enpoints branch from 66fcaca to 8a879be Compare January 27, 2026 12:38
@avi-starkware avi-starkware marked this pull request as ready for review January 27, 2026 13:05
Copy link
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

@AvivYossef-starkware reviewed 3 files and all commit messages, and made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1 and @Yoni-Starkware).


crates/starknet_os_runner/src/server/http_server.rs line 198 at r1 (raw file):

        ],
    }
}

plz document, and consider splitting it into 2 separate checks, I think it would be clearer

Suggestion:

/// Verify:
/// 1. RPC url is reachable.
/// 2. RPC chain id is the same as the expected chain id.
async fn check_rpc_checks(prover: &VirtualSnosProver) -> Vec<CheckStatus> {
    let client = JsonRpcClient::new(HttpTransport::new(prover.rpc_url().clone()));
    match client.chain_id().await {
        Ok(chain_id) => {
            // The rpc is reachable.
            // Verify that the chain id is the same as the expected one.
            let availability_check = CheckStatus { name: "rpc_available", ok: true, message: None };
            let expected = prover.chain_id().as_hex().to_lowercase();
            let actual = chain_id.to_hex_string().to_lowercase();
            let chain_id_check = if actual == expected {
                CheckStatus { name: "rpc_chain_id", ok: true, message: None }
            } else {
                CheckStatus {
                    name: "rpc_chain_id",
                    ok: false,
                    message: Some(format!(
                        "RPC chain id {actual} does not match expected {expected}"
                    )),
                }
            };
            vec![availability_check, chain_id_check]
        }
        // If the RPC is unavailable, we skip the chain id check.
        Err(err) => vec![
            CheckStatus {
                name: "rpc_available",
                ok: false,
                message: Some(format!("RPC unavailable: {err}")),
            },
            CheckStatus {
                name: "rpc_chain_id",
                ok: false,
                message: Some(format!("RPC chain id check skipped: RPC unavailable: {err}")),
            },
        ],
    }
}

@avi-starkware avi-starkware changed the base branch from main to main-v0.14.2 January 28, 2026 11:17
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants