Skip to content

fix(env): stop shipping an active Sepolia healthcheck RPC in .env.example - #96

Open
feafel wants to merge 1 commit into
inkonchain:mainfrom
feafel:fix/healthcheck-ref-per-network
Open

feafel wants to merge 1 commit into
inkonchain:mainfrom
feafel:fix/healthcheck-ref-per-network

Conversation

@feafel

@feafel feafel commented Oct 11, 2026

Copy link
Copy Markdown

What

.env.example ships HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://rpc-gel-sepolia.inkonchain.com uncommented, and the README tells operators to cp .env.example .env. This comments it out and updates the README text that told mainnet operators to edit it by hand.

Why

docker-compose.yml loads the healthcheck sidecar env files in this order:

env_file:
  - ./envs/common/healthcheck.env
  - ./envs//healthcheck.env
  - .env

Per the Compose reference, later files win. envs/ink-mainnet/healthcheck.env already sets HEALTHCHECK__REFERENCE_RPC_PROVIDER=https://rpc-gel.inkonchain.com, but the copied .env is loaded after it and overrides it with the Sepolia RPC.

Net effect: a NETWORK_NAME=ink-mainnet operator who follows the README gets a healthcheck sidecar comparing their local mainnet geth against Sepolia — the replica-healthcheck never agrees with the reference chain, so the node looks permanently unhealthy for a reason that has nothing to do with sync state. The variable is read by nothing in this repo's shell scripts, only by the sidecar image, so the misconfiguration is silent.

The old comment even documented the trap ("this value overrides them" / "for ink-mainnet, switch this to ..."), which is exactly the footgun: correctness depended on the operator remembering to edit a value they were never told to look at.

How

  • .env.example: comment out the line and explain why it stays commented, with the override path preserved.
  • README.md: drop the variable from the recommended Sepolia snippet (it is now redundant) and replace the "for ink-mainnet, switch ..." bullet with the actual precedence rule.

Verification

  • envs/ink-mainnet/healthcheck.env and envs/ink-sepolia/healthcheck.env already carry the correct per-network values — no change needed there.
  • docker-compose.yml untouched; parsed with yaml.safe_load to confirm the env_file order above.
  • grep -n '^HEALTHCHECK__REFERENCE_RPC_PROVIDER' .env.example returns nothing (comment-only), so a copy-paste of the template cannot re-introduce the override.
  • No docker in this environment, so precedence is asserted from the Compose reference rather than an executed stack.

Conflict note

#90 touches the same .env.example block (adds variables immediately below this line) and rewrites README.md; this branch will conflict textually with it. The two changes are independent and trivially resolvable — whichever lands second just needs to keep the commented-out healthcheck line.

…mple

docker-compose.yml loads healthcheck env_file as common -> envs/<network>
-> .env, and later files win, so the live HEALTHCHECK__REFERENCE_RPC_PROVIDER
in .env.example overrides envs/ink-mainnet/healthcheck.env. Following the
README (cp .env.example .env) on mainnet therefore points the healthcheck
sidecar at the Sepolia RPC.

Comment the line out so the per-network file supplies the right value, and
update the README bullet that told mainnet operators to edit it by hand.
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