Skip to content

Max/mixtcp#6321

Merged
mfahampshire merged 30 commits intodevelopfrom
max/mixtcp
Apr 14, 2026
Merged

Max/mixtcp#6321
mfahampshire merged 30 commits intodevelopfrom
max/mixtcp

Conversation

@mfahampshire
Copy link
Copy Markdown
Contributor

@mfahampshire mfahampshire commented Jan 12, 2026

Part 3 of breaking #6129 into smaller chunks.

Should only be looked at after #6320 is merged and this branch is rebased removing most of the commits). DONE

This contains the mixtcp proof of concept - the -core crate that we can build connectors from for the Tokio async ecosystem, exposing a tunnel abstraction which gives developers something that looks and acts like either a TCP or UDP socket, for client-side-only integrations.


This change is Reviewable

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nym-explorer-v2 Ready Ready Preview, Comment Apr 14, 2026 1:10pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs-nextra Ignored Ignored Preview Apr 14, 2026 1:10pm
nym-node-status Ignored Ignored Preview Apr 14, 2026 1:10pm

Request Review

Introduces mixtcp, a smoltcp-based device that tunnels TCP/IP through
the mixnet via IpMixStream and Exit Gateway IPRs.

Components:
- NymIprDevice: smoltcp::phy::Device impl using channel-based I/O
- NymIprBridge: async task bridging the device to IpMixStream
- create_device(): helper to set up the complete stack

Examples:
- cloudflare_ping: ICMP ping through the mixnet
- https_client: HTTPS requests through the mixnet
- tls: TLS connections through the mixnet
- Add graceful shutdown (gets rid of red herring errors in examples)
- Declutter logging - move a lot of bridge info! -> trace!
- Move rustls, nym-bin-common, bytes to dev-dependencies
- Extract TlsOverTcp to mod.rs
- Make timing more granular
- Update readme
- Drop sync NymIprDevice, create_device(), and raw/ examples
- Flatten src/tunnel/{mod,device}.rs into src/{tunnel,device}.rs
- Remove unused socket-icmp and proto-ipv6 smoltcp features
- Tighten bridge/device visibility to pub(crate)
- Fix silent error swallowing in handle_incoming() select branch
- Remove cargo-cult 1s sleep before disconnect (SDK handles via TaskTracker)
- Rename confusing bridge fields: tx_receiver/rx_sender -> outgoing_rx/incoming_tx
- Document cancel-safety risk, drop-path shutdown, post-shutdown behavior
- Add comment on error loop rate limiting (SDK's internal 10s timeout)
- Add src/ARCHITECTURE.md as single source of truth for architecture
- Include in docs.rs via doc = include_str!
- Strip duplicated diagrams from tunnel.rs, device.rs, README
- Extract tls_connector() helper in HTTPS example to match websocket example
- Use consistent 'smolmix' casing in README
- stream_wrapper::{IpMixStream, NetworkEnvironment} → ipr_wrapper::
- connect_tunnel() → check_connected()
- disconnect_stream() → disconnect()
- allocated_ips() returns &IpPair directly (no Option)
- Add Tunnel::new_with_ipr() for targeting a specific exit node
- Re-export IpPair and Recipient so users don't need direct deps
- Add DNS leak warning to WebSocket example
- Await hyper connection task in HTTPS example
- Move core tunnel code to smolmix/core/
- Add smolmix-dns: hickory RuntimeProvider over tunnel
- Add smolmix-tls: shared TLS connector extracted from hyper/tungstenite
- Add smolmix-hyper: tower Service<Uri> connector for hyper-util
- Add smolmix-tungstenite: WebSocket over TLS through tunnel
- Add smolmix-libp2p: libp2p 0.56 Transport trait (dial-only)
- Rewrite examples for each crate with clearnet/mixnet comparisons
- Explain TCP-layer vs message-layer design and why it matters
- Document trait impls and I/O bridges for each companion crate
- Add quick start, crate table, and example commands
- Replace stale stream_wrapper description with ipr_wrapper + mixnet::stream
- Remove TODO comment
Copy link
Copy Markdown
Contributor

@jstuczyn jstuczyn left a comment

Choose a reason for hiding this comment

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

you will also have to definitely resolve the compilation issue. it looks like one of the new dependencies imports different version of one of the crypto libraries - not entirely sure which one, I haven't looked too deeply into that. if we have no choice but try to update something on our end - let's talk about it.
and after that is done, I reckon, CI is going to scream more about different things, but let's take things one at a time : )

Comment thread Cargo.toml Outdated
Comment thread documentation/docs/pages/developers/native.mdx Outdated
Comment thread smolmix/core/src/tunnel.rs
Comment thread smolmix/core/Cargo.toml Outdated
Comment thread smolmix/core/Cargo.toml Outdated
Comment thread smolmix/core/Cargo.toml Outdated
Comment thread smolmix/core/src/device.rs Outdated
Comment thread smolmix/core/src/device.rs Outdated
smolmix dependencies to import from workspace
Copy link
Copy Markdown
Contributor

@jstuczyn jstuczyn left a comment

Choose a reason for hiding this comment

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

looks good!

Comment thread smolmix/core/src/bridge.rs Outdated
@mfahampshire mfahampshire merged commit 7ceaf9a into develop Apr 14, 2026
13 checks passed
@mfahampshire mfahampshire deleted the max/mixtcp branch April 14, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants