You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The worker sync actor (crates/worker/src/actors/sync.rs:68-82) uses WorkerRequest::Sync { server_id, heads } with bulk WorkerResponse::SyncBatch { events } responses. This does not match the spec's per-author sync protocol.
Spec requires:
pubenumSyncMessage{/// "Here's what I have." Sent on connect and periodically.Advertise(HeadsSummary),/// "I need events from these authors after these seq numbers."Request(Vec<AuthorRequest>),/// "Here are events you're missing."Response(Vec<Event>),}pubstructAuthorRequest{pubauthor:EndpointId,pubafter_seq:u64,}
Current implementation:
Sync broadcasts a single WorkerRequest::Sync with heads
Response is a bulk SyncBatch of all events, not per-author
No Advertise message for proactive head exchange
No AuthorRequest for targeted per-author fetching
Impact
Redundant data transfer — bulk batches include events the requester already has
No per-author granularity — cannot request specific authors' missing events
Doesn't support parallel fetching from different authors
Problem
The worker sync actor (
crates/worker/src/actors/sync.rs:68-82) usesWorkerRequest::Sync { server_id, heads }with bulkWorkerResponse::SyncBatch { events }responses. This does not match the spec's per-author sync protocol.Spec requires:
Current implementation:
WorkerRequest::Syncwith headsSyncBatchof all events, not per-authorAdvertisemessage for proactive head exchangeAuthorRequestfor targeted per-author fetchingImpact
Suggested fix
Implement the spec's three-phase sync:
HeadsSummary(already partially done viaheads_summaries())Location
crates/worker/src/actors/sync.rs:68-82crates/worker/src/actors/state.rs:34-43(response format)crates/common/src/worker_types.rs(WorkerRequest/WorkerResponse types)References
docs/specs/2026-04-01-per-author-merkle-dag-state-design.md(Section 3, Sync Protocol)