feat: raise default MAX_PEERS to 32 - #166
Merged
Merged
Conversation
Operators now routinely need more than the previous default of 16 peers, so bump the `-Dmax-peers` default to 32 (the 1..128 range and 128 cap are unchanged). The derived `MAX_POLICY_ENTRIES` becomes 32 + MAX_ROUTES*2 + 224 = 272, and the static musl subnetrad grows ~20KB to ~284KB — well within the 512KB iron-law budget. Docs (EN + ZH) and the in-code comments are updated to state "default 32 → 272" and drop the now-obsolete "reproduces the historical 256-entry table" wording. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merged
jamiesun
added a commit
that referenced
this pull request
Jun 12, 2026
Bump build.zig.zon .version 0.8.3 -> 0.9.0 ahead of tagging. Highlights since v0.8.3: - feat: configurable MAX_PEERS via the `-Dmax-peers` build option, 1..128 (#165) - feat: raise the default peer cap to 32 (#166) - docs: Exit Node & Outbound guide, simplified to the proxy-outbound pattern (#162, #163) - docs: quickstart now uses a hub + two spokes (#164) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What
Bump the default of the
-Dmax-peersbuild option from 16 to 32.MAX_POLICY_ENTRIESis now32 + MAX_ROUTES*2 + 224 = **272**(was 256 at the old default).Why
Real deployments now routinely exceed 16 spokes, so 32 is a better out-of-the-box default. It stays compile-time (the registry/config are fixed zero-alloc arrays); operators who need more can still go up to 128, and the policy table scales automatically.
Size impact
Static musl
subnetradgrows ~20 KB (265 KB → 284 KB),subnetrais unchanged (142 KB). Both remain well within the 512 KB iron-law budget.Changes
build.zig:-Dmax-peersdefault16 → 32; comment/help text updated.src/config.zig,src/uds.zig: comments updated to "default 32 → 272"; dropped the obsolete "reproduces the historical 256-entry table" wording.installation.md+reference.mdupdated to default 32.Verification
zig build+zig build testgreen at the new default 32 (and still at 16/64/128).zig build --helpshowsdefault 32.x86_64-linux-musl: subnetrad 284 KB < 512 KB.check-links.pypasses.