freenet-core icon indicating copy to clipboard operation
freenet-core copied to clipboard

fix: connection stability improvements for production issues

Open sanity opened this issue 6 months ago • 0 comments

Summary

  • Fix graceful handling of RSA intro packets on established connections
  • Make keep-alive constants consistent between debug and release builds

Fixes

  1. Intro packet handling: When established connections receive 256-byte RSA intro packets (e.g., when a peer tries to reestablish), we now decrypt and ACK them instead of logging decryption errors
  2. Keep-alive compatibility: Debug and release builds now use the same timing (10s interval, 30s timeout) to prevent premature connection drops

Root Cause

Production decryption errors after ~60 seconds were caused by:

  • Debug/release keep-alive incompatibility causing legitimate timeouts
  • Lack of graceful handling when peers sent intro packets to reestablish

Test plan

  • [x] Integration tests pass
  • [ ] Deploy to gateways and verify connection stability
  • [ ] Monitor for decryption errors in production

🤖 Generated with Claude Code

sanity avatar Jun 10 '25 04:06 sanity