Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sds: Implement logic for tracking sent messages #2229

Open
adklempner opened this issue Jan 27, 2025 · 0 comments · May be fixed by #2261
Open

sds: Implement logic for tracking sent messages #2229

adklempner opened this issue Jan 27, 2025 · 0 comments · May be fixed by #2261
Assignees

Comments

@adklempner
Copy link
Member

adklempner commented Jan 27, 2025

Implement logic for sending and delivering messages.

Key implementation tasks:

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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.

@chair28980 chair28980 added this to Waku Jan 27, 2025
@adklempner adklempner changed the title sds: Implement logic for tracking sent messages. sds: Implement logic for tracking sent messages Jan 28, 2025
@weboko weboko moved this to To Do in Waku Jan 30, 2025
@adklempner adklempner moved this from To Do to Code Review / QA in Waku Feb 13, 2025
@adklempner adklempner self-assigned this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review / QA
Development

Successfully merging a pull request may close this issue.

1 participant