Skip to content
dream-net

dream-netChangelog

Changelog

Every release of dream-net, newest first. A release marked unreleased is declared in mod.toml and published when its tag is pushed.

Releases

5 declared

  1. 2.1.0 stable 2026-11-19

    Fixes AEAD nonce reuse in the netcode handshake (GHSA-8mrq-q9c6-h23v) by moving to netcode 1.5.0 and the NETCODE 1.03 protocol. 2.1.0 peers do not connect to 2.0.0 or 1.x peers: upgrade servers and clients together.

    Breaking changes

    • The netcode protocol is NETCODE 1.03, where 2.0.0 and every 1.x release speak NETCODE 1.02. Peers of the two never connect: a server ignores the other protocol’s connection requests, so the client’s attempt ends with ConnectFailed { reason: TimedOut }. dream-net’s own wire format is unchanged.

    Changed

    • The vendored C netcode is v1.5.0 (from v1.4.10), with the same three local patches. Every connection attempt draws a fresh client salt, every server mapping a fresh nonce, and the packet keys are derived from them and the token’s keys, so no two attempts or servers ever share a key.
    • A client no longer refuses a token it already passed to connect in the same process. That was 2.0.0’s stopgap for this advisory; netcode now makes a token used twice safe, and the server enforces one attempt per token, holding an unfinished token only for the address and salt that first presented it, for the token’s timeout. Still mint a new token for every attempt.

    Fixed

    • GHSA-8mrq-q9c6-h23v: with netcode 1.4.10 and earlier, a retried unfinished handshake with the same connect token, or one token listing several servers, could encrypt different packets under the same key and nonce, which exposes plaintext and allows forging those packets. 2.0.0 blocked the retried handshake within one process only; 1.x did not block it at all.
    dream-net 2.1.0 491.80 kB · crates.io
    View on crates.io
    Verify · sha256 9889d5757fb3…fe331458
    File
    dream-net-2.1.0.crate
    Size
    503602 bytes
    SHA-256
    9889d5757fb3d7fe2000dd0c0a7e01d94b0ad8cacdab4247da0aaba4fe331458

    The same digest as the crates.io index's checksum, which Cargo checks on every download.

  2. 2.0.0 stable 2026-11-19

    The transport now runs on Más Bandwidth’s C netcode and reliable, vendored and compiled in, with single-use connect tokens and restart protection. The wire format is unchanged, so 2.0.0 and 1.x peers still connect to each other.

    Breaking changes

    • Building needs Clang 18 or newer (Apple Clang 16 on macOS): build.rs compiles the vendored C and refuses GCC, MSVC’s cl and fast-math flags rather than fall back. The crate declares links = "dream_net_native".
    • The minimum Rust version is 1.95.
    • Error::Netcode and generate_connect_token now carry NetcodeError, dream-net’s own type with the same variants and texts as netcode-official’s Error plus InvalidConnectTokenLifetime. Code that named or matched the old type must use NetcodeError.
    • TransportConfig::reliable_config returns ReliableConfig and Connection::reliable_counters returns &ReliableCounters, dream-net’s own types, in place of the reliable crate’s Config and Counters.
    • TransportConfig::validate refuses sent_packets_buffer_size and received_packets_buffer_size above 16384, the C reliable’s limit; 1.1.1 allowed 32768.
    • Connect tokens are single use: a client refuses a token already passed to connect in the same process, and a server refuses one that already established a session there, even after that session ended.
    • A server refuses tokens that expire within its maximum token lifetime (30 seconds by default) of its start, so a token minted before a restart cannot open a second session; a 30-second token minted in the server’s start second is refused too.

    Added

    • NetcodeError, ReliableConfig and ReliableCounters.
    • Server::with_max_token_lifetime and DEFAULT_MAX_CONNECT_TOKEN_LIFETIME, to set the token lifetime the start floor is built on.

    Changed

    • netcode-official, reliable and serialize-official are gone from the dependency graph. The vendored C (netcode v1.4.10 with three local patches, reliable v1.4.6, and netcode’s libsodium subset) is pinned file by file and checked against upstream. The wire format is written by dream-net’s own safe Rust and is byte-for-byte unchanged.
    • The license expression is (MIT OR Apache-2.0) AND BSD-3-Clause AND ISC: dream-net’s own code is unchanged, and the vendored C carries its own terms. NOTICE.md reproduces every notice.
    • MemoryUsage::reliable is now an upper bound on reliable’s endpoint, about 581 KB with the default TransportConfig, almost all of it fragment reassembly an idle connection does not hold.
    • A server holds its port exclusively on every platform: it fails to start when any other socket holds the port, and nothing can bind the port on one of its addresses afterwards. Windows allowed both before.
    • A client that finds a schema or protocol mismatch reports ConnectFailed at once, but keeps its session for mismatch_linger seconds, sending only its hello, so the server can report the mismatch too.

    Fixed

    • A server could report nothing for a client with a mismatched schema, when the client’s hello and its disconnect arrived in the same update. 1.1.1 has the same gap.
    • On Windows a server could start on a port another program held on one address, and lose the traffic for that address to it without an error.
    • On Windows the cause of a socket failure, such as a port in use, was lost before it reached Error::Netcode.
    dream-net 2.0.0 488.06 kB · crates.io
    View on crates.io
    Verify · sha256 cf275903fc5b…2d5833a5
    File
    dream-net-2.0.0.crate
    Size
    499772 bytes
    SHA-256
    cf275903fc5b767d2e89c6d3e3a0a19215f3514908649315f6405bc22d5833a5

    The same digest as the crates.io index's checksum, which Cargo checks on every download.

  3. 1.1.1 stable 2026-11-05

    Requires a ctutils with RUSTSEC-2026-0385 fixed, for the constant-time comparison behind netcode’s packet authentication.

    Fixed

    • ctutils before 0.4.4 could generate branches on secret values in its constant-time masks and comparisons (RUSTSEC-2026-0385). netcode’s Poly1305 tag verification goes through it, so dream-net now requires ctutils 0.4.4 or newer, which also moves projects whose lockfiles still held an older version.
    dream-net 1.1.1 101.13 kB · crates.io
    View on crates.io
    Verify · sha256 4224182c0284…763bd291
    File
    dream-net-1.1.1.crate
    Size
    103559 bytes
    SHA-256
    4224182c0284ac157dcb61f99c791d8759341f600f2f56863a62397b763bd291

    The same digest as the crates.io index's checksum, which Cargo checks on every download.

  4. 1.1.0 stable 2026-09-29

    A peer is announced before its first event, captures without payloads keep their lengths, and the codec’s decode errors are standard Rust errors.

    Added

    • wire::DecodeError and wire::Malformed implement std::error::Error, and DecodeError implements Display, like the crate’s other errors: a malformed packet prints its reason, which is also its source(), and a mismatch prints the foreign hello.

    Fixed

    • Server and Client queued Connected after the events of the packet that completed the handshake, so a host could poll a peer’s Message before its Connected. Connected now comes first.
    • CaptureWriter without payloads wrote each event’s length from its payload, so a capture read back and written again recorded every event as zero bytes. It now writes the record’s len.
    dream-net 1.1.0 100.18 kB · crates.io
    View on crates.io
    Verify · sha256 2df0cb5ee602…4ba4d51d
    File
    dream-net-1.1.0.crate
    Size
    102580 bytes
    SHA-256
    2df0cb5ee602184918adad25df359efd364166568947e03e73c747144ba4d51d

    The same digest as the crates.io index's checksum, which Cargo checks on every download.

  5. 1.0.0 stable 2026-09-27

    First release: secure UDP between authenticated peers, reliable-ordered and unreliable event channels, and a schema handshake, over the Más Bandwidth netcode, reliable and serialize crates.

    Added

    • A frozen Schema of channels and events: event ids from sorted names, never registration order, and a 128-bit fingerprint (truncated SHA-256) peers compare before any event is accepted.
    • Reliable-ordered channels, delivered exactly once in send order and resent until acknowledged, and unreliable-unordered channels with a choice of overflow policy.
    • Many events aggregated into each packet, and events larger than a datagram fragmented by reliable.
    • Server and Client over netcode: connect tokens, encryption, generation-checked PeerId handles, and polled lifecycle events, including schema and protocol mismatches reported with both fingerprints on both ends.
    • Bounded memory on every queue: pending, parked and pooled bytes, with at most max_pending_bytes + 2 * max_parked_bytes held per connection on receive.
    • Protocol captures at the host boundary, in a versioned binary format that carries the schema’s names.
    • Connection independent of sockets, and a deterministic link simulator for tests and benchmarks.
    • Wire format 2, pinned by golden bytes; warm send and receive paths that allocate nothing; fuzz harnesses, a soak test and Criterion benchmarks.
    dream-net 1.0.0 98.02 kB · crates.io
    View on crates.io
    Verify · sha256 fe667f5bd125…5fd03c87
    File
    dream-net-1.0.0.crate
    Size
    100369 bytes
    SHA-256
    fe667f5bd1256bcebe4fef2143ad2a09e84ed73301405437856ea17e5fd03c87

    The same digest as the crates.io index's checksum, which Cargo checks on every download.