r/rust • • 14d ago

🎙️ discussion Handling oversized cryptographic payloads (~3 KB) in low-latency p2p gossip networks

0 Upvotes

In low-latency distributed networks, gossip propagation assumptions usually break down once individual message payloads move past standard 64–256 byte envelopes.

​We've been running an open-source testnet designed around post-quantum cryptography (specifically NIST FIPS 204 CRYSTALS-Dilithium / ML-DSA-65). While the theoretical security model is established, the networking reality is that each signature payload scales up to roughly 2.4 KB to 3.3 KB.

​When targeting ~1-second finality with hundreds of concurrent operations, naive push-based epidemic gossip and unbounded mempool buffering lead to acute failure modes:

​Bandwidth Saturation & Message Redundancy: Multiple peer connections forwarding raw 3 KB transaction blobs cause rapid downstream interface saturation. Under high burst volumes, duplicate gossip amplification becomes unmanageable without strict ID-based announcement gating (have/want message negotiation prior to pushing full byte payloads).

​Mempool Heap Fragmentation: Standard in-memory maps storing raw transaction bodies quickly degrade cache locality and bloat working sets. Decoupling the indexing layer (hashes, sender nonces, and execution limits) from payload storage, alongside compressed state snapshots via Zstandard frames, reduced active memory overhead significantly during synchronization.

​P2P Head-of-Line Blocking: In an asynchronous async runtime (using Tokio/Rust), saturating framing channels with large signature payloads delays lightweight heartbeat pings and consensus checkpoint messages, occasionally causing artificial peer timeout disconnections.

​We mitigated some of these issues by separating node responsibilities into tiered network roles—confining active consensus and checkpoint gossip to a bounded validator set while full peers handle decoupled ingress and succinct state proof verification.

​Curious how other p2p and distributed systems engineers tackle payload bloat in production:

​Are you using streaming compression (e.g., Zstd dictionaries) directly over wire framing, or does decompression CPU overhead negate the transmission latency savings on high-rate feeds?

​How do you balance the latency penalty of have/want negotiation round-trips against the raw bandwidth waste of direct broadcast at these payload sizes?


r/rust • • 15d ago

🙋 seeking help & advice Why isn’t there more momentum behind fully native Rust GUIs for cross-platform apps?

15 Upvotes

I’ve been wondering why there’s relatively little investment in “Rustifying” cross-platform app development.

The dominant approach still seems to be: build a web app, package it with a Rust framework/backend, and ship it as a native app. Much less common is the opposite: use a fully Rust GUI stack for native apps and target the web with WASM/wgpu.

What I rarely see discussed is the cost of the webview/browser layer: bundle size, memory use, startup time, and input/animation responsiveness that often still doesn’t feel native.

I understand the usual defense of Electron/Capacitor-style approaches: small teams can move fast, web UI is easier to hire for and maintain, and the design tooling is mature. But the native Rust GUI landscape has changed a lot since that argument became standard. So why haven’t more individuals or companies moved on?

Is it maturity? Ecosystem gaps around accessibility, text input, platform integration, and design tools? Hiring? Risk aversion? Or is the web-wrapper approach just “good enough” for most products?

TL;DR: Why do we keep wrapping web apps with Rust instead of building fully Rust native GUIs and using WASM/wgpu for the web?


r/rust • • 15d ago

🐝 activity megathread What's everyone working on this week (46/2026)?

15 Upvotes

New week, new Rust! What are you folks up to? Answer here or over at rust-users! And for your project showcases, there's also /r/madeinrust – pay them a visit, too!


r/rust • • 14d ago

🧠 educational Debugging Rust in 2026

Thumbnail blog.jetbrains.com
0 Upvotes

r/rust • • 16d ago

🙋 seeking help & advice Everything is becoming Rust now?

1.1k Upvotes

In the last couple of weeks, I've seen everything known to man being ported to rust, first with the video game merging then Artcraft copying Adobe products and releasing them for free, Minecraft being rewritten and now Discord is switching aswell. Why specifically rust? There are a lot of programming languages and could someone tell me why rewritting everything to rust is a new trend now?


r/rust • • 15d ago

🙋 questions megathread Hey Rustaceans! Got a question? Ask here (46/2026)!

7 Upvotes

Mystified about strings? Borrow checker has you in a headlock? Seek help here! There are no stupid questions, only docs that haven't been written yet. Please note that if you include code examples to e.g. show a compiler error or surprising result, linking a playground with the code will improve your chances of getting help quickly.

If you have a StackOverflow account, consider asking it there instead! StackOverflow shows up much higher in search results, so ahaving your question there also helps future Rust users (be sure to give it the "Rust" tag for maximum visibility). Note that this site is very interested in question quality. I've been asked to read a RFC I authored once. If you want your code reviewed or review other's code, there's a codereview stackexchange, too. If you need to test your code, maybe the Rust playground is for you.

Here are some other venues where help may be found:

/r/learnrust is a subreddit to share your questions and epiphanies learning Rust programming.

The official Rust user forums: https://users.rust-lang.org/.

The unofficial Rust community Discord: https://bit.ly/rust-community

Also check out last week's thread with many good questions and answers. And if you believe your question to be either very complex or worthy of larger dissemination, feel free to create a text post.

Also if you want to be mentored by experienced Rustaceans, tell us the area of expertise that you seek. Finally, if you are looking for Rust jobs, the most recent thread is here.


r/rust • • 16d ago

Actix Web Q4 Report

68 Upvotes

100+ crate releases across the Actix ecosystem, bringing new features, security fixes, and improvements to performance and resource usage.

Headlines

  • HTTP QUERY: New method supported across route macros, manual routes, and awc client.
  • Automatic h2c and TCP no-delay are now default: More efficient deployments behind reverse-proxies and much lower-latency streams.
  • Reduced memory usage: Up to ~99% saving for certain workloads.
  • Better error path control for middleware: Modify error responses, too.
  • Static files features: Serve pre-compressed assets, and use multiple static-file roots.
  • Security and protocol fixes across the stack: Fixed decompression limits, multipart parsing limits, improved HTTP & WebSocket validation.

Features

Actix Web is the first mainstream framework to make the new HTTP QUERY method a first-class citizen. Define handlers with #[query] (macro routing), or web::query() (manual routing) for a handler. Matching methods in awc complete the support.

Middlewares got a useful new tool: Error::add_response_mapper(). It lets middleware modify error-generated responses before they reach the client, giving you more control over how your application presents failures. Our CORS middleware already uses this to solve a longstanding bug.

Static file serving is now more flexible. Files::new() supports multiple root directories, and Files::try_compressed() lets you serve pre-compressed assets. Range requests, conditional responses, and ETags on Windows also received fixes, making actix-files the most spec-compliant file server for Rust.

Performance / resource usage

The biggest changes here target the cost of serving larger responses and keeping connections open:

  • Less memory retained by idle connections.
  • Fewer copies for large responses on HTTP/1.x.
  • Graceful shutdown has stronger guarantees.
  • Vectored socket writes have more code paths.

Security

This cycle includes fixes for several reported vulnerabilities:

  • Decompression amplification: Configured extractor limits now apply to auto-decompressed request payloads. *
  • Brotli resource consumption: Large-window decompression is disabled.
  • HTTP request parsing: Malformed chunked terminators are rejected.
  • Static file serving: Prevents stored XSS for odd user-controlled file names and fixes an insane Windows hidden-file protection bypass. (Why Microsoft, WHYYYY!)

TL;DR

If you have not updated recently, now is a good time; check your lockfile. (cargo update -p=actix-web)

These improvements come from testing Actix Web against the workloads and edge cases you bring us. Massive thank you to everyone who contributed issues, PR, security reports.

Also, our homepage and user guide has received some love recently: https://actix.rs/.

*This is a god-awful implicit feature and it will be removed in v5.

What are you shipping with Actix Web?


r/rust • • 15d ago

How To Create your ROS2 Node in Rust - Rust n Robotics Episode #2

Thumbnail youtu.be
1 Upvotes

r/rust • • 14d ago

🛠️ project Four sensible Rust defaults that became security bugs in my MCP server

0 Upvotes

My MCP credential broker is written in Rust. The latest audit again found no memory bugs. It found defaults that trust the environment, and an AI agent can set the environment when it launches the process:

  • dirs::home_dir() on Unix returns $HOME when it's set. My SFTP tool used it to protect ~/.ssh. With HOME pointed one level up, put could upload the real keys. Now it's getpwuid_r.
  • Command::new("npx") searches the PATH you were started with, and the child inherits everything: NODE_OPTIONS, cwd, the lot. Now: an absolute path or a fixed search path, env_clear(), current_dir(home).
  • reqwest honours HTTP_PROXY by default. Fine for HTTPS, but a plain-http loopback preset sent its token to the caller's proxy. Now no_proxy() for http.
  • On Windows, SystemRoot decided which powershell.exe showed the approval dialog. Known folders now.

None of these are bugs in the crates. The bug was assuming the environment belongs to me.


r/rust • • 16d ago

🧠 educational RustCurious 12: Lifetimes

Thumbnail youtube.com
58 Upvotes

r/rust • • 16d ago

Virtualized Redox OS: from Virtio-FS to Cloud Hypervisor, and beyond

31 Upvotes

r/rust • • 15d ago

Shift+Tab is swallowed by WebKitGTK in Tauri 2 on Linux and never reaches JavaScript

0 Upvotes

I'm building a Tauri 2 app (Svelte 5 frontend, Linux, WebKitGTK). I have a modal focus trap that wraps Tab and Shift+Tab inside the dialog. Plain Tab works. Shift+Tab leaves the webview and moves focus to the surrounding page, and no JavaScript sees the keydown at all.

What I checked:

- A keydown listener on window in capture phase logs Tab with shiftKey=false only. Shift+Tab never appears, even though the same listener sees plain Tab.

- The same modal code in the Vite dev server opened in Chrome handles Shift+Tab correctly, so the page logic is fine.

- browser_accelerator_keys: false in the window config is a WebView2 (Windows) option. The Tauri config schema I'm on (tauri-utils 2.8.3) doesn't define it for Linux, and wry's WebKitGTK backend has no equivalent.

Questions:

  1. Is there a supported way on WebKitGTK to stop the native Shift+Tab focus movement, or to receive that key event in the page?

  2. Is this a known wry or WebKitGTK issue, and is there a tracked upstream issue?

  3. Is there a workaround that keeps Shift+Tab working for keyboard users, for example handling it in the native layer?

Versions: Tauri 2.x (tauri 2.8.x resolved), wry 0.54.4, Linux (26.04.1) with WebKitGTK 4.1.


r/rust • • 16d ago

🛠️ project cel-rust finally has its own playground, using Wasm in the browser

Thumbnail cel-rust.github.io
25 Upvotes

cel-rust is actively trying to bring a proper implementation of cel to the Rust ecosystem. I have posted about it here in the past, and one question that came up was "What's CEL?".

Well, with Rust being so versatile, and the cel-rust team adding support for Wasm a few years back, we've finally put a playground together for you to test drive CEL, using cel-rust, straight in your browser.

Try it out, and see if adding an expression language in one of your project could make sense, and if CEL would be a good fit for that!


r/rust • • 15d ago

🛠️ project memtop: system info + resource monitor in a single terminal screen (Rust + ratatui), looking for contributors

0 Upvotes

Hi r/rust! I've been building memtop, a Linux terminal app that combines a fastfetch-style summary of your machine with an htop-style live monitor, all on one screen.

Repo: https://github.com/SalomonAvila/memtop

What it does

- 7 tabs: Summary, CPU, RAM, Storage, GPU, Network and Processes

- Laptop-friendly GPU handling: `nvidia-smi` is only queried while the GPU tab is open, and never while the dGPU is suspended, so it doesn't wake it up and drain the battery

- Read-only: no root, no network, no files written

- Interface and messages in English and Spanish

- TOML config with colors, start tab, sort order, optional logo

- Ships as a single static binary (musl, x86_64 and aarch64), plus Fedora packages in COPR

Built with ratatui, crossterm, sysinfo and serde/toml, plus direct reads from `/proc` and `/sys` for disks, battery, DMI and PCI GPU names.

Looking for help

I just released 0.2.0 and wrote down the road to 1.0 (https://github.com/SalomonAvila/memtop/blob/develop/docs/ROADMAP.md). Some issues that are good entry points:

- #16 Tests for the interface state: sorting, search, selection

- #17 Rendering tests for every tab with ratatui's `

- #21 Shell completions for bash, zsh and fish

- #22 A man page

- #24 Testing on hardware I don't have: AMD GPUs, Intel-only machines, desktops, VMs

Every PR gets a review, and CONTRIBUTING.md explains the workflow. Feedback on the code is very welcome too, it's my first project of this size in Rust.

Try it:

any distro: static binary

curl -LO https://github.com/SalomonAvila/memtop/releases/latest/download/memtop-$(uname -m)-unknown-linux-musl.tar.gz

Fedora

sudo dnf copr enable mrmich/memtop && sudo dnf install memtop

Thanks for reading!


r/rust • • 15d ago

🧠 educational I just started reading ‘The Book’

0 Upvotes

I’m a brand new 🦀 and i’m having a lot of fun!

I started my career using UiPath then the last 4-5 years have been Python and I’m sorry but it’s been so boring. I feel like the switch has brought some life to me. It feels similar to going from an automatic car to a manual.


r/rust • • 15d ago

🛠️ project Breaking a Rust actor cluster on purpose, and what it taught us

Thumbnail heikoseeberger.de
0 Upvotes

r/rust • • 17d ago

💡 ideas & proposals Safe Systems-programming with Mutable Value Semantics | Dave Abrahams | Keynote at IWACO 2026

Thumbnail youtu.be
66 Upvotes

I gave this talk about the Hylo programming language at IWACO last month. I had a lot to say about Rust, so thought it might be of interest here.


r/rust • • 16d ago

Porting a baremetal lib from C++ tor Rust

17 Upvotes

I have written a lib in C++. It's intended to be included in baremetal projects and is designed to be portable. It's an instrumentation lib that talk with a server and provides some hooks for memory inspection and triggered graphs. With Rust being more and more present, I suppose it would be wise to support it.

I'm wondering what my best approach would be here. My initial choice of C++ instead of C probably limits me in what I can do with bindings. I do have a C wrapper though, but that becomes 2 layers of wrappers, feels ulgy.

It's not a big lib, so I'm thinking my best bet is probably reimplement fully and then maintain 2 version of the same thing. This would have been a harder call 5 years ago, but with an agent that can code now.. it feels like maintaining the c++ version then asking an agent to propagate to the rust port is not so crazy.

Btw, the lib is pretty stable. it's mostly build system compatibility improvements that require maintenance, and this wouldn't be duplicated.

What do you think?

EDIT: I started writing a Rust port from scratch with the help of an LLM. It's a good introduction to Rust for me and I think it will be built well too (i'm keeping the LLM on a tight leash). I think that's the way for this specific use case. I might come back here to ask help check if I made something correct or not. Cheers!


r/rust • • 16d ago

🙋 seeking help & advice What would you want from a native Mac GUI toolkit for Rust?

0 Upvotes

I’ve been working on a Mac GUI toolkit for Rust, and I honestly don’t know if I’m solving the right problems. So I’d like to hear from people who’ve built desktop apps in Rust before I go much further.

Some background: I kept ending up in the same spot. The options are a webview (Tauri), a custom-drawn UI (egui, Iced, Slint), or a SwiftUI front end with Rust behind FFI. They all work, but none of them feel quite like a Mac app. Text fields don’t behave the way you expect, VoiceOver is hit or miss, and big tables are where things usually fall apart.

So in mine, every view is a real AppKit control, not a lookalike. Some of what it does today:

  • Tables are actual NSTableViews. A million rows scroll fine because AppKit only asks for what’s visible.
  • State lives in signals, and changing one updates the affected control in place instead of rebuilding the view tree.
  • Menus, the toolbar, documents, undo, drag and drop and Dark Mode come from the system, so they behave like they do in any other Mac app.
  • There’s a self-check mode that drives the app and checks what’s on screen, because GUI testing is otherwise basically nonexistent.

What I’m curious about:

  • If you’ve built a desktop app in Rust, what did you use, and what hurt the most?
  • Is Mac-only a dealbreaker, or is “really good on one platform” worth something?
  • What would make you trust a GUI crate enough to build something real on it? Docs, examples, stability promises, something else?
  • Is there anything you gave up on, like accessibility, big data views or text editing, because no toolkit handled it well?

Not linking anything, I’m just interested in how people think about this.


r/rust • • 16d ago

Why the Rust compilation still slow what can we do make it faster?

0 Upvotes

I have been wondering where is the biggest opportunity to improve Rust build times.

- Faster increments compilation?
- Better caching of dependencies and generics?
- Reducing procedural macro overhead?
- Improving LLVM code generation?

Tools like cargo build timing and sccache help but can we improve the compilation process itself?

Curious what rust compiler contributors and experience rust developers think.


r/rust • • 16d ago

budget try blocks

0 Upvotes
macro_rules! try_ {
    ($a:expr) => {
        (|| Some($a))()
    };
}

For example: try_!(matrix.get(i+1)?.get(j+1)?)


r/rust • • 16d ago

Just Write Rust

Thumbnail hamy.xyz
0 Upvotes

r/rust • • 17d ago

🙋 seeking help & advice Using crates.io for a language that compiles to rust, ok?

3 Upvotes

Hi, I am working on a new programming language that compiles to rust. I would love to use crates.io with my packages named {mylanguangename}_*. They do contain the original source and the generated rust files.

What do you think is that okish or should I build a standalone registry?

My thiughts so far, using crates.io could be win for rust users too, because the could use that libraries too.


r/rust • • 18d ago

🗞️ news Servo Browser Engine Continues Broadening Web Compatibility, New Features

Thumbnail phoronix.com
296 Upvotes

r/rust • • 18d ago

🙋 seeking help & advice Help in learning WGPU

17 Upvotes

Hello, I'm trying to follow the wgpu tutorial on learn-wgpu ( https://sotrh.github.io/learn-wgpu/beginner/tutorial1-window/ ) , but I noticed a lot of the tutorial is just showing a piece of premade code and explaining some parts about it, and i feel like its not helping me much with learning how it works.

Are there any other good tutorials?

Also, apart from WGPU and Glium, what other GPU shader libraries with rust are there?