Skip to content

Create a nim library for SDS implementation from the API specification #5

@shash256

Description

@shash256

Implement an end-to-end reliability, aka Scalable Data Sync (SDS) library in Nim according to the API specification that provides reliability primitives for further integration to status-go.

Tasks:

Core Library Implementation

  • Implement core types:

    • Message, MessageID, UnacknowledgedMessage
    • ReliabilityManager
    • ReliabilityConfig with customizable parameters
    • Results and Error types
  • Implement reliability primitives:

    • wrapOutgoingMessage: Add reliability metadata before encryption
    • unwrapReceivedMessage: Extract reliability metadata and track dependencies
    • markDependenciesMet: Handle dependency resolution
    • setCallbacks: Allow application to handle events

Message Tracking & Ordering

  • Implement Lamport Clock mechanisms
    • Initialize and update timestamps
    • Maintain causal ordering
  • Implement message history tracking
    • Short-term message ID logging
    • Causal history management
    • Handle message dependencies

Message State Management

  • Buffer management
    • Unacknowledged outgoing messages
    • Messages with unmet dependencies
    • Buffer maintenance and cleanup
  • ACK tracking
    • Track message acknowledgments via bloom filters
    • Track acknowledgments via causal history
    • Clean expired entries

Periodic Tasks

  • Implement periodic maintenance tasks
    • Buffer sweeping
    • Bloom filter cleaning
    • Sync message scheduling

Testing

  • Unit tests for major components
  • Integration tests for:
    • Message ordering
    • Dependency tracking
    • ACK/resend mechanisms
    • Edge cases

Acceptance Criteria:

  • Library provides all the required methods and callbacks as per the specification
  • Causal dependencies are properly tracked and resolved
  • Message acknowledgment works via bloom filter and causal history
  • Thread-safe operations with proper locking
  • Test coverage & error handling

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions