Skip to content

feat: add and use chain.scripts.chainRpcReady #688

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

michaelfig
Copy link
Contributor

This PR consolidates all the different ways of checking if a chain node's RPC service is ready to use.

Documentation, scripts, and examples have been updated accordingly.

The Agoric readinessProbe now just uses the defaults. I've verified that properly waiting for RPC to become ready (instead of restarting the pod's faucet and hitting backoff) has reduced the time needed to boot up agoriclocal-genesis-0 on my machine from 14 minutes down to 6 minutes.

@Anmol1696 Anmol1696 requested review from Copilot and Anmol1696 May 22, 2025 10:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR consolidates the various methods of checking if a chain node's RPC service is ready by introducing a dedicated chainRpcReady script.

  • Integrates the chainRpcReady script configuration in values.yaml and values.schema.json.
  • Updates the readiness probes in validator.yaml and genesis.yaml to use the chainRpcReady script via exec commands.
  • Updates defaults.yaml and documentation to reflect the new approach.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
starship/charts/devnet/values.yaml Adds commented configuration for chainRpcReady script.
starship/charts/devnet/values.schema.json Introduces a new schema object to validate the chainRpcReady configuration.
starship/charts/devnet/templates/chains/cosmos/validator.yaml Replaces HTTP GET readiness check with an exec command calling chainRpcReady script.
starship/charts/devnet/templates/chains/cosmos/genesis.yaml Replaces HTTP GET & custom loop with exec commands for the chainRpcReady script and mounts the /scripts volume.
starship/charts/devnet/scripts/default/chain-rpc-ready.sh Provides the new script that determines if the RPC service is ready.
starship/charts/devnet/defaults.yaml Updates the default scripts to include chainRpcReady.
docs/config/chains.mdx Updates documentation to include details for the chainRpcReady script.

json=$(curl -s --connect-timeout 2 "$RPC_URL/status")

# and the bootstrap block state has been validated,
if [ "$(echo "$json" | jq -r '.result.sync_info | (.earliest_block_height < .latest_block_height)')" != true ]; then
Copy link
Preview

Copilot AI May 22, 2025

Choose a reason for hiding this comment

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

Assuming that '.earliest_block_height' and '.latest_block_height' are numeric values, if these values are returned as strings by the API, consider using 'tonumber' within jq to ensure a proper numerical comparison.

Suggested change
if [ "$(echo "$json" | jq -r '.result.sync_info | (.earliest_block_height < .latest_block_height)')" != true ]; then
if [ "$(echo "$json" | jq -r '.result.sync_info | (.earliest_block_height | tonumber) < (.latest_block_height | tonumber)')" != true ]; then

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

@Anmol1696 Anmol1696 left a comment

Choose a reason for hiding this comment

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

LGTM

@Anmol1696 Anmol1696 merged commit ee52535 into hyperweb-io:main May 22, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants