Skip to content

Backport release/v6.6: feat(seeds): ship Sei Labs seeds as the default bootstrap-peers - #3954

Merged
masih merged 1 commit into
release/v6.6from
backport-3885-to-release/v6.6
Aug 19, 2026
Merged

Backport release/v6.6: feat(seeds): ship Sei Labs seeds as the default bootstrap-peers#3954
masih merged 1 commit into
release/v6.6from
backport-3885-to-release/v6.6

Conversation

@seidroid

@seidroid seidroid Bot commented Aug 19, 2026

Copy link
Copy Markdown

Backport of #3885 to release/v6.6.

## 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)
@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes default P2P bootstrap for newly initialized public-network nodes; hardcoded seed addresses ship in release binaries and are difficult to retire without keeping old endpoints dialable.

Overview
New nodes on pacific-1 and atlantic-2 get Sei Labs seed endpoints written into config.toml as bootstrap-peers during seid init, when that field is still empty. Devnet (arctic-1) and unknown chain IDs are left unchanged.

The seed list lives in a new app/seeds package (three regional seeds per public network). applyDefaultBootstrapPeers in init wiring applies it without overwriting an already-set value. sei-tendermint/config now exposes ParseNodeAddress so seeds and tests use the same parsing rules as the P2P router.

Tests cover address table invariants, init → config.toml end-to-end, and optional integration checks that dial live seeds and require an initial P2P handshake byte (tolerating one unreachable seed per network). A manual workflow_dispatch workflow runs those integration tests for release/ops verification—not as a PR gate.

Reviewed by Cursor Bugbot for commit af01e2a. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 19, 2026, 12:48 PM

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.95%. Comparing base (851cc6e) to head (af01e2a).
⚠️ Report is 1 commits behind head on release/v6.6.

Additional details and impacted files

Impacted file tree graph

@@               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     
Flag Coverage Δ
sei-chain-pr 48.14% <100.00%> (?)
sei-db 70.41% <ø> (?)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/seeds/seeds.go 100.00% <100.00%> (ø)
cmd/seid/cmd/init.go 66.01% <100.00%> (+39.66%) ⬆️
sei-tendermint/config/node_address.go 100.00% <100.00%> (ø)

... and 79 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih
masih requested a review from bdchatham August 19, 2026 12:46
@masih
masih enabled auto-merge (squash) August 19, 2026 17:26
@masih
masih disabled auto-merge August 19, 2026 17:27
@masih
masih merged commit f8aad07 into release/v6.6 Aug 19, 2026
96 of 100 checks passed
@masih
masih deleted the backport-3885-to-release/v6.6 branch August 19, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants