Under Shadow, lsquic's earliest_adv_tick can return diff=0 mid-handshake; the wrapper then re-arms its tick timer at now, chronos polls with a zero timeout, and simulated time never advances - the sim livelocks at the first quic handshake at any network size (verified at N=10 and N=300..1000). Real hosts self-resolve because real time moves between engine passes. The patch (applied to the resolved lsquic 0.5.4 package at image build) adds an env-switchable floor on the tick re-arm interval and sets es_clock_granularity to match. Unset/0 keeps stock behavior, so the same image can also run unpatched A/Bs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
libp2p GossipSub Test Nodes
This repository contains nim-libp2p, go-libp2p and rust-libp2p based implementations of GossipSub test nodes that can run in both Kubernetes (K8s) and Shadow simulator environments.
Overview
These test nodes are designed for performance testing and evaluation of libp2p's GossipSub protocol under various network conditions. The implementations support:
- Configurable test node parameters
- Kubernetes and shadow deployment
- Multi-transport support (Mplex, Yamux, QUIC)
- Mix protocol support (for nim-libp2p)
- Prometheus metrics collection
- HTTP-based message injection for dynamic test configuration
Node/test-specific details are available in corresponding directories.
How It Works
Peers use random (ID-based) peer selection in the shadow simulator, and a DNS-based peer discovery service in K8s to make target number of connections. After required connections are made, each peer exposes an HTTP endpoint for receiving publish commands from a remote message injector.
Every publisher embeds a timestamp before publishing messages. If fragmentation is required, the publisher breaks messages into desired fragments and embeds fragment numbers. The receiver accumulates fragments and logs the elapsed time.
All peers expose Prometheus metrics for detailed insights.
nim-libp2p Test Node
nim-libp2p test node supports mplex, yamux, and quic transports. It also supports mix protocol for improved anonymity. Use the MOUNTSMIX environment variable to mount mix protocol on any test node. Mix nodes also need to know the available number of mix nodes NUMMIX, and need access to their configuration settings using FILEPATH.
Environment Variables
PEERS— Number of peers in the network (default:100)CONNECTTO— Target number of peers to dial (default:10)MUXER— Stream multiplexer: supports QUIC, yamux and mplex (default:yamux)FRAGMENTS— Number of message fragments (default:1)SHADOWENV— Whether running in shadow simulator (default:false)SELFTRIGGER— Self trigger in GossipSub parameters (default:true)SERVICE— K8s service name for peer discovery (default:nimp2p-service)MAXCONNECTIONS— Maximum number of peers to connect with (default:250)MOUNTSMIX— Running as a mix node (default:false)USESMIX— Participate in mix network (default:false)NUMMIX— Number of mix network peers (default:0)MIXD— Number of mix tunnels to traverse (default:4)FILEPATH— Path of mix node configurations (default:./)
Building
git clone https://github.com/vacp2p/dst-libp2p-test-node.git
cd dst-libp2p-test-node
# Build Docker image
docker build -t nim-libp2p-test .
docker tag nim-libp2p-test user/refactored-test-node:vx.x
# Extract binary for Shadow
docker create --name temp nim-libp2p-test
docker cp temp:/node/main shadow/main
docker rm temp
Deployment
Please see K8s deployment utilities for K8s deployments. See shadow directory for shadow simulator experiments.