Skip to content

Tracking recent SDS spec changes to be implemented in nim-sds #25

@shash256

Description

@shash256

This issue tracks the implementation of recent changes to the SDS specification.

The following changes need to be implemented:

1. Addition of sender_id

The Message protobuf definition in the specification has been updated to include a sender_id.

  • The sender_id field (field number 1) must be added to the SdsMessage type in src/message.nim and the corresponding protobuf encoding/decoding in src/protobuf.nim.
  • The sending participant MUST include its own globally unique identifier in the sender_id field when sending a message.

2. Participant State and Message Handling

  • Upon receiving a message, the participant SHOULD ignore the message if it has a sender_id matching its own. This logic should be added to the message processing flow, within unwrapReceivedMessage in src/reliability.nim.
  • Do not send a sync message if the causal history is empty i.e., there are no messages in the channel. Discussion

3. Lamport Timestamp Initialization & Increment

The initialization and incrementing of the Lamport timestamp for each channel has been updated in the specification.

Old specification:

A Lamport timestamp for each channel of communication, initialized to 0.

New specification:

A Lamport timestamp for each channel of communication, initialized to current epoch time in millisecond resolution and incremented by max(timeNowInMs, current_lamport_timestamp + 1) where timeNowInMs is current epoch time in millisecond resolution.

The current implementation in getOrCreateChannel initializes the lamportTimestamp to 0. This needs to be updated to initialize with the above defined value. Also need to make sure the lamport timestamp is uint64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions