Problem
The client-side SyncRequest handler in crates/client/src/listeners.rs uses the legacy state_hash field which is meaningless in the DAG model. It currently sends the first 500 events from topological sort regardless of the requester's state, causing redundant data transfer.
The worker-side sync protocol already uses HeadsSummary-based delta sync (WorkerRequest::Sync { heads }), which is much more efficient.
Suggested fix
Migrate the client's sync protocol to use HeadsSummary advertising (same as workers):
- Replace
WireMessage::SyncRequest { state_hash } with a heads-based variant
- Use
EventDag::events_since() to compute deltas
- Remove the legacy
state_hash field from the wire protocol
Location
crates/client/src/listeners.rs:230-248
Found during audit of #26.
Problem
The client-side
SyncRequesthandler incrates/client/src/listeners.rsuses the legacystate_hashfield which is meaningless in the DAG model. It currently sends the first 500 events from topological sort regardless of the requester's state, causing redundant data transfer.The worker-side sync protocol already uses
HeadsSummary-based delta sync (WorkerRequest::Sync { heads }), which is much more efficient.Suggested fix
Migrate the client's sync protocol to use
HeadsSummaryadvertising (same as workers):WireMessage::SyncRequest { state_hash }with a heads-based variantEventDag::events_since()to compute deltasstate_hashfield from the wire protocolLocation
crates/client/src/listeners.rs:230-248Found during audit of #26.