From 3d7cbde4b350d10ccb4164fe79377fddf668e203 Mon Sep 17 00:00:00 2001 From: ch4r10t33r Date: Sun, 12 Apr 2026 16:55:26 +0100 Subject: [PATCH] build,docs: remove unused vendor/lsquic_zig The build already depends only on zquic (build.zig / build.zig.zon); the lsquic+BoringSSL vendor tree was dead code. Drop vendor/ and the vendor path from build.zig.zon; refresh README, UPSTREAM, CI label, and justfile for zquic-only QUIC. --- .github/workflows/ci.yml | 2 +- README.md | 27 ++- UPSTREAM.md | 17 +- build.zig.zon | 1 - justfile | 2 +- src/transport/zquic_quic_shim.zig | 2 +- vendor/lsquic_zig/build.zig | 232 -------------------------- vendor/lsquic_zig/build.zig.zon | 36 ---- vendor/lsquic_zig/lsquic_ethp2p_ext.h | 36 ---- vendor/lsquic_zig/patch_uni.sh | 30 ---- 10 files changed, 19 insertions(+), 366 deletions(-) delete mode 100644 vendor/lsquic_zig/build.zig delete mode 100644 vendor/lsquic_zig/build.zig.zon delete mode 100644 vendor/lsquic_zig/lsquic_ethp2p_ext.h delete mode 100644 vendor/lsquic_zig/patch_uni.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b90b9ed..6c4c699 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,7 +103,7 @@ jobs: version: ${{ env.ZIG_VERSION }} # `timeout` (coreutils) fails the step with 124 if the build or test binary never finishes. - - name: QUIC transport tests (in-repo lsquic + BoringSSL) + - name: QUIC transport tests (zquic) run: timeout 40m zig build test-quic --summary all large-network-rs: diff --git a/README.md b/README.md index 21236b3..9ccdb53 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # zig-ethp2p -Zig helpers for the wire formats of **[ethp2p](https://github.com/ethp2p/ethp2p)** — the reference implementation is **[github.com/ethp2p/ethp2p](https://github.com/ethp2p/ethp2p)** ([specs directory](https://github.com/ethp2p/ethp2p/tree/main/specs)). This repo tracks that code and the protobuf definitions under `broadcast/pb`, `protocol/pb`, and `broadcast/rs/pb`. **QUIC** transport (TLS 1.3, ALPN `eth-ec-broadcast`, unidirectional streams) is always compiled via **lsquic + BoringSSL** (no build flags needed); see [QUIC transport](#quic-transport-lsquic-build). +Zig helpers for the wire formats of **[ethp2p](https://github.com/ethp2p/ethp2p)** — the reference implementation is **[github.com/ethp2p/ethp2p](https://github.com/ethp2p/ethp2p)** ([specs directory](https://github.com/ethp2p/ethp2p/tree/main/specs)). This repo tracks that code and the protobuf definitions under `broadcast/pb`, `protocol/pb`, and `broadcast/rs/pb`. **QUIC** transport (TLS 1.3, ALPN `eth-ec-broadcast`, unidirectional streams) is built on pure-Zig **[zquic](https://github.com/ch4r10t33r/zquic)** via `build.zig.zon` (no alternate stack); see [QUIC transport](#quic-transport-zquic). ## Implementation status (vs reference) @@ -39,7 +39,7 @@ Zig helpers for the wire formats of **[ethp2p](https://github.com/ethp2p/ethp2p) | `PartialMessagesExtension` (nested in `RPC.partial`) | libp2p `rpc.proto` field 10 body | `encodePartialMessagesExtension`, `decodePartialMessagesExtensionOwned` | | Unsigned-varint length prefix before `RPC` body | common libp2p framing | `encodeRpcLengthPrefixed`, `decodeRpcLengthPrefixedPrefix` | | In-process duplex for length-prefixed `RPC` (simnet-style, no TCP/QUIC) | pair of `Endpoint`s over bounded byte queues | `sim.gossipsub_rpc_host` (`Link`, `Endpoint.sendRpc` / `recvRpcOwned`) | -| QUIC transport + UNI stream alignment | [`sim/host.go`](https://github.com/ethp2p/ethp2p/blob/main/sim/host.go), `peer.go`, `peer_ctrl.go`, `peer_in.go` | `transport.eth_ec_quic`: IETF QUIC, TLS 1.3, ALPN `eth-ec-broadcast`, **unidirectional** BCAST/SESS/CHUNK streams matching `OpenUniStream`/`AcceptUniStream`; `PeerConn` + `broadcast.engine_quic` (`EngineQuicHost`) wire inbound SESS/CHUNK into `Engine` / `ChannelRs`. See [QUIC transport](#quic-transport-lsquic-build). | +| QUIC transport + UNI stream alignment | [`sim/host.go`](https://github.com/ethp2p/ethp2p/blob/main/sim/host.go), `peer.go`, `peer_ctrl.go`, `peer_in.go` | `transport.eth_ec_quic`: IETF QUIC, TLS 1.3, ALPN `eth-ec-broadcast`, **unidirectional** BCAST/SESS/CHUNK streams matching `OpenUniStream`/`AcceptUniStream`; `PeerConn` + `broadcast.engine_quic` (`EngineQuicHost`) wire inbound SESS/CHUNK into `Engine` / `ChannelRs`. See [QUIC transport](#quic-transport-zquic). | | **Still open** | — | [Pending work](#pending-work) | ## Scope on `main` (at a glance) @@ -52,29 +52,28 @@ This is **what is already implemented** — not the backlog. Per-module mapping - **EC scheme id:** `layer.ec_scheme` (`EcSchemeKind`, `"reed-solomon"` wire name); only Reed–Solomon is wired end-to-end ([#14](https://github.com/ch4r10t33r/zig-ethp2p/issues/14) tracks RLNC and further schemes). - **Abstract RS mesh:** heap-backed graphs and `PeerSessionStats` (`sim.rs_mesh`): 2-node, 4-node ring, 6-node `TestNetwork`-style topology, **partition/heal** line test, chunk-len variant; with `ZIG_ETHP2P_STRESS=1`, larger six-node budget plus **8-** and **16-node** rings. - **Gossipsub (sim / wire helpers):** transport, protocol, broadcast, interop, `RPC` encode/decode (including **`partial`** / `PartialMessagesExtension`), full `ControlMessage`, varint length prefix, in-process **`gossipsub_rpc_host`** for tests (`sim.gossipsub_*`, `broadcast.gossip`). -- **QUIC:** `transport.eth_ec_quic` — IETF QUIC, TLS 1.3, ALPN `eth-ec-broadcast`, **unidirectional** BCAST/SESS/CHUNK streams matching the ethp2p Go reference (`peer.go` `OpenUniStream`/`AcceptUniStream`). `PeerConn` is poll-driven; `broadcast.engine_quic.EngineQuicHost` connects inbound streams to the RS channel path. See [QUIC transport](#quic-transport-lsquic-build). -- **CI:** aligned with [ethp2p's `ci.yml`](https://github.com/ethp2p/ethp2p/blob/main/.github/workflows/ci.yml): `zig build test-broadcast`, `test-sim-rs`, `test-sim-gossipsub` (Debug + TSan), `test-quic` (**`quic-transport`** job: vendored TLS, **45m** job timeout + **`timeout 40m`** on the command so a hung poll loop cannot exhaust the runner), `test-stress-ci` on **`main` only**, plus lint (`zig fmt --check`, `zig build`, `zig ast-check`). `build.zig.zon` **`minimum_zig_version`** must match workflow **`ZIG_VERSION`**; `just check-zig-ci-align` checks that locally. +- **QUIC:** `transport.eth_ec_quic` — IETF QUIC, TLS 1.3, ALPN `eth-ec-broadcast`, **unidirectional** BCAST/SESS/CHUNK streams matching the ethp2p Go reference (`peer.go` `OpenUniStream`/`AcceptUniStream`). `PeerConn` is poll-driven; `broadcast.engine_quic.EngineQuicHost` connects inbound streams to the RS channel path. See [QUIC transport](#quic-transport-zquic). +- **CI:** aligned with [ethp2p's `ci.yml`](https://github.com/ethp2p/ethp2p/blob/main/.github/workflows/ci.yml): `zig build test-broadcast`, `test-sim-rs`, `test-sim-gossipsub` (Debug + TSan), `test-quic` (**`quic-transport`** job: **45m** job timeout + **`timeout 40m`** on the command so a hung poll loop cannot exhaust the runner), `test-stress-ci` on **`main` only**, plus lint (`zig fmt --check`, `zig build`, `zig ast-check`). `build.zig.zon` **`minimum_zig_version`** must match workflow **`ZIG_VERSION`**; `just check-zig-ci-align` checks that locally. - **One-shot local verification:** `zig build test` runs the full suite. -## QUIC transport (lsquic build) +## QUIC transport (zquic) -lsquic + BoringSSL are always compiled — no build flag is needed. **Windows** targets are not supported (lsquic_zig build is Linux/macOS focused). +**[zquic](https://github.com/ch4r10t33r/zquic)** is pulled as a Zig package dependency (`build.zig.zon`); there is no C QUIC stack in this repo. **Windows** targets are not supported (same constraint as `build.zig`). **Layout** | Piece | Role | |-------|------| -| `build.zig` | Always pulls **`lsquic_zig`** (LiteSpeed **lsquic** + **BoringSSL**), exposes Zig module `quic` rooted at `src/transport/lsquic_quic_shim.zig`, links **zlib** (+ **pthread** / **m** on Unix). | -| `lsquic_quic_shim.zig` | Endpoint/connection/stream API: UDP I/O, `poll`, `connect`, `tryAccept`, `handshakeComplete`, `streamMake` (bidi), `streamMakeUni` (UNI), `tryAcceptIncomingUniStream`, stream read/write/cancel helpers. | +| `build.zig` | Resolves **`zquic`**, exposes Zig module `quic` rooted at `src/transport/zquic_quic_shim.zig` (thin wrapper over zquic I/O). | +| `zquic_quic_shim.zig` | Endpoint/connection/stream API: UDP I/O, `poll`, `connect`, `tryAccept`, `handshakeComplete`, `streamMake` (bidi), `streamMakeUni` (UNI), `tryAcceptIncomingUniStream`, stream read/write/cancel helpers. | | `eth_ec_quic_common.zig` / `eth_ec_quic_enabled.zig` | Shared config and ALPN string; **enabled** path implements `listenImpl` / `dialImpl` and integration tests. | -| `eth_ec_quic.zig` | Public `transport.eth_ec_quic`: `listen`, `dial`, `logInit` (programmatic lsquic logger), listener wrapper. | +| `eth_ec_quic.zig` | Public `transport.eth_ec_quic`: `listen`, `dial`, `logInit` (reserved no-op for future zquic hooks), listener wrapper. | | `eth_ec_quic_peer.zig` | `PeerConn` poll-driven state machine: `idle → handshaking → active → closed`; symmetric BCAST UNI handshake + `runAcceptLoop` dispatch by protocol selector byte. | | `broadcast/engine_quic.zig` | `EngineQuicHost`: SESS `session_open` → `ChannelRs.attachRelaySession`, CHUNK → `relayIngestChunkVerifiedEngine` (issue #37). | -| `vendor/lsquic_zig/patch_uni.sh` | Build-time patch that removes `static` from `create_uni_stream_out` in lsquic and appends a public `lsquic_conn_make_uni_stream()` wrapper (lsquic 4.3 has no public API for outgoing UNI streams). | **Operation** -Callers must **drive the engine**: after I/O, use **`quic.poll(endpoint, timeout_ms)`**. For `timeout_ms == 0` (tight loops), the shim advances wall clock using **`lsquic_engine_earliest_adv_tick`** (capped micro-sleep) so PTO-style timers can fire. +Callers must **drive the stack**: after scheduling work, use **`quic.poll(endpoint, timeout_ms)`** so UDP receive, TLS, and QUIC state machines run (see `zquic_quic_shim.zig`). **Unidirectional streams** @@ -82,12 +81,12 @@ All ethp2p application protocols use UNI streams — both peers independently op **TLS notes** -- **Ed25519 server certs:** BoringSSL's default TLS 1.3 client handshake may omit Ed25519; the client **`SSL_CTX`** sets **`SSL_CTX_set_verify_algorithm_prefs`** so Ed25519 certificates work (otherwise TLS alert 40). +- **Test certs:** `eth_ec_quic_test_certs.zig` embeds Ed25519 material; zquic’s TLS must accept the same algorithms as the Go reference for those identities. - **SNI:** Clients should pass a hostname that matches the server certificate (see `eth_ec_quic_test_certs.zig` for embedded test identity). **Debugging** -Call **`quic.logInit("debug")`** (or any `lsquic_set_log_level` level) to enable lsquic's stderr logger programmatically. Alternatively, set the env var **`ZIG_ETHP2P_LSQUIC_LOG=1`** (or **`LSQUIC_LOG_LEVEL`**) before the first `listen`/`dial`; the shim picks that up on first use. +`quic.logInit` is currently a **no-op** (zquic has no global log level API wired here yet). ## Pending work @@ -109,7 +108,7 @@ zig build test-stress # `ZIG_ETHP2P_STRESS=1` (longer RS mesh + 8-/16-node zig build test-broadcast # CI split: wire + layer + broadcast (TSan) zig build test-sim-rs # CI split: RS mesh (TSan) zig build test-sim-gossipsub -zig build test-quic # lsquic + BoringSSL handshake / transport tests; CI `quic-transport` +zig build test-quic # zquic handshake / transport tests; CI `quic-transport` zig build test-stress-ci # full suite + stress + TSan (same as `large-network-rs` on main) ``` diff --git a/UPSTREAM.md b/UPSTREAM.md index 9995d75..0ad8c66 100644 --- a/UPSTREAM.md +++ b/UPSTREAM.md @@ -54,7 +54,7 @@ When updating: ## QUIC / UDP transport -`src/transport/eth_ec_quic.zig` mirrors **ALPN** `eth-ec-broadcast` and high-level **quic-go-style** limits from ethp2p `sim/host.go`. lsquic + BoringSSL are always linked via `vendor/lsquic_zig` (no build flag needed). +`src/transport/eth_ec_quic.zig` mirrors **ALPN** `eth-ec-broadcast` and high-level **quic-go-style** limits from ethp2p `sim/host.go`. The implementation uses pure-Zig **[zquic](https://github.com/ch4r10t33r/zquic)** (`build.zig.zon` dependency); there is no vendored C QUIC/TLS stack in this repository. ### Why raw QUIC and why unidirectional streams @@ -74,21 +74,10 @@ The ethp2p reference uses **unidirectional** QUIC streams for all application pr Zig alignment: -- `lsquic_quic_shim.zig` detects stream type via `lsquic_stream_id() & 0x2` (bit 1 = unidirectional per RFC 9000 §2.1) -- `incoming_uni_streams` queue holds peer-initiated UNI streams; `tryAcceptIncomingUniStream` pops them -- `streamMakeUni` opens an outgoing UNI stream via `lsquic_conn_make_uni_stream` +- `zquic_quic_shim.zig` classifies incoming streams by QUIC stream ID (client vs server stream numbering per RFC 9000; bidi vs uni queues) and exposes `tryAcceptIncomingUniStream` for peer-initiated UNI streams +- `streamMakeUni` opens an outgoing UNI stream via zquic - `eth_ec_quic_peer.zig` implements the `PeerConn` poll-driven state machine (handshake + accept-loop); `broadcast/engine_quic.zig` (`EngineQuicHost`) forwards inbound SESS/CHUNK into `Engine` / `ChannelRs` (#37) -### lsquic vendor patch - -lsquic 4.3 has no public API for user-initiated outgoing unidirectional streams (`lsquic_conn_make_stream` always creates bidirectional streams). The internal `create_uni_stream_out` function in `lsquic_full_conn_ietf.c` is `static`. - -Fix: `vendor/lsquic_zig/build.zig` runs `vendor/lsquic_zig/patch_uni.sh` as a build step. The script: -1. Removes `static` from `create_uni_stream_out` in a patched copy of `lsquic_full_conn_ietf.c` -2. Appends a public `lsquic_conn_make_uni_stream(lsquic_conn_t *)` wrapper at the end of the file - -The public declaration lives in `vendor/lsquic_zig/lsquic_ethp2p_ext.h`. The upstream source file is untouched. - ### libp2p boundary The ethp2p `sim/` QUIC transport is illustrative. Production deployments layer **libp2p** on top (Noise handshake, multistream-select, Yamux multiplexer, identify protocol). That layer is out of scope for `zig-ethp2p`; zeam handles it via **rust-libp2p**. diff --git a/build.zig.zon b/build.zig.zon index c4e9e6c..2003912 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -8,7 +8,6 @@ "build.zig.zon", "src", "proto", - "vendor", "UPSTREAM.md", "README.md", "LICENSE", diff --git a/justfile b/justfile index 1df332f..d0cca72 100644 --- a/justfile +++ b/justfile @@ -23,7 +23,7 @@ test-sim-rs: test-sim-gossipsub: zig build test-sim-gossipsub --summary all -# QUIC transport tests (lsquic + BoringSSL); same as CI job `quic-transport`. +# QUIC transport tests (zquic); same as CI job `quic-transport`. test-quic: zig build test-quic --summary all diff --git a/src/transport/zquic_quic_shim.zig b/src/transport/zquic_quic_shim.zig index 9795022..2bc53df 100644 --- a/src/transport/zquic_quic_shim.zig +++ b/src/transport/zquic_quic_shim.zig @@ -20,7 +20,7 @@ pub const QuicConfig = struct { }; pub fn logInit(_: []const u8) void { - // zquic has no global log level API comparable to lsquic; keep hook for callers. + // Reserved for future zquic logging hooks; keep signature for callers. } pub const QuicEndpoint = struct { diff --git a/vendor/lsquic_zig/build.zig b/vendor/lsquic_zig/build.zig deleted file mode 100644 index a1b14df..0000000 --- a/vendor/lsquic_zig/build.zig +++ /dev/null @@ -1,232 +0,0 @@ -const std = @import("std"); - -pub fn build(b: *std.Build) void { - const target = b.standardTargetOptions(.{}); - const optimize = b.standardOptimizeOption(.{}); - - const upstream = b.dependency("lsquic", .{ - .target = target, - .optimize = optimize, - }); - const boringssl = b.dependency("boringssl", .{ - .target = target, - .optimize = optimize, - }); - const lshpack_dep = b.dependency("lshpack", .{ - .target = target, - .optimize = optimize, - }); - const lsqpack_dep = b.dependency("lsqpack", .{ - .target = target, - .optimize = optimize, - }); - - const ssl = boringssl.artifact("ssl"); - const crypto = boringssl.artifact("crypto"); - - const lib = b.addLibrary(.{ - .name = "lsquic", - .linkage = .static, - - .root_module = b.createModule( - .{ - .target = target, - .optimize = optimize, - .link_libc = true, - }, - ), - }); - - var c_flags: std.ArrayList([]const u8) = .empty; - - c_flags.appendSlice(b.allocator, &.{ - "-DLSQUIC_DEBUG_NEXT_ADV_TICK=1", - "-DLSQUIC_CONN_STATS=1", - "-DLSQUIC_DEVEL=1", - "-DLSQUIC_WEBTRANSPORT_SERVER_SUPPORT=1", - // When using the Zig ReleaseSafe mode, it seems force to check for undefined behavior. - // This is not the case with ReleaseSmall or ReleaseFast. So we must add this flag - // to avoid the build failing with ReleaseSafe. - "-fno-sanitize=undefined", - }) catch @panic("OOM"); - - if (optimize == .Debug) { - c_flags.appendSlice(b.allocator, &.{ "-O0", "-g3" }) catch @panic("OOM"); - } else { - c_flags.appendSlice(b.allocator, &.{ "-O3", "-g0" }) catch @panic("OOM"); - } - - if (target.result.os.tag == .windows) { - // When we have a windows test environment, we can enable these flags. - // lib.addIncludePath(upstream.path("wincompat")); - // c_flags.appendSlice(&.{ - // "/W4", "/WX", - // "-DWIN32_LEAN_AND_MEAN", "-DNOMINMAX", - // "-D_CRT_SECURE_NO_WARNINGS", "/wd4100", - // "/wd4115", "/wd4116", - // "/wd4146", "/wd4132", - // "/wd4200", "/wd4204", - // "/wd4244", "/wd4245", - // "/wd4267", "/wd4214", - // "/wd4295", "/wd4324", - // "/wd4334", "/wd4456", - // "/wd4459", "/wd4706", - // "/wd4090", "/wd4305", - // }) catch @panic("OOM"); - } else { - c_flags.appendSlice(b.allocator, &.{ - // Lifted from lsquic's CMakeLists.txt - // Source: https://github.com/litespeedtech/lsquic/blob/70486141724f85e97b08f510673e29f399bbae8f/CMakeLists.txt#L52-L53 - "-Wall", - "-Wextra", - "-Wno-unused-parameter", - "-fno-omit-frame-pointer", - }) catch @panic("OOM"); - } - - // --- Linking and Paths --- - lib.linkLibC(); - lib.linkLibrary(ssl); - lib.linkLibrary(crypto); - - if (target.result.os.tag == .windows) { - // Uncomment these when we have a windows test environment. - // lib.linkSystemLibrary("ws2_32"); - } else { - lib.linkSystemLibrary("m"); - lib.linkSystemLibrary("pthread"); - } - - lib.addIncludePath(upstream.path("include")); - lib.addIncludePath(lshpack_dep.path("")); - lib.addIncludePath(lsqpack_dep.path("")); - lib.addIncludePath(lshpack_dep.path("deps/xxhash")); - - lib.installHeadersDirectory( - upstream.path("include"), - "", - .{ .include_extensions = &.{".h"} }, - ); - lib.installHeader(lsqpack_dep.path("lsqpack.h"), "lsqpack/lsqpack.h"); - lib.installHeader(lshpack_dep.path("lshpack.h"), "lshpack/lshpack.h"); - lib.installHeader(lshpack_dep.path("deps/xxhash/xxhash.h"), "xxhash.h"); - lib.root_module.addCMacro("XXH_HEADER_NAME", "\"xxhash.h\""); - - // Patch lsquic_full_conn_ietf.c to expose create_uni_stream_out as a - // non-static symbol and append a public lsquic_conn_make_uni_stream() - // wrapper. The patched copy lives in the Zig output cache; the - // original upstream file is untouched. - const patch_run = b.addSystemCommand(&.{"sh"}); - patch_run.addFileArg(b.path("patch_uni.sh")); - patch_run.addFileArg(upstream.path("src/liblsquic/lsquic_full_conn_ietf.c")); - const patched_ietf = patch_run.addOutputFileArg("lsquic_full_conn_ietf.c"); - - lib.addCSourceFiles(.{ - .root = upstream.path("src/liblsquic"), - .files = lsquic_files_no_ietf, - .flags = c_flags.items, - }); - // Add the patched IETF full-connection source with the same include paths - // as the rest of lsquic (both the public include/ and the internal src/). - lib.addCSourceFile(.{ .file = patched_ietf, .flags = c_flags.items }); - lib.addIncludePath(upstream.path("src/liblsquic")); - - lib.addCSourceFile(.{ .file = lsqpack_dep.path("lsqpack.c"), .flags = c_flags.items }); - lib.addCSourceFile(.{ .file = lshpack_dep.path("lshpack.c"), .flags = c_flags.items }); - lib.addCSourceFile(.{ .file = lshpack_dep.path("deps/xxhash/xxhash.c"), .flags = c_flags.items }); - - // Install the zig-ethp2p extension header alongside lsquic's own headers. - lib.installHeader(b.path("lsquic_ethp2p_ext.h"), "lsquic_ethp2p_ext.h"); - - b.installArtifact(lib); - - const test_step = b.step("test", "Run unit tests"); - _ = test_step; -} - -// lsquic_full_conn_ietf.c is excluded here; a patched copy is compiled -// separately (see patch_run above) to expose create_uni_stream_out. -const lsquic_files_no_ietf: []const []const u8 = &.{ - "ls-sfparser.c", - "lsquic_adaptive_cc.c", - "lsquic_alarmset.c", - "lsquic_arr.c", - "lsquic_attq.c", - "lsquic_bbr.c", - "lsquic_bw_sampler.c", - "lsquic_cfcw.c", - "lsquic_chsk_stream.c", - "lsquic_conn.c", - "lsquic_crand.c", - "lsquic_crt_compress.c", - "lsquic_crypto.c", - "lsquic_cubic.c", - "lsquic_di_error.c", - "lsquic_di_hash.c", - "lsquic_di_nocopy.c", - "lsquic_enc_sess_common.c", - "lsquic_enc_sess_ietf.c", - "lsquic_eng_hist.c", - "lsquic_engine.c", - "lsquic_ev_log.c", - "lsquic_frab_list.c", - "lsquic_frame_common.c", - "lsquic_frame_reader.c", - "lsquic_frame_writer.c", - "lsquic_full_conn.c", - "lsquic_global.c", - "lsquic_handshake.c", - "lsquic_hash.c", - "lsquic_hcsi_reader.c", - "lsquic_hcso_writer.c", - "lsquic_headers_stream.c", - "lsquic_hkdf.c", - "lsquic_hpi.c", - "lsquic_hspack_valid.c", - "lsquic_http.c", - "lsquic_http1x_if.c", - "lsquic_logger.c", - "lsquic_malo.c", - "lsquic_min_heap.c", - "lsquic_mini_conn.c", - "lsquic_mini_conn_ietf.c", - "lsquic_minmax.c", - "lsquic_mm.c", - "lsquic_pacer.c", - "lsquic_packet_common.c", - "lsquic_packet_gquic.c", - "lsquic_packet_in.c", - "lsquic_packet_out.c", - "lsquic_packet_resize.c", - "lsquic_parse_Q046.c", - "lsquic_parse_Q050.c", - "lsquic_parse_common.c", - "lsquic_parse_gquic_be.c", - "lsquic_parse_gquic_common.c", - "lsquic_parse_ietf_v1.c", - "lsquic_parse_iquic_common.c", - "lsquic_pr_queue.c", - "lsquic_purga.c", - "lsquic_qdec_hdl.c", - "lsquic_qenc_hdl.c", - "lsquic_qlog.c", - "lsquic_qpack_exp.c", - "lsquic_rechist.c", - "lsquic_rtt.c", - "lsquic_send_ctl.c", - "lsquic_senhist.c", - "lsquic_set.c", - "lsquic_sfcw.c", - "lsquic_shsk_stream.c", - "lsquic_spi.c", - "lsquic_stock_shi.c", - "lsquic_str.c", - "lsquic_stream.c", - "lsquic_tokgen.c", - "lsquic_trans_params.c", - "lsquic_trechist.c", - "lsquic_util.c", - "lsquic_varint.c", - "lsquic_version.c", - "lsquic_xxhash.c", -}; diff --git a/vendor/lsquic_zig/build.zig.zon b/vendor/lsquic_zig/build.zig.zon deleted file mode 100644 index 6eecfff..0000000 --- a/vendor/lsquic_zig/build.zig.zon +++ /dev/null @@ -1,36 +0,0 @@ -.{ - .name = .lsquic, - - .version = "0.0.0", - .fingerprint = 0x91bb79d376e0ee8c, - .minimum_zig_version = "0.15.0", - - .dependencies = .{ - .lsquic = .{ - .url = "git+https://github.com/litespeedtech/lsquic#aecfcefa422505929ba29071442785a884571126", - .hash = "N-V-__8AAALQZACNAeMe8qEYieQId_sO9YzLbIyJyVwryHz_", - }, - .boringssl = .{ - .url = "git+https://github.com/Syndica/boringssl-zig#c53df00d06b02b755ad88bbf4d1202ed9687b096", - .hash = "boringssl-0.1.0-VtJeWehMAAA4RNnwRnzEvKcS9rjsR1QVRw1uJrwXxmVK", - }, - .zlib = .{ - .url = "git+https://github.com/allyourcodebase/zlib#c5115f4b69ef660f72a835c6638f80508ef284c7", - .hash = "zlib-1.3.1-1-ZZQ7ldENAAA7qJjUXP6E6xnRuV-jDL9dyoJFc_eb3zQ6", - }, - .lshpack = .{ - .url = "git+https://github.com/litespeedtech/ls-hpack#8905c024b6d052f083a3d11d0a169b3c2735c8a1", - .hash = "N-V-__8AAFo5VQCMGNos53oUbtdyzgRTdBedy52h5FsecO51", - }, - .lsqpack = .{ - .url = "git+https://github.com/litespeedtech/ls-qpack#1e9c5b8e59f8161c54f168a570c8bfdc59ded0c3", - .hash = "N-V-__8AAKHvVgBsNJVDKKVAFfD0XLyv3NZA7q19Lkm6ozff", - }, - }, - - .paths = .{ - "build.zig", - "build.zig.zon", - "src", - }, -} diff --git a/vendor/lsquic_zig/lsquic_ethp2p_ext.h b/vendor/lsquic_zig/lsquic_ethp2p_ext.h deleted file mode 100644 index 405cd7e..0000000 --- a/vendor/lsquic_zig/lsquic_ethp2p_ext.h +++ /dev/null @@ -1,36 +0,0 @@ -/* lsquic_ethp2p_ext.h -- zig-ethp2p extensions to the lsquic public API. - * - * These declarations cover capabilities that are internal to lsquic but - * needed for non-HTTP unidirectional QUIC stream support (BCAST/SESS/CHUNK - * protocols used by github.com/ethp2p/ethp2p). - */ -#ifndef LSQUIC_ETHP2P_EXT_H -#define LSQUIC_ETHP2P_EXT_H - -#include "lsquic.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Open a new outbound unidirectional stream on `conn`. - * - * Analogous to lsquic_conn_make_stream() but uses the QUIC unidirectional - * stream namespace (client-initiated IDs 2, 6, 10 … or server-initiated - * IDs 3, 7, 11 …, depending on which side this connection represents). - * - * The on_new_stream callback fires synchronously before this function - * returns; the resulting stream context is write-only (the read side always - * yields EOF to the opener). - * - * Returns 0 on success, -1 on allocation failure. - * Must only be called after the QUIC handshake is complete. - */ -int lsquic_conn_make_uni_stream(lsquic_conn_t *conn); - -#ifdef __cplusplus -} -#endif - -#endif /* LSQUIC_ETHP2P_EXT_H */ diff --git a/vendor/lsquic_zig/patch_uni.sh b/vendor/lsquic_zig/patch_uni.sh deleted file mode 100644 index 4d048cb..0000000 --- a/vendor/lsquic_zig/patch_uni.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# patch_uni.sh -# -# Patches lsquic_full_conn_ietf.c to: -# 1. Remove 'static' from create_uni_stream_out so it can be called externally. -# 2. Append a public lsquic_conn_make_uni_stream() wrapper at the end of the file. -# -# awk replaces the 'static int' line that immediately precedes create_uni_stream_out, -# leaving all other 'static int' functions unchanged. -awk ' -/^static int$/ { pending = 1; buf = $0; next } -pending && /^create_uni_stream_out/ { print "int"; pending = 0 } -pending { print buf; pending = 0 } -{ print } -' "$1" > "$2" - -cat >> "$2" <<'EOF' - -/* zig-ethp2p extension: public wrapper for non-HTTP unidirectional stream creation. - * Exposes create_uni_stream_out (now non-static above) so callers outside this - * translation unit can open outbound UNI streams without HTTP/3. */ -int -lsquic_conn_make_uni_stream (lsquic_conn_t *lconn) -{ - struct ietf_full_conn *const conn = (struct ietf_full_conn *) lconn; - return create_uni_stream_out(conn, 0, - conn->ifc_enpub->enp_stream_if, - conn->ifc_enpub->enp_stream_if_ctx); -} -EOF