Backport release/v6.6: feat(seeds): ship Sei Labs seeds as the default bootstrap-peers - #3954
Conversation
## What A fresh `seid init --chain-id pacific-1` (or `atlantic-2`) now writes a `config.toml` with `bootstrap-peers` already populated with the Sei Labs seed nodes, so a node bootstraps peer discovery **with no other config set**. Today the field defaults to `""` and operators have to source a peer list out of band. ## How Adds `app/seeds`, mirroring the existing `app/genesis` pattern for well-known chain data, and calls `applyDefaultBootstrapPeers` in `InitCmd` after the chain-id is resolved and before `WriteConfigFile`. ## Decisions worth reviewing - **`bootstrap-peers`, not `persistent-peers`.** Seeds populate the address book via PEX and may then be dropped. Holding operator connections open against our seeds indefinitely is wrong for them and a load multiplier for us. - **arctic-1 is deliberately excluded.** It is a devnet, it has no Cosmos chain-registry entry, and a devnet is the most likely network to be reset or re-keyed — the worst case for an address baked permanently into a release. It stays well-known for genesis; it just ships no seeds. A test asserts both halves of that. - **Init-time only, no runtime injection.** Writing config at start-up would mutate a file the operator owns. ## Behaviour on existing configs — please read before release notes An earlier revision of this description said "the operator value always wins". That was imprecise, and the review was right to flag it. Precisely: - `seid init` builds its config from `tmcfg.DefaultConfig()` and **exposes no flag for `bootstrap-peers`**, so the field is always empty at that point. The empty check in `applyDefaultBootstrapPeers` is **defensive, not an operator-precedence mechanism** — it keeps the behaviour correct for any future caller that pre-populates the field. - **Without `--overwrite`**, `init` refuses to touch an existing config at all, so a hand-edited `bootstrap-peers` is safe. - **With `--overwrite`**, `config.toml` is rewritten wholesale, so a hand-edited `bootstrap-peers` is now replaced **by the Sei seeds instead of by `""`**. Not a regression, and arguably an improvement, but it is a behaviour change and belongs in the release notes. Verified empirically: hand-edit `bootstrap-peers`, run `init --overwrite`, and the seeds replace it; run `init` without `--overwrite` and it errors out leaving the file untouched. **Nodes that already ran `init` do not retroactively get seeds** — they are covered by the docs update and a separate chain-registry submission. ## Permanence These strings ship inside released binaries and operators pin them; the secret-connection handshake verifies the NodeID, so a changed ID is a rejected dial rather than a degraded one, and a release in the wild cannot be recalled. The inputs are final: the DNS pattern is settled, all node keys are pinned in encrypted secrets, and every instance-target NLB port is pinned in the infrastructure repo. Retiring an address means keeping it dialable until every release carrying it is out of use — noted in the package doc. ## Drive-by Corrects the `--chain-id` flag help, which claimed *"if left blank will use sei"* while the code panics on an empty value. The other half of that mismatch — `panic()` printing a Go stack trace for what is plain operator error, where `RunE` returns errors for the neighbouring invalid-mode case — is left for a separate PR, per the review. It is tracked. ## Testing **Wiring coverage (new).** `TestInitCmdWritesDefaultBootstrapPeers` executes the real `InitCmd` against a temp home and asserts the written `config.toml`. This closes a gap the review identified: previously nothing exercised `RunE`, so deleting the wiring left the entire suite green. Confirmed by mutation — removing the call now fails this test. **Data coverage.** `app/seeds` tests hold each NodeID against `types.NodeID.Validate` rather than a local regex (so the check cannot drift from CometBFT's definition), require the `:26656` port, and assert NodeID **and** host uniqueness across the whole table — a per-chain check would miss a `pacific-1` entry pasted into the `atlantic-2` block. A further test asserts every seeded chain is well-known per `genesis.IsWellKnown`, catching a typo'd chain-id that would otherwise be a silent no-op. End to end with a locally built binary: | `--chain-id` | `bootstrap-peers` | |---|---| | `pacific-1` | 3 entries | | `atlantic-2` | 3 entries | | `arctic-1` | `""` | | `my-private-chain` | `""` | Existing `cmd/seid/cmd` tests pass unchanged. ## Related The operator docs update is held as a draft until this ships in a release, since it documents the defaulted behaviour. (cherry picked from commit afd3c75)
PR SummaryMedium Risk Overview The seed list lives in a new Tests cover address table invariants, init → Reviewed by Cursor Bugbot for commit af01e2a. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/v6.6 #3954 +/- ##
================================================
- Coverage 58.78% 57.95% -0.83%
================================================
Files 2220 2153 -67
Lines 183137 175041 -8096
================================================
- Hits 107649 101445 -6204
+ Misses 65781 64548 -1233
+ Partials 9707 9048 -659
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Backport of #3885 to
release/v6.6.