fix(network): bound frame size and per-peer packet queues on the TCP/UDP servers
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- bun, typescript
- Domínio
- backend, networking
Direção de pesquisa
Start with the TCP and UDP server entry points at modules/network/src/server/tcp.server.network.ts and modules/network/src/server/udp.server.network.ts, then trace the packet and candidate queues in peer-host.ts and packet.ts. Read how the existing signaling server sets maxPayloadLength and check for network tests covering frames and queue behavior. Done means frame size and per-peer queues, including pendingCandidates, are bounded, with tests demonstrating the limits.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Which package is this bug report for?
network
Issue description
The TCP and UDP Bun.serve calls keep Bun's default maxPayloadLength (about 16 MB); only SignalingServer sets one (signaling.server.network.ts:77). Per-client packet queues and pendingCandidates have no cap on count or bytes, and there is no rate limit. Each frame is copied twice and every typed packet is JSON.parsed even when nothing listens. One connected peer can exhaust server memory and CPU.
Where:
modules/network/src/server/tcp.server.network.ts:98modules/network/src/server/tcp.server.network.ts:134modules/network/src/server/udp.server.network.ts:174modules/network/src/server/peer-host.ts:315modules/network/src/shared/packet.ts:238
Evidence:
client.packets.get(frame.channel)?.push(frame.data);
webSocket.data.pendingCandidates.push(data.candidate);
if (payload) state.packets.push(payload);
grep -rn maxPayloadLength modules/network/src → only signaling.server.network.ts:77.
Suggested fix: Set maxPayloadLength (e.g. 64 KiB) on TCP and UDP, and cap per-peer queue length or bytes (drop the oldest or close the peer) and pendingCandidates.
Found during a code audit of main at be72076.
Code sample
No response
Versions
- Engine
mainat be72076 - pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority
High (immediate attention needed)
I have tested this issue on a development release
be72076
- Linguagem predominante
- TypeScript
- Estrelas
- 7
- Forks
- 2
- Merge médio
- 1d 17h
- PRs com merge (30d)
- 17
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de NanoForge-dev/Engine
-
dependencies enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NanoForge-dev/Engine#513 ·
Mantenedores costumam responder em até 1 dia
-
bug chore tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
NanoForge-dev/Engine#511 ·
Mantenedores costumam responder em até 1 dia
-
docs(network): TSDoc says ICE_SERVERS defaults to an empty list, the code uses public STUN serversAbertadocumentation good first issue modules:network
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
NanoForge-dev/Engine#509 ·
Mantenedores costumam responder em até 1 dia
-
documentation modules:ecs packages:asset packages:core
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
NanoForge-dev/Engine#508 ·
Mantenedores costumam responder em até 1 dia
-
bug good first issue modules:music modules:sound
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
NanoForge-dev/Engine#505 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de NanoForge-dev/Engine
Issues semelhantes
-
Mend: dependency security vulnerability
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 65/100
fdm-monster/fdm-monster#5563 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 1 dia
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
growilabs/growi#12246 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededTalvez já em andamento @github-actions assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
SSWConsulting/SSW.Rules#2809 · 1 comentário ·
Mantenedores costumam responder em até 1 dia