Commit Graph
284 Commits
Author SHA1 Message Date
layue13andClaude Opus 5.5 25a7d0e1bb test: 转服截止测试把后端连接被重置也视为代理已关闭
cutoverTimesOutWhenOldBackendWriteNeverCompletes 在 CI 上偶发失败:代理在截止后关闭候选
后端连接时,若该连接上还有未读取的后端帧,Linux 会发送 RST,后端读到 Connection reset
而不是 EOF。两者都表示代理已关闭连接。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:57:48 +08:00
layue13andClaude Opus 5.5 fc1345d010 perf: 去掉冷路径上的重复开销,并记录未采用的中继批量完成实验
- Message.validateChannel:通道名正则只编译一次(原来每条消息 String.matches 都重新编译),
  长度检查不再分配字节数组
- 后端 OwnedBukkitSessionService:反射查找按接收者类用 ClassValue 缓存(含未找到),
  玩家每次加入不再重复 getMethod
- testing/benchmarks/results/2026-10-22-relay-batch-completion:中继只给每批最后一次写入
  挂完成回调。I/O 线程分配降 22%、中继 lambda 降 97%,但每帧 CPU 只低 2.4% 且范围重叠,
  未达到事先设定的 10% 规则,未采用;补丁随记录保留
- PluginHostTest.placementFailuresOnlyFailTheirOwnRequest:40 ms 超时在负载下可能早于插件
  处理器运行而偶发失败,改为 500 ms 并断言首个请求确实到达插件

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 18:34:36 +08:00
layue13 4ed6162faf Merge pull request #7 from layue13/feat/logging
feat: 运维日志策略、玩家与服务器事件日志、滚动日志文件
2026-10-22 17:05:10 +08:00
layue13 e890645ba5 Merge remote-tracking branch 'origin/main' into feat/logging
# Conflicts:
#	proxy/core/src/test/java/dev/moonbridge/app/ProxyConfigurationTest.java
2026-10-22 16:57:55 +08:00
layue13 0abcb37799 Merge pull request #6 from layue13/fix/batch-1-bugs
fix: 修复代码审查发现的一批缺陷
2026-10-22 16:49:42 +08:00
layue13andClaude Opus 5.5 7f68e5682e feat: 运维日志策略、玩家与服务器事件日志、滚动日志文件
- docs/logging.md 规定各级别写什么、永远不写什么,以及新增日志的做法
- core.log.ConnectionLog 统一写玩家(加入、离开、转服、转服失败、未能加入)和服务器
  (注册、地址变更、注销、不可达/恢复)事件,logger 为 moonbridge.players / moonbridge.servers
- LogText 清理对端与插件文本(控制字符、双向文字控制字符、长度上限),防止伪造日志行
- logging.playerAddresses 开关:false 时玩家地址写成 [hidden]
- Session 记录结束原因(先记录者为准),在 closePair 中写离开或未能加入的原因
- 合并的 WARN(ThrottledWarning):连接数上限、插件命令/补全/事件/初次选服过载
- 控制通道:租约过期、注册被拒(按地址和原因去重);插件启用/停用;启动与关闭摘要
- logback:控制台 + logs/latest.log,按天压缩滚动保留 14 天;测试只写控制台

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 16:44:27 +08:00
layue13andClaude Opus 5.5 3f8e14f54d fix: 修复代码审查发现的一批缺陷
- 控制通道:注册字段长度上限统一放在 messaging 的 ControlHandshakeLimits,后端启动时
  按代理的上限校验,不再出现后端接受、代理每次重连都拒绝的配置;后端按阶段记录连接、
  注册与断线失败(每类只记一次,不含对端数据),配置错误时输出具体缺失的键
- 转服登录:握手与 Login Start 的写入合并为 SessionChannels.writeBackendLogin,
  Login Start 无法编码时关闭通道释放已排队的握手,不再泄漏缓冲区
- 命令:插件提供的 CommandSource 的 player()/reply() 不再在宿主锁内调用
- 配置:插件条目没有设置时视为空设置而不是空指针;--validate-config 也检查同一后端名的
  密钥冲突;地址解析不再做 DNS,后端地址按目录使用的 URI 规则校验
- WebSocket:IPv4 映射写法(::ffff:a.b.c.d)的可信代理现在能匹配 IPv4 对端

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:40:57 +08:00
layue13 192eca2a46 Merge pull request #5 from layue13/refactor/repo-layout
refactor: 精简仓库根目录与代理发行包
2026-10-22 15:03:28 +08:00
layue13andClaude Opus 5.5 afea023bce build: 代理发行包改为单个可运行的 moonbridge.jar
发行包去掉 bin/ 启动脚本和 lib/ 下的 42 个依赖 jar,改为与其他代理服务端一样
用 java -jar moonbridge.jar 启动:
- proxy-core 用 shadow 打出含全部依赖的 moonbridge.jar(合并 META-INF/services,
  清单写入 Main-Class、Multi-Release 与 Enable-Native-Access: ALL-UNNAMED)
- 泄漏检测默认关闭改由 ProxyMain 在加载 Netty 前设置,显式 -D 仍优先
- 移除不再使用的 application 约定插件
- 安装包检查、烟测与基准脚本改用发行包根目录作 classpath;文档同步

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:00:14 +08:00
layue13andClaude Opus 5.5 789648c82f refactor: 仓库根目录按用途分组
- proxy/:core、plugin-api、luckperms 及其上游子模块 vendor/luckperms
- messaging/、backend/ 保持在根目录(messaging 是代理与后端共用的 API)
- build-logic/(原 proxy-build-logic)
- testing/:smoke/ 与 benchmarks/,不进入发行物

Gradle 项目名不变(settings.gradle.kts 映射目录),任务路径与 Maven 坐标照旧。
脚本的仓库根定位、文档与记录中的链接同步更新。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:34:01 +08:00
layue13andClaude Opus 5.5 7664c1cf60 build: 代理发行包只保留运行所需内容
发行包根目录去掉 docs/、smoke/results/、benchmarks/results/ 和 backend/,
只剩 bin/、lib/、config/、README(-Pluckperms 时另有 plugins/)。
后端 jar 已由 release 单独放在 build/release/backend/;channel-java8 烟测改为
从 backend/build/libs 取后端 jar。文档同步。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 14:19:36 +08:00
layue13 480999a448 Merge pull request #4 from layue13/refactor/build-and-modules
重构构建与模块:后端 5 合 2、LuckPerms 可选构建、统一 release
2026-10-21 03:26:15 -07:00
layue13 d904410c4b Merge pull request #3 from layue13/feat/websocket-transport
WebSocket 玩家监听(与 TCP 并存)+ 1.7.10 客户端 mod + 文档整理
2026-10-21 03:25:59 -07:00
Claude d836f6c3d3 build: 统一 release 入口,CI 覆盖客户端 mod,文档同步新结构
- 根任务 release:build/release/ 下收集服务器包、后端插件 JAR 与客户端 mod
  (经 client-mod 自身 wrapper 构建,-PskipClientMod 可跳过),附安装位置说明
  docs/release-layout.md
- verify.yml:-Pluckperms check,并新增 client-mod 构建测试 job;
  ci.yml:-Pluckperms check release,上传 build/release/,发布带 -Pluckperms
- gradlew 加可执行位
- README、CLAUDE.md、架构/发布/测试/权限/后端接入文档与 smoke 脚本改用新模块、
  新坐标与发行包 backend/ 目录

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-21 10:13:06 +00:00
Claude f156932f1a refactor(build): 后端 5 个模块合并为 messaging 与 backend,LuckPerms 改为可选构建
模块
- messaging-api + messaging-protocol → messaging(Java 8,消息 API 与线协议)
- backend-channel-client + backend-bukkit-api + backend-bukkit → backend(Java 8;
  jar 即 MoonBridgeBackend Bukkit 插件,内含消息类与控制通道客户端;业务插件
  compileOnly 同一个 jar)
- 包名不变,源码只移动目录;Maven 坐标改为 messaging / backend(破坏性变更)
- 新增 moonbridge.java8-library-conventions 与 moonbridge.publishing-conventions,
  取代各模块复制粘贴的 Java 8 编译和发布配置
- 发行包后端目录由 backend-client/backend-host/backend-api 合为 backend/

LuckPerms
- 只有传入 -Pluckperms 时才 include luckperms-moonbridge 及其 upstream 构建;
  日常 check 不再编译 LuckPerms,permissionAcceptance 与发行包 plugins/ 随该开关
- 根 check/publish 按实际包含的模块聚合

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-21 10:06:20 +00:00
Claude 6a482cfb7d refactor: 并掉 proxy-core 中只有一个类的包
- core.relay.RawRelay → core.session.play(PLAY 数据通路)
- core.net.NetworkTransport → core.session.channel(与后端拨号同处)
- core.forwarding.BungeeLegacyForwarding → core.auth
- core.permission.PermissionService → core.event(会话调用插件运行时的端口)

纯内部移动,不影响插件 API;测试随类移动,文档与 CLAUDE.md 同步。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-21 10:02:13 +00:00
Claude 3e2caf71ff fix(client-mod): wss 只协商 TLS 1.2
对实际 MoonBridge wss 监听实测时发现:JDK 8u261+ 默认提供 TLS 1.3,而
Minecraft 自带的 Netty 4.0.10 SslHandler 无法完成 TLS 1.3 握手,连接在
握手超时后失败。客户端引擎改为只启用 TLSv1.2,并加测试断言;文档说明
TLS 终端不能只开放 TLS 1.3,补充互通实测范围。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-20 21:38:18 +00:00
Claude db2a3fa901 feat: 1.7.10 Forge WebSocket 客户端 mod
client-mod/ 是独立构建(GTNH ExampleMod 模板 + RetroFuturaGradle),coremod +
早期 Mixin,运行时依赖 UniMixins。服务器地址填 ws:// 或 wss:// 时经 WebSocket
连接 MoonBridge,其余地址保持原版 TCP。

- Mixin:ServerAddress 解析、GuiConnecting、NetworkManager.provideLanClient 及其
  ChannelInitializer、OldServerPinger(ws 条目跳过旧版 0xFE ping)
- 使用 MC 自带 Netty 4.0.10 的 WebSocket13 帧编解码与 SslHandler;握手手写,
  Host 头与 SNI 用 URL 主机名,升级完成前缓冲原版写出
- 25 项 JUnit 测试(地址解析、上下文传递、帧适配、管线与本地 WS 服务端交互)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-20 21:34:16 +00:00
Claude 66ef6788f1 feat: 与 TCP 并存的 WebSocket 玩家监听
新增可选 websocket 配置段,在原有 TCP listen 之外再开一个 WebSocket 监听,
供经 CDN 接入的客户端使用;两种入口共用会话、选服、转服和 maxConnections。

- core.websocket:升级握手(可选 TLS)、二进制消息与 Minecraft 字节流互转、
  可信代理真实 IP(X-Forwarded-For 从右取第一个不可信地址 / CF-Connecting-IP 等)
- SessionChannels.clientAddress 统一玩家地址,用于两类准入事件、Mojang 验证 IP
  与 Bungee 转发
- ConnectionGate 支持升级后才加入管线;登录等待守卫放在 WebSocket 适配器之后
- 未升级连接计入 maxConnections,并受 handshakeTimeoutSeconds 约束
- 测试:真实 socket 上 TCP 与 WebSocket 并存登录与转发、分片/合并/Ping、
  在线模式加密与转发 IP、不可信来源、404/文本帧、名额归还、wss 证书加载
- 文档:docs/websocket.md,并更新运行配置、插件、架构与默认配置示例

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-20 21:23:15 +00:00
Claude 4def198cc0 docs: 修正 CI 引用、拆出历史验证记录并统一中文文档
- CLAUDE.md、testing.md、publishing.md 的 .gitea 路径改为实际的 .github/workflows;
  说明 verify.yml 在 PR 上运行 check
- testing.md 中带日期的逐轮结果迁到 docs/records/
- README 精简为简介、快速开始和入口;配置与迁移细节只保留在 operations.md
- channel-messaging-v2.md 更名为 channel-messaging-contract.md,与 transfer-coordination.md 一起译为中文
- benchmarks/results 中两个记录改为日期前缀命名
- 新增 compileBenchmarks 并挂到 check,防止 benchmarks/ 静默失效
- .gitignore 删除不存在的 deployment/ 条目

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GGL9BudzWm4dUQgBsQw4Qr
2026-10-20 21:06:01 +00:00
layue13andClaude Sonnet 5.5 e9a916a192 ci: 统一 workflow 写法,并把 Maven 密钥限定在独立的 publish 任务 [skip ci]
[skip ci]

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-15 16:44:09 +00:00
layue13andClaude Sonnet 5.5 13a3a15dee Merge branch 'chore/bench-record-and-test-timeout'
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 07:50:43 -07:00
layue13andClaude Sonnet 5.5 c5fe042173 Record session split benchmark and relax a timing-sensitive messaging test
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 07:50:32 -07:00
layue13andClaude Sonnet 5.5 0ad66b6e1d Merge branch 'refactor/split-session': split Session, PluginHost and control classes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 04:17:16 -07:00
layue13andClaude Sonnet 5.5 aed2d5ca93 Extract ClientControl from Session, narrow package visibility, document layers
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 04:08:31 -07:00
layue13andClaude Sonnet 5.5 fc951bfb7b Split LocalMessaging operations and failure helpers; deduplicate outbound dispatch
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 03:25:20 -07:00
layue13andClaude Sonnet 5.5 765dcffeaa Split BackendChannelClient into session, dispatcher and operation classes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 03:24:17 -07:00
layue13andClaude Sonnet 5.5 4b9f240c1b Split BackendControlService into registry, router, exchange and writer
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 03:22:51 -07:00
layue13andClaude Sonnet 5.5 22739ed0c4 Split PluginHost into lifecycle, event, command and placement services
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 03:19:50 -07:00
layue13andClaude Sonnet 5.5 133e46f25b Split Session into login, routing, transfer and play packages
Session delegates frontend login to FrontendLogin, first-backend dialing to
InitialRouter and the whole transfer state machine to TransferCoordinator
behind the TransferHost port. Per-frame PLAY handlers move to session.play and
dialing helpers to session.channel. Relay hot path is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-06 03:16:09 -07:00
layue13 1efbbafbad Merge pull request #2: add CLAUDE.md
Add CLAUDE.md
2026-10-05 18:17:03 -07:00
Claude 3d197e25e2 Add CLAUDE.md
Build/test commands (including single-test runs and the bash ./gradlew
caveat), the module layout with the Java 8 backend constraint, and the
cross-file architecture: session threading, relay data path, transfers,
transport selection, the buffer-ownership rules behind running without
Netty leak detection, and the benchmark method used in this repository.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-06 01:16:04 +00:00
layue13 c834879640 Merge pull request #1: batch relay flushes, native transport, leak gate, Session helpers
Batch relay flushes, native transport, leak gate, Session helpers
2026-10-05 18:14:22 -07:00
Claude 8b28df471d Record GraalVM 25.4 vs Temurin 25.0.4.1 comparison
Same jars and benchmark classes on Temurin 25.0.4.1 (C2), Oracle GraalVM
25.4 (Graal JIT) and the same GraalVM with C2. Graal JIT is not better:
on the 32-small-frame burst workload it was 24% slower and used 45% more
proxy I/O CPU per frame in steady state, with no consistent difference on
1 KiB frames. GraalVM with C2 matches Temurin, so the gap comes from the
Graal compiler, not the distribution.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-06 01:13:06 +00:00
Claude 941a499965 Guard the last two Session buffer branches
Session.channelRead releases messages that are not frames of its own
session: anything arriving on a channel that is neither its frontend nor
its backend, and any non-ByteBuf message from either. Neither branch had a
test. SessionFrameOwnershipTest builds a Session directly and checks both,
including that a stray channel does not close the real session; replacing
either release with a no-op makes it fail.

docs/testing.md and docs/operations.md no longer list these as untested.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-06 00:38:09 +00:00
Claude 298fd3c4fc Cover the remaining Session buffer paths with unit-testable helpers
A parallel mutation pass over Session and ConnectionGate (17 sites, three
workers, failures re-run to rule out load-induced flakiness) left five
sites unguarded. Three of them were buffer handling that only integration
tests reached, so it moves into small classes with direct tests:
TransitionFrames (mapping buffered start-up frames and appending the
rewritten opening packets) and TransitionBuffer (the bounded queue that
releases what it holds). transferOpening now uses ByteBufs.fill. A
mutation run over the two new classes catches all four of their release
sites.

Two defensive branches in Session stay untested and are listed in
docs/testing.md: a non-ByteBuf message (its input always comes from the
frame decoder) and a message from a channel that is neither side of the
session.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-06 00:03:36 +00:00
Claude 7de33e72aa Disable Netty leak detection in the distribution
The start scripts now pass -Dio.netty.leakDetection.level=disabled; it can
be re-enabled per deployment with JAVA_OPTS. In its place every
proxy-core test class runs under PARANOID detection through LeakGate (298
tests, no leaks).

Session also moves off hand-written releases at the sites a mutation pass
found unguarded: the login-wait guard is now a FrameTransformHandler and
buffered transition frames go through one mapTransitionFrame helper that
releases on every failure. ConnectionGate gets unit tests with a
TrackingAllocator covering every exit path.

The second mutation pass over Session was stopped at 11 of 24 sites, so
about ten Session releases (mainly transferOpening and the disconnect
packet) are not verified by mutation; docs/testing.md says so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 23:26:27 +00:00
Claude 790abb1426 Centralise buffer ownership and gate leaks in tests
Production is meant to run with Netty leak detection off, so refcount
correctness has to come from structure and tests instead.

Structure: the repeated hand-written release patterns move into three
places. ByteBufs.fill/use covers "allocate, write, release on failure"
for every encoder (including LoginStart, Handshake and the encryption
packets, which had no failure handling at all). FrameTransformHandler
owns the borrow/forward/drop/consume protocol for KeepAliveBridge,
PlayerCommandInterceptor and TransferFrameHandler, which no longer call
release(). The cipher handlers extend Netty's MessageToMessageEncoder and
Decoder. A dead active.release() in TabCompletionBridge.close() is gone.

Tests: LeakGate runs every proxy-core test class with PARANOID leak
detection and fails the class if a buffer was leaked; its own test proves
it sees a deliberate leak. Mutation testing (each release() replaced by a
no-op, then the covering tests run) first showed 23 of 47 release sites
unguarded; after the refactor and new tests 32 of 33 remaining sites are
caught and the last was removed by the cipher change. New tests cover
RawRelay (including a real-NIO race where later frames of a read reach the
relay after it closed), TabCompletionBridge, TransferFrameBuffer,
TransferCandidate, the cipher failure paths and the new helpers.

Session.java and ConnectionGate are not part of this commit: a second
mutation pass over them is still running. The full gradle check has not
been re-run on this state yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 23:15:32 +00:00
Claude 5a90143f88 Fix event-loop task queue regression and update Netty
The previous commit moved the I/O loops from NioEventLoopGroup to
MultiThreadIoEventLoopGroup. That group's loops queue tasks in a
LinkedBlockingQueue instead of the MPSC queue the deprecated groups use,
and the relay posts one write-completion task per frame. A JFR profile
showed the queue's offer at about 9% of Java CPU samples on burst
traffic. NetworkTransport now builds its loops with MPSC queues, and a
test pins the queue type.

Netty 4.2.2 -> 4.2.18. In the same workload, Buffer.memoryAddress fell
from 22% of Java samples to out of the profile and total Java samples
on the I/O threads dropped from 1460 to 836.

Records for both, plus the negative results (pooled allocator, batched
CFB8 encryption) and the leak-detection trade-off, are in
benchmarks/results/2026-10-05-event-loop-queue-and-netty.md. The earlier
transport record gets a correction note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 22:05:49 +00:00
Claude 0cf4017567 Select a native network transport automatically
NetworkTransport picks epoll on Linux, kqueue on macOS and NIO
elsewhere, or when the native library cannot load. The player listener,
session event loops, backend dials and the DNS resolver all take their
channel types from the selected transport, so backend channels keep
sharing the player's event loop. A new `transport: AUTO|NIO|EPOLL|KQUEUE`
setting forces one choice; an unavailable native transport fails
startup instead of falling back silently. The event loops move from the
deprecated NioEventLoopGroup to MultiThreadIoEventLoopGroup.

The distribution ships the linux-x86_64/aarch_64 epoll and
osx-x86_64/aarch_64 kqueue natives. The start scripts and tests pass
--enable-native-access=ALL-UNNAMED.

On the loopback session benchmark, epoll beat NIO on every median and
regressed nowhere. Only window-1 p50 latency separated cleanly (0.060 vs
0.070 ms); see benchmarks/results/2026-10-05-network-transport.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 21:05:32 +00:00
Claude 263299c857 Record inline relay write-completion experiment
Handling successful relay write completions inline, instead of queueing
one event-loop task per frame, showed no effect distinguishable from run
order and noise in two order-reversed A/B runs. The candidate was not
kept; the record and raw output stay for future comparisons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 20:35:08 +00:00
Claude bffc80857c Split helpers and transfer state out of Session
Behavior-preserving cleanup of the 1.8k-line Session handler:
- TransferAttempt and PendingTransfer move to their own files.
- CommandRateLimiter holds the proxy command token bucket, with tests.
- SessionChannels owns backend dialing, address parsing, codec install
  and frame-decoder lookup that initial routing and transfer duplicated.
- One pauseSource helper replaces the two copies of "buffer both sides,
  pause old relay, read until removed".
- Fully qualified names become imports.

Initial routing and transfer now use the same TCP address check, so a
registration with a port above 65535 fails a transfer as
SERVER_UNAVAILABLE instead of as a dial error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 20:35:08 +00:00
Claude 90b21a5b88 Flush relayed frames once per read batch
The PLAY relay called writeAndFlush for every decoded frame. With
TCP_NODELAY, a socket read holding many small packets (a typical server
tick) cost one flush, write syscall and TCP segment per frame. Write each
frame and flush the peer on channelReadComplete. A per-batch event-loop
task flushes frames forwarded outside a socket read, such as delayed tab
completion. Paused-frame replay keeps writeAndFlush.

ProxySessionBenchmark gains --burst plus proxy I/O CPU and TCP segment
counters. On a 4 vCPU Linux container with 32 x 33-byte frames per write,
TCP segments/frame fell from 1.379 to 0.117 and proxy I/O CPU/frame from
4079 to 1827 ns (medians of six paired phases). The existing 1 KiB window
1 and 16 workloads showed no regression.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 20:11:18 +00:00
Claude 7086c4f38d Make relay socket backpressure test hold on Linux
RawRelay stops reading while any forwarded write is incomplete. On Linux a
short socket read can stay below the 2 KiB high water mark, so the target
channel stays writable while the relay correctly waits. The test waited for
non-writability and timed out deterministically (writable=true,
pending=1632). Wait for a real pending socket write instead; the bounded
queue and exact byte-stream assertions are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KcCN2hYyqmU22X2Xfg1nwe
2026-10-05 20:11:18 +00:00
layue13 e300160500 Merge pull request 'Use MariaDB 13.0.2 for permission storage' (#23) from feat/mariadb-13.0.2 into main 2026-10-01 21:32:41 +00:00
layue13 15e5abb325 Default permission storage to MariaDB 13.0.2 and verify recovery 2026-10-02 05:30:59 +08:00
layue13 52ffadcd26 Merge pull request 'Restore MoonBridge to approved transfer-event scope' (#22) from revert/authority-only-scope into main 2026-09-30 22:31:42 +00:00
layue13 21e6006104 Revert "Merge pull request 'Authenticate shared backend sessions before Join' (#20) from feature/early-backend-session into main"
This reverts commit 08eb4454f4, reversing
changes made to 043123e168.
2026-10-01 06:27:29 +08:00
layue13 631b623a3f Revert "Merge pull request 'Exercise Uranium authoritative loading on real transfers' (#21) from test/uranium-player-data-authority into main"
This reverts commit a2382b2bd5, reversing
changes made to 08eb4454f4.
2026-10-01 06:27:29 +08:00
layue13 a2382b2bd5 Merge pull request 'Exercise Uranium authoritative loading on real transfers' (#21) from test/uranium-player-data-authority into main 2026-09-30 22:17:11 +00:00