'Given a local and remote auth chain, find the differences. This
assumes that we have already processed all events in remote_auth
Params:
local_auth (list)
remote_auth (list)
Returns:
dict'

@defer.inlineCallbacks
def construct_auth_difference(self, local_auth, remote_auth):

    logger.debug('construct_auth_difference    Start!')
    def sort_fun(ev):
        return (ev.depth, ev.event_id)
    logger.debug('construct_auth_difference    after    sort_fun!')
    remote_list = list(remote_auth)
    remote_list.sort(key=sort_fun)
    local_list = list(local_auth)
    local_list.sort(key=sort_fun)
    local_iter = iter(local_list)
    remote_iter = iter(remote_list)
    logger.debug('construct_auth_difference    before    get_next!')
    def get_next(it, opt=None):
        try:
            return it.next()
        except:
            return opt
    current_local = get_next(local_iter)
    current_remote = get_next(remote_iter)
    logger.debug('construct_auth_difference    before    while')
    missing_remotes = []
    missing_locals = []
    while (current_local or current_remote):
        if (current_remote is None):
            missing_locals.append(current_local)
            current_local = get_next(local_iter)
            continue
        if (current_local is None):
            missing_remotes.append(current_remote)
            current_remote = get_next(remote_iter)
            continue
        if (current_local.event_id == current_remote.event_id):
            current_local = get_next(local_iter)
            current_remote = get_next(remote_iter)
            continue
        if (current_local.depth < current_remote.depth):
            missing_locals.append(current_local)
            current_local = get_next(local_iter)
            continue
        if (current_local.depth > current_remote.depth):
            missing_remotes.append(current_remote)
            current_remote = get_next(remote_iter)
            continue
        if (current_local.event_id < current_remote.event_id):
            missing_locals.append(current_local)
            current_local = get_next(local_iter)
        if (current_local.event_id > current_remote.event_id):
            missing_remotes.append(current_remote)
            current_remote = get_next(remote_iter)
            continue
    logger.debug('construct_auth_difference    after    while')
    missing_remote_ids = [e.event_id for e in missing_remotes]
    base_remote_rejected = list(missing_remotes)
    for e in missing_remotes:
        for (e_id, _) in e.auth_events:
            if (e_id in missing_remote_ids):
                try:
                    base_remote_rejected.remove(e)
                except ValueError:
                    pass
    reason_map = {}
    for e in base_remote_rejected:
        reason = (yield self.store.get_rejection_reason(e.event_id))
        if (reason is None):
            continue
        reason_map[e.event_id] = reason
        if (reason == RejectedReason.AUTH_ERROR):
            pass
        elif (reason == RejectedReason.REPLACED):
            pass
        elif (reason == RejectedReason.NOT_ANCESTOR):
            pass
    logger.debug('construct_auth_difference    returning')
    defer.returnValue({'auth_chain': local_auth, 'rejects': {e.event_id: {'reason': reason_map[e.event_id], 'proof': None} for e in base_remote_rejected}, 'missing': [e.event_id for e in missing_locals]})
