Unit tests cover the filter, NACK tracker, egress, and frame-decode paths:
make testThe E2E suite (test/run-e2e.sh) starts a listener instance, injects frames
as unicast UDP directly to the listener's bound port, and verifies delivery via
a sink-test-frames sink. Five scenarios are exercised sequentially:
- Basic delivery: all frames forwarded; verified by sink count and
bsl_frames_forwarded_totalPrometheus metric. - Shard filter:
-shard-include 0passes only the group-0 frame. - Strip-header: on by default, forwards raw payload bytes (the BSV tx);
-strip-header=falseforwards the full frame. Sink counts raw datagrams. - BRC-130 fragmentation: fragmented payloads are reassembled and delivered.
- Reference lane:
-lane-tx,-lane-headerand-lane-blockto three TCP sinks (sink-test-frames -tcp -bytes N). Transaction payloads reach the tx lane, each block announce puts its 80-byte header on the header lane, and announces with no whole block are dropped from the block lane asnot_strippable; verified by sink byte counts and thebsl_lane_*metrics.
sink-test-frames (cmd/sink-test-frames) listens on 127.0.0.1:-port
(default 9102). Over UDP it counts decoded frames, or raw datagrams with
-raw, and exits 0 at -count; with -tcp -bytes N it accepts TCP
connections and exits 0 once N bytes have arrived. It exits 1 if -timeout
(default 30s) passes first. Both targets must be positive to complete: at
the default -count 0, or -bytes 0, it runs until the timeout (exit 1),
or forever with -timeout 0.
The suite requires shard-proxy checked out at ../shard-proxy
(for send-test-frames). make test-e2e builds all binaries fresh before
running:
make test-e2eSee also architecture.md#testing for why unicast injection works.