Skip to content

fix(cli): emit namespace-relative static-nodes hostnames - #303

Merged
insider89 merged 1 commit into
mainfrom
fix/static-node-namespace-relative-hostnames
Aug 21, 2026
Merged

fix(cli): emit namespace-relative static-nodes hostnames#303
insider89 merged 1 commit into
mainfrom
fix/static-node-namespace-relative-hostnames

Conversation

@insider89

Copy link
Copy Markdown
Contributor

What

Static-nodes entries no longer embed the deployment's own namespace.

  • --static-node-namespace is deprecated and ignored. Hostnames stay relative — besu-validators-0.besu-validators — and resolve through the pod's DNS search list.
  • A cluster-scoped --static-node-domain is dropped with a warning: svc.*, anything ending in cluster.local, and namespace-smuggling forms such as network.svc.cluster.local. It only resolves alongside a namespace segment, so keeping it would produce an unresolvable host. Non-cluster suffixes (example.com) are still appended.
  • New --static-node-fqdn opts back into the fully qualified form. It requires --static-node-namespace (hard error, exit 1, otherwise) and warns that the namespace is pinned.
  • Resolution runs before key generation so unusable flag combinations fail fast; warnings go to stderr so -o screen output stays consumable.

Why

BC/DR finding I-9 (PRD-13096): distributed-ledger addresses embed the deployment's own environment name. Recovered into a differently named namespace, every enode points back at the original deployment — ledger data and identity restore correctly, but consensus never resumes and RPC nodes wait indefinitely on a validator that will never appear. It presents as a successful restore of a stalled chain.

The chart-side fix (besu-stack in SettleMint-Collaboration/besu-helm) does not cover deployments that supply raw enode URLs via staticNodes.raw — this repository is the second, independent producer of the same defect. This PR is step 3 of that issue's work breakdown.

The generated list only ever names its own namespace, so a namespace-relative hostname is semantically identical at deployment time and correct after a restore anywhere.

Blast radius

No repository in the fleet passes --static-node-namespace from a chart or script — checked dalp, besu-helm, deployment-rer, deployment-ocbc. It is operator-typed (docker run … generate), so the change takes effect on the next image pull without any chart edit. Operators who keep passing the flag get a warning and the corrected output rather than a failure.

Existing staticNodes.raw lists already pasted into values files (for example deployment-ocbc/values-ibft-sit.yaml) still carry pinned FQDNs — they need regeneration, or the DR-suite rewrite step, which stays in place per step 5 of the issue.

No chart or version bump: this repository has no charts/ directory, and tools/version.ts stamps package.json from the release tag in CI.

Commands run

  • bun test — 119 pass, 0 fail
  • bun run typecheck — clean
  • bun run check — clean
  • bun run docs:cli — README regenerated

CLI output

$ network-bootstrapper generate --static-node-namespace dalp-staging --static-node-domain svc.cluster.local
Warning: --static-node-namespace is deprecated and ignored; static-nodes entries use namespace-relative
         hostnames so a restore into a renamed namespace still forms a cluster. Pass --static-node-fqdn
         to keep the fully qualified form.
Warning: --static-node-domain "svc.cluster.local" is cluster-scoped and was dropped; it only resolves
         alongside a namespace segment. Pass --static-node-fqdn with --static-node-namespace to keep it.

  "enode://…@besu-validators-0.besu-validators:30303?discport=30303",
  "enode://…@besu-rpc-0.besu-rpc-headless:30303?discport=30303"

$ network-bootstrapper generate --static-node-fqdn --static-node-namespace dalp-staging --static-node-domain svc.cluster.local
Warning: --static-node-fqdn embeds namespace "dalp-staging" in every static-nodes entry; a restore into a
         differently named namespace will point these nodes at the original deployment.

  "enode://…@besu-validators-0.besu-validators.dalp-staging.svc.cluster.local:30303?discport=30303"

$ network-bootstrapper generate --static-node-fqdn
--static-node-fqdn requires --static-node-namespace to build a resolvable hostname.   # exit 1

Tests

Five new cases in bootstrap.command.test.ts: default drop plus both warnings, non-cluster domain kept, smuggled-namespace domain dropped, --static-node-fqdn without a namespace rejected, and the FQDN opt-in warning. Two pre-existing tests now pass --static-node-fqdn to keep coverage of the fully qualified form.

Closes step 3 of PRD-13096.

https://claude.ai/code/session_01FXPrQuEEnF32SBEFwEuEp8

Static-nodes entries embedded the deployment's own namespace, so a network
restored into a differently named namespace kept pointing every enode at the
original deployment: consensus never resumed and RPC nodes waited forever on a
dependency that would not appear (BC/DR finding I-9, PRD-13096).

- --static-node-namespace is deprecated and ignored; hostnames stay relative
  (besu-validators-0.besu-validators) and resolve through the pod DNS search
  list, which is identical at deploy time and namespace-agnostic on restore.
- A cluster-scoped --static-node-domain (svc.*, *.cluster.local, including
  namespace-smuggling forms like network.svc.cluster.local) is dropped with a
  warning; it only resolves alongside a namespace segment. Non-cluster suffixes
  are still appended.
- New --static-node-fqdn opts back into the fully qualified form. It requires
  --static-node-namespace and warns that the namespace is pinned.

Hostname resolution runs before key generation so unusable combinations fail
fast, and warnings go to stderr to keep screen output consumable.

Claude-Session: https://claude.ai/code/session_01FXPrQuEEnF32SBEFwEuEp8
@github-actions github-actions Bot added the qa:running QA workflow is currently running label Aug 21, 2026
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

To view in Slack, search for: 1787312915.554219

@github-actions github-actions Bot added qa:success QA workflow passed successfully fix Bug fix status:ready-for-review Pull request is ready for review and removed qa:running QA workflow is currently running labels Aug 21, 2026
@insider89
insider89 merged commit 042252c into main Aug 21, 2026
5 checks passed
@insider89
insider89 deleted the fix/static-node-namespace-relative-hostnames branch August 21, 2026 11:55
@github-actions github-actions Bot added status:merged Pull request has been merged and removed status:ready-for-review Pull request is ready for review labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix qa:success QA workflow passed successfully status:merged Pull request has been merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant