server: LIGHT_NODE_PEERS — override the seed peers (relay-fleet spoke) - #26
Open
dkijania wants to merge 1 commit into
Open
server: LIGHT_NODE_PEERS — override the seed peers (relay-fleet spoke)#26dkijania wants to merge 1 commit into
dkijania wants to merge 1 commit into
Conversation
Lets a node dial a chosen peer set instead of the network's published seeds, keeping the network's chain_id. Paired with LIGHT_NODE_STATIC_PEERS=1 this pins a node to a trusted relay fleet (the wallet/exchange spoke in #17) and never dials the public seeds — the missing piece that makes static-peer mode usable by an external customer. `LIGHT_NODE_PEERS` is comma-separated multiaddrs, parsed by `parse_peer_override` (trims entries, drops blanks, all-blank => fall back to seeds) and leaked to 'static once at startup so the peer plumbing (gossip / sync-ledger reads / broadcast) stays borrow-free. Multiaddr validity is checked at dial time as before. Tested: 3 hermetic unit tests for parse_peer_override; clippy -D warnings + fmt clean; 14 bin tests pass. The static-peer connect behavior this feeds is already validated on the lightnet (gossip_relay / submit_mempool). A live devnet override smoke test is left for CI / a clean env. Refs #17 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ma8isK1FQpvLuKAPahhw5U
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets a node dial a chosen peer set instead of the network's published seeds, keeping the network's chain_id. Paired with
LIGHT_NODE_STATIC_PEERS=1, this pins a node to a trusted relay fleet — the wallet/exchange spoke in #17 — and never dials the public seeds. It's the piece #17 flagged as "the missing piece that makes static-peer mode usable by an external customer."Change
LIGHT_NODE_PEERS= comma-separated multiaddrs. Parsed byparse_peer_override(trims entries, drops blanks; an all-blank value falls back to the network seeds), then leaked to'staticonce at startup so the whole peer plumbing (gossip / sync-ledger reads / broadcast) stays borrow-free and unchanged. Multiaddr validity is still checked at dial time.MINA_NETWORK=devnet LIGHT_NODE_PEERS=<hub1,hub2> LIGHT_NODE_STATIC_PEERS=1.Validation
parse_peer_override(split/trim, drop-blank entries, all-blank → None).clippy -D warnings+fmtclean; 14 bin tests pass.gossip_relay/submit_mempool.Follow-ups (still #17)
Multiple hubs + health-based failover; fold the
subscribe_gossipnetwork knobs into aGossipConfigstruct; generalize persistent re-dial to discovery mode.Refs #17