OpChan/src/lib/waku/sds/debug.ts
Arseniy Klempner ac6e6a7d21
feat: minimal SDS integration for vote consistency
- Added @waku/sds dependency
- Created MinimalSDSWrapper for basic causal ordering
- Enhanced vote messages with SDS metadata (Lamport timestamps, causal history)
- Updated MessageManager to use SDS for vote conflict resolution
- Added SDS status indicator in header
- Added debug logging for SDS operations

This is a minimal proof-of-concept that:
- Uses a single SDS channel for all votes
- Only applies to vote messages (other message types unchanged)
- Maintains backward compatibility
- Can be disabled by removing the SDS enhancement
2025-06-11 14:07:47 -07:00

21 lines
532 B
TypeScript

// Simple debug logger for SDS operations
export const SDSDebug = {
enabled: true,
log(message: string, data?: any) {
if (!this.enabled) return;
const timestamp = new Date().toISOString().split('T')[1].split('.')[0];
const prefix = `[SDS ${timestamp}]`;
if (data) {
console.log(`${prefix} ${message}`, data);
} else {
console.log(`${prefix} ${message}`);
}
},
logVote(action: string, voteKey: string, data?: any) {
this.log(`VOTE ${action} - ${voteKey}`, data);
}
};