Skip to content

shadow-gossipsub: select muxer and discovery (static | kad-dht)#316

Merged
radiken merged 7 commits into
masterfrom
alan/shadow-regression-infra
Jul 17, 2026
Merged

shadow-gossipsub: select muxer and discovery (static | kad-dht)#316
radiken merged 7 commits into
masterfrom
alan/shadow-regression-infra

Conversation

@radiken

@radiken radiken commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The shadow experiment can only run yamux in static mode currently, this PR adds muxer and discovery selection.

  • render_shadow_yaml gains discovery and start_sleep.
  • shadow-gossipsub ExpConfig exposes muxer, discovery, start_sleep and passes them through.
  • multi-shadow-gossipsub is now env-configurable (SHADOW_MUXERS/SHADOW_SIZES/SHADOW_DISCOVERY).
  • kad-dht bootstrap connection cap is lifted above the network size (otherwise only 250 nodes bootstrap), and matrix run names are shortened so the log-reader pod stays under the 63-char name limit.
  • new determinism/diagnostics/quic knobs: seed, strace_logging_mode, model_unblocked_syscall_latency, lsquic_tick_floor_us (needs the tick-floor node image), start_jitter_ms.

Validated at 1000 nodes (kad-dht) against the cluster regression: mplex and yamux both hit 100% delivery. quic is now solved as well: the freeze was a zero-delay tick livelock in the lsquic wrapper (fixed by the tick-floor image + lsquic_tick_floor_us) plus simultaneous-dial collisions from lockstep starts (fixed by start_jitter_ms) - quic@1000 completes in ~1h25m at 100% delivery (600000/600000).

radiken and others added 3 commits July 3, 2026 17:49
The shadow experiment was hardcoded to yamux + static. Expose muxer,
discovery and start_sleep on ExpConfig and wire them into shadow.yaml:
kad-dht restores the bootstrap-0 anchor host + peer NODE_ROLE/SERVICE env
(Shadow resolves it by hostname). Make multi-shadow-gossipsub sweep muxer
and node count via SHADOW_MUXERS/SHADOW_SIZES/SHADOW_DISCOVERY so it can run
the nim-libp2p regression matrix under Shadow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Long matrix names (nodes_1000__muxer_..._disc_kad-dht) pushed the derived
shadow-<run_id>-reader pod name past the k8s 63-char limit, so log collection
failed. Shorten get_name_from_params and cap run_id at 45 chars.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The single bootstrap-0 anchor kept the default MAXCONNECTIONS=250, so at
1000 nodes only ~250 could dial it to bootstrap; the rest failed to join and
exited, failing the sim. Set the bootstrap's cap to num_nodes+100 (matching
the cluster bootstrap).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@radiken radiken self-assigned this Jul 4, 2026
@radiken radiken added the ift IFT commitments label Jul 4, 2026
@radiken radiken added this to DST Jul 4, 2026
@radiken radiken moved this to Recurring in DST Jul 4, 2026
@radiken
radiken marked this pull request as ready for review July 4, 2026 01:37
@radiken
radiken marked this pull request as draft July 4, 2026 13:17
radiken and others added 2 commits July 10, 2026 12:07
Adds four ExpConfig knobs rendered into shadow.yaml / node env:
- seed: recorded explicitly in shadow.yaml (Shadow default 1)
- model_unblocked_syscall_latency: escape hatch for zero-time spin loops
- strace_logging_mode: global syscall logging for small-N diagnosis
- lsquic_tick_floor_us: LSQUIC_TICK_FLOOR_US for the tick-floor node image,
  which fixes the quic livelock (lsquic diff=0 re-arm at one simulated instant)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Lockstep process starts make every peer pair dial each other at the same
simulated instant, forcing simultaneous-dial collisions that never occur on
real hosts. pod-i now starts at 5000 + i*start_jitter_ms ms (default 0 keeps
lockstep).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@radiken
radiken marked this pull request as ready for review July 14, 2026 17:56
Comment thread src/deployments/experiments/libp2p/shadow_gossipsub.py Outdated
Comment thread src/deployments/shadow/builders.py Outdated
Comment thread src/deployments/shadow/builders.py Outdated

@AlbertoSoutullo AlbertoSoutullo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the already mentioned

radiken added a commit that referenced this pull request Jul 16, 2026
Apply Pearson's review suggestion on #316: constrain muxer/discovery to their
valid values with Literal instead of plain str, matching how nimlibp2p.py types them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
radiken added a commit that referenced this pull request Jul 16, 2026
Apply Pearson's review suggestion on #316: constrain muxer/discovery to their
valid values with Literal instead of plain str, matching how nimlibp2p.py types them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@radiken
radiken force-pushed the alan/shadow-regression-infra branch from 2d687e0 to c7e3806 Compare July 16, 2026 14:57
Constrain muxer/discovery to their valid values with Literal instead of plain
str, matching how nimlibp2p.py types them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@radiken
radiken force-pushed the alan/shadow-regression-infra branch from c7e3806 to 6046e82 Compare July 16, 2026 15:00
Pull the peer env and the peer / bootstrap / publisher host construction out of
render_shadow_yaml into small pure functions so each is unit-testable. Output is
unchanged; adds tests for the extracted builders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@radiken
radiken requested a review from PearsonWhite July 17, 2026 14:43
@radiken
radiken merged commit 2075b9f into master Jul 17, 2026
2 checks passed
@radiken
radiken deleted the alan/shadow-regression-infra branch July 17, 2026 20:02
@github-project-automation github-project-automation Bot moved this from Recurring to Done in DST Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ift IFT commitments

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants