p2p: a --public node accepts 1000 inbound connections (--max-conns), instead of libp2p's memory-scaled default

The simulator showed libp2p's default cap (about 190 on 16 GB) stranding newcomers
on a bootstrap node: 12 of 200 and 212 of 400 nodes never found a peer. As
shipped, the same networks now form and deliver 100% up to 600 nodes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 22:46:05 +01:00
co-authored by Claude Sonnet 5.5
parent 130ba5dc65
commit 86668baf5a
10 changed files with 170 additions and 53 deletions
+3 -3
View File
@@ -31,7 +31,7 @@ for (const r of runs) {
const alone = /(\d+) of them have no peer at all/.exec(m.mesh ?? "");
scaling.push({
run: r.name,
limit: m.seed_conns > 0 ? "lifted" : "libp2p default",
limit: m.seed_conns < 0 ? "libp2p default" : "fixed",
nodes: m.nodes,
mesh_s: r1(m.mesh_s),
mesh_complete: m.mesh_complete,
@@ -58,7 +58,7 @@ writeFileSync(join(out, "scaling.json"), JSON.stringify(scaling));
// per-second series of the runs worth looking at over time: the smallest, a middle one and the largest of each limit
const pick = new Set();
for (const limit of ["lifted", "libp2p default"]) {
for (const limit of ["fixed", "libp2p default"]) {
const rs = scaling.filter((x) => x.limit === limit);
if (rs.length) {
pick.add(rs[0].run);
@@ -93,7 +93,7 @@ for (const r of runs) {
if (!lst || !lst.ms?.length) continue;
for (let i = 1; i <= 40; i++) {
const q = i / 40;
arrival.push({ run: r.name, nodes: r.meta.nodes, limit: r.meta.seed_conns > 0 ? "lifted" : "libp2p default", ms: r1(pct(lst.ms, q - 1e-9)), share: Math.round(((q * lst.ms.length) / lst.sent) * 1000) / 10 });
arrival.push({ run: r.name, nodes: r.meta.nodes, limit: r.meta.seed_conns < 0 ? "libp2p default" : "fixed", ms: r1(pct(lst.ms, q - 1e-9)), share: Math.round(((q * lst.ms.length) / lst.sent) * 1000) / 10 });
}
}
writeFileSync(join(out, "arrival.json"), JSON.stringify(arrival));