Background
We need to update the SDS protocol to support more efficient message retrieval from Store nodes as per this update to the SDS specification: logos-co/logos-lips#130
Problem
Currently, causal history entries only contain SDS message IDs. When a participant needs to retrieve missing messages based on causal dependencies, they have no way to efficiently query Store nodes since:
- Store nodes work with Waku message hashes, not SDS message IDs
- Time-based queries are inefficient and unreliable
- We lack a mapping between SDS message IDs and queryable identifiers
Proposed Solution
Update the causal history structure to include optional retrieval hints that can be used to efficiently query external stores:
message Message {
string message_id = 2;
string channel_id = 3;
optional int32 lamport_timestamp = 10;
repeated HistoryEntry causal_history = 11; // Updated structure
optional bytes bloom_filter = 12;
optional bytes content = 20;
}
message HistoryEntry {
string message_id = 1; // SDS message ID
optional bytes retrieval_hint = 2; // Optional hint for efficient retrieval (e.g., Waku message hash)
}
Motivation
- Efficient Store Queries: Applications can provide Waku message hashes as retrieval hints for direct Store node queries
- Separation of Concerns: SDS message IDs remain independent of transport layer concerns
- Backward Compatibility: Optional field ensures existing implementations continue to work
Implementation Tasks
1. Update Protocol Definitions
2. Update Core Logic
3. API Changes
4. Testing Requirements
Background
We need to update the SDS protocol to support more efficient message retrieval from Store nodes as per this update to the SDS specification: logos-co/logos-lips#130
Problem
Currently, causal history entries only contain SDS message IDs. When a participant needs to retrieve missing messages based on causal dependencies, they have no way to efficiently query Store nodes since:
Proposed Solution
Update the causal history structure to include optional retrieval hints that can be used to efficiently query external stores:
Motivation
Implementation Tasks
1. Update Protocol Definitions
message.nimto include newHistoryEntrytypeMessagestruct to useseq[HistoryEntry]instead ofseq[MessageID]forcausalHistoryprotobuf.nim2. Update Core Logic
wrapOutgoingMessageto populate retrieval hints when creating causal historyHistoryEntrystructure3. API Changes
markDependenciesMetto handle both message IDs and retrieval hintsseq[HistoryEntry]4. Testing Requirements
HistoryEntrytype