Skip to content

Feat/request sync manager#650

Draft
a1denvalu3 wants to merge 5 commits intopermissionlesstech:mainfrom
a1denvalu3:feat/request-sync-manager
Draft

Feat/request sync manager#650
a1denvalu3 wants to merge 5 commits intopermissionlesstech:mainfrom
a1denvalu3:feat/request-sync-manager

Conversation

@a1denvalu3
Copy link
Contributor

Summary

This PR implements the Request Sync Manager to make sync requests "less blind" and improve security by attributing sync responses to specific peers.

Key Changes

  • BinaryProtocol: Added IS_RSR flag (0x10u) and isRSR field to BitchatPacket.
  • RequestSyncPacket: Updated to include requestId (for attribution) and future filter fields.
  • RequestSyncManager: New component to track pending sync requests and validate incoming RSR packets.
  • GossipSyncManager: Updated to use unicast sync requests registered with RequestSyncManager instead of blind broadcasts.
  • SecurityManager:
    • Enforces timestamp validation (max 2 min skew) for normal packets.
    • Exempts RSR packets from timestamp validation only if they are solicited and validated by RequestSyncManager.

Documentation

  • Added docs/REQUEST_SYNC_MANAGER.md with implementation details.

Closes #622

a1denvalu3 added 5 commits January 16, 2026 01:41
Implements Request Sync Manager for secure, attributed synchronization. Updates BinaryProtocol with IS_RSR flag and RequestSyncPacket with requestId and filters. Enforces timestamp validation in SecurityManager while exempting solicited RSR packets. Updates GossipSyncManager to use unicast sync requests.
Treats packets with SYNC_TTL_HOPS (0) as potential RSR candidates. If validated against a pending request, they bypass timestamp checks. If unsolicited, legacy packets fall through to standard timestamp validation (rejected if old), while explicit RSR packets are rejected immediately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Separate treatment of REQUEST_SYNC responses

1 participant