Repository navigation
Commit 042252c
authored
fix(cli): emit namespace-relative static-nodes hostnames (#303)
## 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](https://linear.app/settlemint/issue/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_01FXPrQuEEnF32SBEFwEuEp81 parent cff1b8b commit 042252c
3 files changed
Lines changed: 242 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
| 35 | + | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
452 | 455 | | |
453 | 456 | | |
454 | 457 | | |
| |||
520 | 523 | | |
521 | 524 | | |
522 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
523 | 529 | | |
524 | 530 | | |
525 | 531 | | |
| |||
538 | 544 | | |
539 | 545 | | |
540 | 546 | | |
| 547 | + | |
541 | 548 | | |
542 | 549 | | |
543 | 550 | | |
| |||
621 | 628 | | |
622 | 629 | | |
623 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
624 | 634 | | |
625 | 635 | | |
626 | 636 | | |
| |||
633 | 643 | | |
634 | 644 | | |
635 | 645 | | |
| 646 | + | |
636 | 647 | | |
637 | 648 | | |
638 | 649 | | |
| |||
650 | 661 | | |
651 | 662 | | |
652 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
653 | 816 | | |
654 | 817 | | |
655 | 818 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
167 | 222 | | |
168 | 223 | | |
169 | 224 | | |
| |||
188 | 243 | | |
189 | 244 | | |
190 | 245 | | |
191 | | - | |
| 246 | + | |
192 | 247 | | |
193 | 248 | | |
194 | 249 | | |
195 | 250 | | |
196 | 251 | | |
197 | 252 | | |
198 | 253 | | |
199 | | - | |
| 254 | + | |
200 | 255 | | |
201 | 256 | | |
202 | 257 | | |
| |||
330 | 385 | | |
331 | 386 | | |
332 | 387 | | |
| 388 | + | |
333 | 389 | | |
334 | 390 | | |
335 | 391 | | |
| |||
342 | 398 | | |
343 | 399 | | |
344 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
345 | 411 | | |
346 | 412 | | |
347 | 413 | | |
| |||
434 | 500 | | |
435 | 501 | | |
436 | 502 | | |
437 | | - | |
438 | | - | |
| 503 | + | |
| 504 | + | |
439 | 505 | | |
440 | 506 | | |
441 | 507 | | |
442 | 508 | | |
443 | 509 | | |
444 | 510 | | |
445 | | - | |
446 | | - | |
| 511 | + | |
| 512 | + | |
447 | 513 | | |
448 | 514 | | |
449 | 515 | | |
| |||
619 | 685 | | |
620 | 686 | | |
621 | 687 | | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
622 | 692 | | |
623 | 693 | | |
624 | 694 | | |
| |||
0 commit comments