tailscale/cmd
Brad Fitzpatrick 4660a961eb ipn/ipnlocal, wgengine/wgcfg/nmcfg: stop building peer lists on delta path
Processing a peer add/remove delta still materialized the full netmap
(an O(n) slicesx.MapValues plus sort over all peers, at 10k+
peers in a large tailnet) twice per delta: once in UpdateNetmapDelta
purely to hand the self node to Engine.SetSelfNode, and once in
authReconfigLocked.

Neither needs peers anymore. SetSelfNode gets the self node from the
existing nodeBackend.Self accessor. authReconfigLocked only reads
self-node fields (SelfNode, NodeKey, GetAddresses, HasCap) now that
WireGuard peers ride the incremental route manager and per-peer config
source, so it can use the peers-free NetMap accessor.

That also makes nmcfg.WGCfg vestigial: since wgcfg.Config lost its
Peers field, its peer walk existed only to emit the [v1] skip logs
(expired peers, unselected exit nodes, unaccepted subnet routes),
duplicating filtering the route manager already does. Delete the
package and construct the two-field wgcfg.Config inline. The skip
logs go away; if they're missed, the route manager can log them
incrementally at upsert time instead of rescanning every peer on
every reconfig.

With this, the runtime.DidRange analysis (see the ts_rangehook test)
shows a delta netmap update performing no O(n) range loops except
updateRouteManagerExtras, and the delta phase of that test drops from
1.09s to 0.14s for 400 deltas at n=10000 (from 4.79s at the
start of this effort, before the incremental route manager work).

Updates #12542

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: Ia0e03ef9db0c988790b2c29de1f0505305e93f58
2026-07-15 11:21:36 -04:00
..
addlicense all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
build-webclient all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
checkmetrics all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
cigocacher cmd/cigocacher: make --stats flag best-effort (#18761) 2026-02-19 16:06:12 +00:00
cloner cmd: apply go fix 2026-07-10 14:26:11 -07:00
connector-gen all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
containerboot cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
derper ipn/ipnlocal: use routecheck reports to make exit node suggestions 2026-07-02 20:26:27 -07:00
derpprobe all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
dist all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
distsign all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
fbstatus cmd/tailscale: add 'configure pve-appliance' to make Proxmox VM of appliance 2026-07-07 13:12:13 -07:00
featuretags all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
get-authkey all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
gitops-pusher tsnet: make workload identity federation opt-in 2026-05-06 18:43:45 -07:00
hello cmd/hello: split css and js into separate files (#19771) 2026-05-15 09:37:22 -07:00
jsonimports all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
k8s-nameserver all: don't repeat the the word "the" unnecessarily 2026-06-18 16:32:08 +01:00
k8s-operator ipn/ipnlocal, wgengine/wgcfg/nmcfg: stop building peer lists on delta path 2026-07-15 11:21:36 -04:00
k8s-proxy cmd/{k8s-operator,containerboot,kube}: support IPv6 in egress ProxyGroup (#19898) 2026-07-14 13:26:40 +01:00
mkmanifest all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
mkpkg all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
mkversion all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
nardump tool/updateflakes, cmd/nardump: replace update-flake.sh with Go tool 2026-04-28 10:18:32 -07:00
natc cmd: apply go fix 2026-07-10 14:26:11 -07:00
netlogfmt cmd/tailscale/cli: fix time in tailscale routecheck (#19956) 2026-06-01 16:12:08 -07:00
nginx-auth all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
omitsize all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
pgproxy cmd/pgproxy: fix client TLS handshake timeout 2026-05-11 11:12:11 -07:00
printdep cmd/printdep: add --next flag to use rc Go build hash instead 2026-01-27 14:49:56 -08:00
proxy-test-server all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
proxy-to-grafana all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
sniproxy all: migrate code off Notify.NetMap to Notify.SelfChange 2026-05-01 06:51:40 -07:00
speedtest all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
ssh-auth-none-demo cmd/ssh-auth-none-demo: update SSH demo a bit 2026-06-03 19:36:19 -07:00
stunc all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
stund ipn/ipnlocal, feature/acme: move most remaining cert code into feature/acme 2026-06-29 12:57:22 -07:00
stunstamp all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
sync-containers all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
systray client/systray: support several different color themes 2026-04-27 18:54:14 -07:00
tailscale cmd/tailscale/cli: fix plain TCP serve status 2026-07-15 08:01:37 -06:00
tailscaled ipn/ipnlocal, wgengine/wgcfg/nmcfg: stop building peer lists on delta path 2026-07-15 11:21:36 -04:00
testcontrol all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
testwrapper cmd/testwrapper: add a max retry time across all failures (#20453) 2026-07-14 13:44:21 +01:00
tl-longchain all: rename NetworkLock functions/types to TailnetLock 2026-06-08 13:14:28 +01:00
tsconnect tstest/integration/jswasmtest: add headless-Chromium tests for @tailscale/connect 2026-05-20 10:48:29 -07:00
tsidp ipn/ipnlocal, wgengine/wgcfg/nmcfg: stop building peer lists on delta path 2026-07-15 11:21:36 -04:00
tsnet-proxy cmd/tsnet-proxy: add tsnet-based port proxy tool (#19468) 2026-04-22 13:34:18 -04:00
tsp cmd: apply go fix 2026-07-10 14:26:11 -07:00
tsshd all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
tta tstest, cmd/tta: add Tailscale SSH end-to-end VM test 2026-07-13 15:04:51 -07:00
vet cmd/tailscale, ipn, feature/remoteconfig: add remote-config support 2026-07-07 12:10:34 -07:00
viewer cmd: apply go fix 2026-07-10 14:26:11 -07:00
vnet all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
xdpderper all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00