generated from MetaMask/metamask-module-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
ocap-enhancementOCAP Kernel enhancementOCAP Kernel enhancement
Description
Problem: The remote communications system lacks essential resource limits to prevent memory exhaustion and manage system resources. Without limits on concurrent connections, message sizes, and stale peer data, the system can accumulate unbounded state.
Expected Behavior:
- Limit total concurrent connections to 100 (reject new connections when limit reached)
- Limit individual message size to 1MB (reject messages exceeding limit)
- Periodically clean up data for peers disconnected for more than 1 hour (remove queues, reconnection state, etc.)
Implementation:
- Add connection limit check in
sendRemoteMessage()before dialing new connections - Add message size validation before queuing or sending messages
- Implement periodic cleanup task that tracks last connection time and removes stale peer data
- Use simple drop-oldest or reject-new strategies for limits
Acceptance Criteria:
- Maximum 100 concurrent connections enforced
- Messages over 1MB are rejected
- Stale peer data is cleaned up after 1 hour of disconnection
- Tests verify all limits and cleanup behavior
Metadata
Metadata
Assignees
Labels
ocap-enhancementOCAP Kernel enhancementOCAP Kernel enhancement