-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Implement logic for sending and delivering messages.
Key implementation tasks:
-
Create message preparation function that:
- Increments and assigns Lamport timestamp for the channel
- Extracts recent message IDs from local log for causal history
- Gets current serialized Bloom filter state
- Generates unique message ID
- Assembles complete Message object
-
Implement outgoing message handling:
- Add message to unacknowledged outgoing buffer for channel
- Track message state for acknowledgment/retry
- Handle buffer size limits and cleanup
- Maintain message ordering guarantees
-
Add broadcast mechanism that:
- Supports multiple transport methods
- Handles serialization of Message object
- Provides proper error handling
- Includes retry logic for failed sends
- Supports test environment simulation
-
Implement message delivery logic:
- Update local Lamport timestamp based on received message timestamp
- Sort messages by Lamport timestamp
- Break timestamp ties using messageID comparison
- Insert messages into local log maintaining order
- Trigger delivery callbacks/events
- Handle delivery of buffered messages when dependencies are met
-
Create test infrastructure:
- Mock transport layer
- Verify message preparation correctness
- Test causal history extraction
- Validate Lamport timestamp behavior
- Confirm proper buffer management
- Test message ordering and delivery sequences
- Verify tie-breaking behavior
The implementation should maintain causal ordering guarantees while being resilient to network issues and message delivery failures.
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done