v1.0.3
sleep3r/mtproto.zigv1.0.3Jun 8, 2026by sleep3r
Upgrading?
AI Summary
A patch release that disables the handshake flood guard by default to prevent false positives on carrier-NAT and VPN networks, aligning the default with the subnet rate limiter.
Key Highlights
- Handshake flood guard default changed from `true` to `false` to avoid banning legitimate users behind shared IPs.
- Fixes production incidents where VPN egress IPs were falsely blocked.
- Documentation updated in five languages (English, Russian, Chinese, Persian, Vietnamese).
Full Release Notes
<details open> <summary>🇷🇺 Что нового (RU)</summary> ## Что решает этот релиз `v1.0.3` — патч-релиз, который меняет один дефолт: **handshake flood guard теперь по умолчанию выключен**. Exact-IP flood guard срабатывал ложно на carrier-NAT, VPN-egress и общих офисных сетях: за одним IP сидит много легитимных клиентов, и всплеск брошенных/незавершённых handshake'ов с этого IP пробивал порог — guard банил IP, **унося с собой всех реальных пользователей за ним**. В проде это и произошло: IP VPN-выхода оператора (за которым сидят реальные пользователи) циклически блокировался ~на 56 c, и прокси «плохо работал» для них. Выключение guard'а сразу всё вернуло — `users_total` подскочил с 1 до 13. Теперь дефолт = `false`, как у `rate_limit_per_subnet` (давно выключен по умолчанию по той же NAT-причине). Доступ и так закрыт per-user secret'ом, глобальным handshake-inflight бюджетом и `max_connections`, так что для типичного multi-NAT деплоя защита guard'а избыточна, а цена ложных срабатываний — реальна. > [!NOTE] > Менять `config.toml` не нужно — это только смена дефолта. Код guard'а остаётся: на single-tenant / не-NAT хосте под реальным абьюзом включите обратно `handshake_flood_guard_enabled = true` (горячий релоад через SIGHUP / `mtbuddy reload`; настройте `handshake_flood_guard_threshold` / window / block). ## Что изменено ### Handshake flood guard выключен по умолчанию ([#314](https://github.com/sleep3r/mtproto.zig/pull/314)) - Дефолт `handshake_flood_guard_enabled` изменён с `true` на **`false`**. - Причина: exact-IP guard ложно банит carrier-NAT / VPN-egress / общие IP, где много легитимных клиентов делят один source-IP — и блокирует их скопом. - Это приводит дефолт в соответствие с `rate_limit_per_subnet` (тоже off по умолчанию по той же причине). - Guard никуда не делся: включается на single-tenant / не-NAT хостах. Обновлены дефолт + комментарий (`config.zig`), конфиг от инсталлера, `config.toml.example` и два дефолт-теста. ### Документация на пяти языках ([#314](https://github.com/sleep3r/mtproto.zig/pull/314)) - Таблицы конфига, сниппеты и нота про «стражей от абьюза» обновлены под новый дефолт во всех README: 🇬🇧 английский, 🇷🇺 русский, 🇨🇳 китайский, 🇮🇷 фарси, 🇻🇳 вьетнамский. ## Проверено - `zig build test` и кросс-компиляция под `x86_64-linux` + `aarch64-linux` — зелёные; `zig fmt` чистый. - GitHub Actions: `Test & Build`, `E2E Integration`, `Bench (No Soak)`, installer e2e `debian:12` и `ubuntu:24.04`. - Проверено на живом проде (`proxy.sleep3r.ru`): после выключения guard'а заблокированный VPN-IP перестал банится, `users_total` 1 → 13. </details> --- <details> <summary>🇬🇧 Release notes (EN)</summary> ## What this release addresses `v1.0.3` is a patch release that flips one default: the **handshake flood guard is now off by default**. The exact-IP flood guard false-positived on carrier-NAT, VPN-egress, and shared-office networks: many legitimate clients sit behind one IP, so a burst of abandoned/incomplete handshakes from that IP crosses the threshold — and the guard bans the IP, **taking every real user behind it down with it**. That happened in production: the operator's VPN-egress IP (real users sit behind it) was repeatedly blocked for ~56s, so the proxy "worked badly" for them. Disabling the guard recovered them immediately — `users_total` jumped from 1 to 13. The default is now `false`, matching `rate_limit_per_subnet` (long off by default for the same NAT reason). Access is already gated by the per-user secret, the global handshake-inflight budget, and `max_connections`, so the guard's protection is redundant for a typical multi-NAT deployment while its false-positive cost is real. > [!NOTE] > No `config.toml` change needed — this is only a default flip. The guard code stays: on a single-tenant / non-NAT host under real abuse, turn it back on with `handshake_flood_guard_enabled = true` (hot-reload via SIGHUP / `mtbuddy reload`; tune `handshake_flood_guard_threshold` / window / block). ## What changed ### Handshake flood guard off by default ([#314](https://github.com/sleep3r/mtproto.zig/pull/314)) - The `handshake_flood_guard_enabled` default changed from `true` to **`false`**. - Why: the exact-IP guard false-bans carrier-NAT / VPN-egress / shared IPs where many legitimate clients share one source IP — blocking them together. - This aligns the default with `rate_limit_per_subnet` (also off by default for the same reason). - The guard isn't gone: enable it on single-tenant / non-NAT hosts. Updated the default + comment (`config.zig`), the installer-generated config, `config.toml.example`, and two default-parse tests. ### Docs in five languages ([#314](https://github.com/sleep3r/mtproto.zig/pull/314)) - The config tables, snippets, and the abuse-guard note are updated for the new default across all READMEs: 🇬🇧 English, 🇷🇺 Russian, 🇨🇳 Chinese, 🇮🇷 Persian, 🇻🇳 Vietnamese. ## Verified - `zig build test` and cross-compilation for `x86_64-linux` + `aarch64-linux` — green; `zig fmt` clean. - GitHub Actions: `Test & Build`, `E2E Integration`, `Bench (No Soak)`, installer e2e `debian:12` and `ubuntu:24.04`. - Verified on live production (`proxy.sleep3r.ru`): after disabling the guard the blocked VPN IP stopped being banned, `users_total` 1 → 13. </details> ## Changelog * fix(config): handshake flood guard off by default (NAT/VPN-safe) ([#314](https://github.com/sleep3r/mtproto.zig/pull/314)) ([77e398a](https://github.com/sleep3r/mtproto.zig/commit/77e398a))
Related Repositories
lightpanda-io/browser★ 36,854
Lightpanda: the headless browser designed for AI and automation
tigerbeetle/tigerbeetle★ 17,229
The financial transactions database designed for mission critical safety and performance.
nullclaw/nullclaw★ 8,131
Fastest, smallest, and fully autonomous AI assistant infrastructure written in Zig
zml/zml★ 4,194
Any model. Any hardware. Zero compromise. Built with @ziglang / @openxla / MLIR / @bazelbuild
dmtrKovalenko/odiff★ 3,280
A very fast SIMD-first image comparison library (with nodejs API)