pub fn encode_sync_state(state: &SyncState) -> Uint8Array