s2fieldsofstudy:
Computer Science
Mathematics

text:
Some lower bounds in dynamic networks with oblivious adversaries

This paper considers several closely-related problems in synchronous dynamic networks with oblivious adversaries, and proves novel Ω(d+poly(m))\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varOmega (d + \text{ poly }(m))$$\end{document} lower bounds on their time complexity (in rounds). Here d is the dynamic diameter of the dynamic network and m is the total number of nodes. Before this work, the only known lower bounds on these problems under oblivious adversaries were the trivial Ω(d)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\varOmega (d)$$\end{document} lower bounds. Our novel lower bounds are hence the first non-trivial lower bounds and also the first lower bounds with a poly(m)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\text{ poly }(m)$$\end{document} term. Our proof relies on a novel reduction from a certain two-party communication complexity problem. Our central proof technique is unique in the sense that we consider that communication complexity problem with a special leaker. The leaker helps Alice and Bob in the two-party problem, by disclosing to Alice and Bob certain “non-critical” information about the problem instance that they are solving.

Introduction
Dynamic networks [24] is a flourishing topic in recent years. We consider a synchronous setting where the m (fixed) nodes in the network proceed in synchronous rounds. Each node has a unique id of size O(log m), and the messages are of size O(log m) as well. The nodes never fail. The topology of the dynamic network can change from round to round, as determined by an adversary, subject to the only constraint that the topology in each round must be a connected and undirected graph. The time complexity of a protocol is the number of rounds needed for all nodes to generate the final output, over the worst-case adversary, worst-case initial values, and average coin flips of the protocol. We consider a number of The authors of this paper are alphabetically ordered. This work is partly supported by the research Grant MOE2014-T2-2-030 from Singapore Ministry of Education Academic Research Fund Tier-2. This work was done while Y. Zhao was in National University of Singapore.
A preliminary conference version [18] of this paper is published in the 31st International Symposium on Distributed Computing, October 2017. -Consensus Each node has a binary input. The nodes aim to achieve a consensus (with the standard agreement, validity, and termination requirements) and output the final decision. -LeaderElect Each node should output the leader's id.
-ConfirmedFlood A certain node ν aims to propagate a token of size O(log m) to all other nodes, and wants to further confirm that all nodes have received the token. 1 Formally, node ν's output is correct only if by the time that ν outputs, the token has already been received by all the nodes. (The value of the output is not important.) The remaining nodes can output any time. -Aggregation Each node has a value of O(log m) bits, and the nodes aim to compute a certain aggregation function over all these values. We consider two specific aggregation functions, Sum and Max.
Let d be the (dynamic) diameter (see definition later) of the dynamic network. (Note that since the topology is controlled by an adversary, the protocol never knows d beforehand.) Given an optimal protocol for solving any of the above problems, let tc(d, m) denote the protocol's time complexity, when it runs over networks with d diameter and m nodes. It is easy to see that tc(d, m) crucially depends on d, since we trivially have tc(d, m) = Ω(d). Given such, this paper focus on the following central question: Ignoring polylog(m) terms, is tc(d, m) independent of the network size m?
Answering this fundamental question will reveal whether the complexity of all these basic problems is due to the diameter or due to both the diameter and the network size.
Existing results. If the network were static, then building a spanning tree would solve all these problems in either O(d) or O(d log m) rounds, implying a yes answer to the above question. In dynamic networks, the picture is more complex. In a dynamic network model without congestion (i.e., message size unlimited), Kuhn et al. [22] have proposed elegant upper bound protocols with O(d) complexity for all these problems. Hence the answer is yes as well. For dynamic networks with congestion (i.e., message size limited to O(log m)), Yu et al. [29] recently have proved that tc(d, m) = O(d log m) for Consensus and LeaderElect, if the nodes know a good estimate on m. 2 Hence the answer is yes in such cases. On the other hand, if nodes' estimate on m is poor, 3 then Yu et al. [29] prove a lower bound of Ω(d + poly(m)) for Consensus and LeaderElect, implying a no answer. For ConfirmedFlood and Aggregation, they have also proved tc(d, m) = Ω(d + poly(m)), even if the nodes know m. This implies a no answer for those two problems.
All the lower bound proofs in [29], however, critically rely on a powerful adaptive adversary: In each round, the adaptive adversary sees all the coin flip outcomes so far of the protocol P and manipulates the topology based on those. In particular, in each round the adversary sees whether each node will be sending (and can then manipulate the topology accordingly), before the nodes actually send their messages. Their proof breaks under oblivious adversaries, which do not see P's coin flip outcomes and have to decide the topologies in all the rounds before P starts. 4 In summary, our central question of whether tc(d, m) is largely independent of the network size m has been answered in: (i) static networks, (ii) dynamic networks without congestion under both adaptive and oblivious adversaries, and 2 More precisely, if the nodes know m such that | m −m m | ≤ 1 3 − c for some positive constant c. Obviously, this covers the case where the nodes know m itself. 3 More precisely, if the nodes only knows m such that | m −m m | reaches 1 3 or above. Obviously, this covers the case where the nodes do not have any knowledge about m. 4 Note however that all upper bounds, from [22,29], will directly carry over to oblivious adversaries.
(iii) dynamic networks with congestion under adaptive adversaries.
Our results. This work gives the last piece of the puzzle for answering our central question. Specifically, we show that in dynamic networks with congestion and under oblivious adversaries, for Consensus and LeaderElect, the answer to the question is no when the nodes' estimate on m is poor. (If the nodes' estimate on m is good, results from [29] already implied a yes answer.) Specifically, we prove a novel Ω(d + poly(m)) lower bound on Consensus under oblivious adversaries, when the nodes' estimate on m is poor. This is the first non-trivial lower bound and also the first lower bound with a poly(m) term, for Consensus under oblivious adversaries. The best lower bound before this work was the trivial Ω(d) lower bound. Our Consensus lower bound directly carries over to LeaderElect since Consensus reduces to LeaderElect [29]. Our approach may also be extended to ConfirmedFlood, which in turn reduces to Sum and Max [29]. But since the lower bound proof for ConfirmedFlood is similar to and in fact easier than our Consensus proof, for clarity, we will not separately discuss it in this paper.
Different adversaries. In dynamic networks, different kinds of adversaries often require different algorithmic techniques and also yield different results. Hence it is common for researchers to study them separately. For example, lower bounds for information dissemination were proved separately, under adaptive adversaries [14] and then later under oblivious adversaries [1]. Dynamic MIS was investigated separately under adaptive adversaries [19] and later under oblivious adversaries [9]. Broadcasting was first studied under adaptive adversaries [20], and later under oblivious adversaries [15].
Our approach. Our novel Consensus lower bound under oblivious adversaries is obtained via a reduction from a two-party communication complexity (CC) problem called Gap Disjointness with Cycle Promise or Gdc. Our reduction essentially follows the existing proof framework under adaptive adversaries [29], but has two major differences. In fact, these two novel aspects also make our central proof technique rather unique, when compared with other works that use reductions from CC problems [10,13,23].
The first novel aspect is that we reduce from Gdc with a special leaker that we design. The leaker is an oracle in the Gdc problem, and is separate from the two parties Alice and Bob . It helps Alice and Bob, by disclosing to them certain "non-critical" information in the following way. For a CC problem Π , let Π n (X , Y ) be the answer to Π for length-n inputs X and Y . Let x i and y i denote the ith character of X and Y , respectively. We define (a, b) to be a leakable pattern if for all n, X , Y , and i ∈ [0, n] 5 : . . x n , y 1 y 2 . . . y n ) = Π n+1 (x 1 x 2 . . . x i ax i+1 x i+2 . . . x n , y 1 y 2 . . . y i by i+1 y i+2 . . . y n ) Intuitively, for all (X , Y ), the answer to Π does not change when an occurrence of a leakable pattern is either inserted into or removed from (X , Y ). Note that since the property needs to hold for all n and for all (X , Y ), the answer to Π will not change either when multiple occurrences of a leakable pattern (or multiple occurrences of multiple leakable patterns) are inserted or removed. For each index i where x i = a and y i = b for some leakable pattern (a, b), independently with probability 1 2 , our leaker leaks the index i. Here leaking the index i means that the leaker lets both Alice and Bob know for free the values of i, x i , and y i , before Alice and Bob start running their protocol.
We will mainly be concerned with the Gdc problem with our leaker. Note that there are many possible ways of defining a leaker, and our specific definition above is not necessarily suitable in all other contexts. (For example, we require a leakable pattern to be "leakable" under all n, X , and Y . Alternatively, one could define this notion with respective to given X and Y .) Our goal is simply to facilitate the reduction from Gdc to Consensus under oblivious adversaries, rather than aiming for the best generality.
Even with our leaker, the reduction from Gdc to Consensus still does not allow us to directly use an oblivious adversary. Instead, as the second novel aspect, we will use a special kind of adaptive adversaries which we call sanitized adaptive adversaries. These adversaries are still adaptive, but their "adaptivity" has been "sanitized" by taking XOR with independent coin flips. We then show that a sanitized adaptive adversary is no more powerful than an oblivious adversary, in terms of incurring the cost of a protocol.

Roadmap.
At the technical level, this paper will eventually present two separate and completely independent reductions. The first reduction (elaborated in Sect. 8) is from the Gdc problem without our leaker to the Gdc problem with our leaker. In this reduction, we start with 2 entities: Alice and Bob. They aim to solve the Gdc problem without our leaker (i.e., the standard Gdc problem). They do so by simulating our leaker, and then invoking some black-box protocol that solves the Gdc problem with our leaker.
The second reduction (elaborated in Sect. 9) is from the Gdc problem with our leaker to the Consensus problem. In this reduction, we start with three entities: Alice, Bob, and the leaker. The three entities together try to solve the Gdc problem, by simulating some black-box Consensus protocol. In this reduction, the leaker is given, and is not simulated by Alice and Bob.

Related work
This section discusses related works beyond those already covered in the previous section.
Related work on Consensus and LeaderElect. Given the importance of Consensus and LeaderElect in dynamic networks, there is a large body of related efforts and we can only cover the most relevant ones. In dynamic networks without congestion, Kuhn et al. [22] show that the simultaneous consensus problem has a lower bound of Ω(d + poly(m)) round. In this problem, the nodes need to output their consensus decisions simultaneously. Their knowledge-based proof exploits the need for simultaneous actions, and does not apply to our setting. Some other researchers (e.g., [3,4]) have studied Consensus and LeaderElect in a dynamic network model where the set of nodes can change and where the topology is an expander. Their techniques (e.g., using random walks) critically rely on the expander property of the topology, and hence do not apply to our setting. Augustine et al. [2] have proved an upper bound of O(d log m) for Lead-erElect in dynamic networks while assuming d is known to all nodes. This does not contradict with our lower bound, since we do not assume the knowledge of d. Certain Consensus and LeaderElect protocols (e.g., [17]) assume that the network's topology eventually stops changing, which is different from our setting where the change does not stop. Consensus and LeaderElect have also been studied in directed dynamic networks (e.g., [12,26]), which are quite different from our undirected version. In particular, lower bounds there are mostly obtained by exploiting the lack of guaranteed bidirectional communication in directed graphs. Our Aggregation problem considers the two aggregation functions Sum and Max. Cornejo et al. [11] considers a different aggregation problem where the goal is to collect distributed tokens (without combining them) to a small number of nodes. Some other research (e.g., [7]) on Aggregation assumes that the topology in each round is a (perfect) matching, which is different from our setting where the topology must be connected.
Related work on reductions from CC. Reducing from twoparty CC problems to obtain lower bounds for distributed computing problem has been a popular approach in recent years. For example, Kuhn and Oshman [23] and Das Sarma et al. [13] have obtained lower bounds on the hear-from problem and the spanning tree verification problem, respectively, by reducing from Disjointness. In particular, Kuhn    The δ-error communication complexity of problem Π L δ (Π ) The δ-error communication complexity of problem Π with our leaker The number of occurrences of the (a, b) pattern in (X , Y ) al.'s work [10] on computing Sum in static networks with node failures has used a reduction from the Gdc 1,q n problem. Our reduction in this paper is unique, in the sense that none of these previous reductions use the two key novel techniques in this work, namely the GDC problem with our leaker and sanitized adaptive adversaries.
Related work on CC. To the best of our knowledge, we are the first to exploit the CC with a leaker in reductions to distributed computing problems such as Consensus. Our leaker for the GDC problem serves to allow oblivious adversaries. Quite interestingly, for completely different purposes, the notions of leakable patterns and a leaker have been extensively (but implicitly) used in proofs for obtaining direct sum results on the information complexity (IC) (e.g., [5,8,28]) of various communication problems: First, leakable patterns have been used to construct a collapsing input, for the purpose of ensuring that the answer to the problem Π is entirely determined by (x i , y i ) at some index i. Second, an (implicit) leaker has often been used (e.g., in [8,28]) to enable Alice and Bob to draw (X, Y) from a non-product distribution.
Because of the fundamentally different purposes of leaking, our leaker differs from those (implicit) leakers used in works on IC, in various specific aspects. For example in our work, all leakable pairs are subject to leaking, while in the works on IC, there is some index i that is never subject to leaking. Also, when our leaker leaks index j, it discloses both x j and y j to both Alice and Bob. In comparison, in works on IC, the (implicit) leaking is usually done differently: For exam-ple, Alice and Bob may use public coins to draw x j and Bob may use his private coins to draw y j . Doing so (implicitly) discloses x j to both Alice and Bob and (implicitly) discloses y j only to Bob.
A key technical step in our work is to prove a lower bound on the CC of Gdc g,q n with our leaker. For simpler problems such as Disjointness (which is effectively Gdc 1,2 n ), we believe that such a lower bound could alternatively be obtained by studying its IC with our leaker. But the gap promise and the cycle promise in Gdc g,q n make IC arguments tricky. Hence we will (in Sect. 8) obtain our intended lower bound by doing a direct reduction from the CC of Gdc g,q n without the leaker to the CC of Gdc g,q n with the leaker. Table 1 summarizes the key notations in this paper.

Model and definitions
Conventions. All protocols in this paper refer to Monte Carlo randomized algorithms. We always consider public coin protocols, which makes our lower bounds stronger. All log is base 2, while ln is base e. Upper case fonts (e.g., X ) denote strings, vectors, sets, etc. Lower case fonts (e.g., x) denote scalar values. In particular, if X is a string, then x i means the ith element in X . Bold fonts (e.g., X and x) refer to random variables. Blackboard bold fonts (e.g., D) denote distributions. We write x ∼ D if x follows the distribution D. Script fonts (e.g., P and Q) denote either protocols or adversaries.
Dynamic networks. We consider a synchronous dynamic network with m fixed nodes, each with a unique id of Θ(log m) bits. A protocol in such a network proceeds in synchronous rounds, and starts executing on all nodes in round 1. (Clearly such simultaneous start makes our lower bound stronger.) In each round, each node υ first does some local computation, and then chooses to either send a single message of O(log m) size or receive. (In particular, we follow the standard convention in dynamic networks [24] that if υ sends in a round, it will send the same message to all its neighbors.) All nodes who are υ's neighbors in that round and are receiving in that round will receive υ's message at the end of the round. A node with multiple neighbors may receive multiple messages. We emphasize that a node does not know its neighbors in each round beforehand-it can only infer such information based on the messages that it receives. The topology of the network may change arbitrarily from round to round, as determined by some adversary, except that the topology in each round must be a connected undirected graph. (This is the same as the 1-interval model [21].) A node does not know the topology in a round. It does not know its neighbors either, unless it receives messages from them in that round. Section 1 already defined oblivious adversaries and adaptive adversaries. In particular in each round, an adaptive adversary sees all P's coin flip outcomes up to and including the current round, and manipulates the topology accordingly, before P uses the current round's coin flip outcomes.
We use the standard definition for the (dynamic) diameter [24] of a dynamic network: Intuitively, the diameter of a dynamic network is the minimum number of rounds needed for every node to influence all other nodes. Formally, we say that (ω, r ) → (υ, r + 1) if either ω is υ's neighbor in round r or ω = υ. The diameter d of a dynamic network is the smallest d such that (ω, r ) (υ, r + d) for all ω, υ, and r , where " " is the transitive closure of "→". Since the topology is controlled by an adversary, a protocol never knows d beforehand.
Communication complexity. In a two-party communication complexity (CC) problem Π n , Alice and Bob each hold input strings X and Y respectively, where each string has n characters. A character here is q-ary (i.e., an integer in [0, q − 1]) for some given integer q ≥ 2. For any given i, we sometimes call (x i , y i ) as a pair. For any given integers a ∈ [0, q − 1] and b ∈ [0, q − 1], we will call (a, b) as a pattern. Alice and Bob aim to compute the value of the binary function Π n (X , Y ). Given a protocol P for solving Π n for all n (without a leaker), we define cc(P, X , Y , C P ) to be the communication incurred (in terms of number of bits) by P, under the input (X , Y ) and P's coin flip outcomes C P . Note that C P is a random variable while cc() is a deterministic function. We similarly define err(P, X , Y , C P ), which is 1 if P's out-put is wrong, and 0 otherwise. In the following, max X (max Y ) is taken over all input strings X (Y ) with n characters. We define the communication complexity of P to be cc(P, n) = max X max Y E C P [cc(P, X , Y , C P )], and the error of P to be err(P) = max n max X max Y E C P [err(P, X , Y , C P )]. We define the δ-error (0 < δ < 1 2 ) communication complexity of Π n to be R δ (Π n ) = min P cc(P, n), with the minimum taken over all P where err(P) ≤ δ. For convenience, we define R δ (Π 0 ) = 0 and R δ (Π a ) = R δ (Π a ) for non-integer a.
We define similar concepts for CC with our leaker. Section 1 already defined leakable patterns and how our leaker works. We sometimes call a pair (x i , y i ) as a leakable pair if x i = a and y i = b for some leakable pattern (a, b). Given P for solving Π for all n with our leaker, we define cc(P, X , Y , C P , C L ) be the communication incurred by P, under the input (X , Y ), P's coin flip outcomes C P , and the leaker's coin flip outcomes C L .
Here (X , Y ) and C L uniquely determine which indices get leaked. In the following, max X (max Y ) is taken over all input strings X (Y ) with n characters. We define cc(P, Finally, we define the δ-error (0 < δ < 1 2 ) communication complexity of Π n with our leaker, denoted as L δ (Π n ), to be L δ (Π n ) = min P cc(P, n), with the minimum taken over all P such that P solves Π n with our leaker and err(P) ≤ δ. Note that we always have L δ (Π n ) ≤ R δ (Π n ).

Preliminaries on Gap Disjointness with Cycle Promise
The section defines the two-party Gdc problem and describes some basic properties of Gdc.

Definition 1 (Gap Disjointness with Cycle Promise) In Gap
Disjointness with Cycle Promise, denoted as Gdc g,q n , Alice and Bob have input strings X and Y , respectively. X and Y each have n characters, and each character is an integer in [0, q − 1]. Alice and Bob aim to compute Gdc g,q n (X , Y ), defined to be 1 if (X , Y ) contains no (0, 0) pair, and 0 otherwise. The problem comes with the following two promises: -Gap promise (X , Y ) contains either no (0, 0) pair or at least g such pairs. -Cycle promise [10] For each index i, x i and y i satisfy exactly one of the following four conditions: One can easily verify that the cycle promise is trivially satisfied when q = 2. It is also easy to see Gdc 1,2 n degenerates to the classic Disjointness problem. The gap promise and the cycle promise start to impose material restrictions when g ≥ 2 and q ≥ 3, respectively. For example for g = 2 and q = 4, X = 02103 and Y = 03003 satisfy both the two promises, where (X , Y ) contains 2 pairs of (0, 0), at indices 1 and 4. For Gdc, all (0, 0) pairs are non-leakable, while all other pairs are leakable. For example for X = 02103 and Y = 03003, those 3 pairs at index 2, 3, and 5 are leakable. The following result on the CC of Gdc is an adaptation from Theorem C.1 in [10]: Theorem 1 For any constant δ where 0 < δ < 0.5, there exist constants c 1 > 0 and c 2 > 0 such that for all n, g, and q, R δ (Gdc g,q n ) ≥ c 1 n gq 2 − c 2 log n g .
Proof First, we show R δ (Gdc , via a simple reduction: Given any protocol P for solving Gdc g,q n , we will construct a protocol Q for solving Gdc 1,q n/g . In Q, Alice replicates her length-(n/g) input g times to get a length-n input. Bob does the same. Alice and Bob then invoke P and output P's output. It is easy to verify the correctness of this trivial reduction. Next, the theorem directly follows from an existing result from Chen et al. [10] showing that R δ (Gdc 1,q n/g ) ≥ c 1 n gq 2 − c 2 log n g . The proof of Theorem 1 also showed that R δ (Gdc g,q n ) ≥ R δ (Gdc 1,q n/g ). It is important to note that L δ (Gdc g,q n ) ≥ L δ (Gdc 1,q n/g ) does not hold in general. In particular, the previous reduction fails for L δ : After Alice replicates her length-(n/g) input g times, the leaker (over the length-n input) may leak different parts in each of the g segments, and Alice cannot simulate such behavior. Hence when later proving the lower bound on L δ (Gdc g,q n ), we will have to work with the gap promise directly, instead of obtaining the lower bound via L δ (Gdc 1,q n/g ).

Review of existing proof under adaptive adversaries
This section gives an overview of the recent Consensus lower bound proof [29] under adaptive adversaries. That proof is quite lengthy and involved, hence we will stay at the high-level, while focusing on aspects that are more relevant to this paper.
Overview. Consider any Consensus protocol P with 1 10 error. Let tc(d, m) be P's time complexity, when running over dynamic networks controlled by adaptive adversaries and with d diameter and m nodes. The proof in [29] is mainly for proving tc(8, m) = Ω(poly(m)). The proof trivially extends to tc(d, m) for all d ≥ 8. Combining with the trivial Ω(d) lower bound will lead to the final lower bound of Ω(d + poly(m)).
To prove tc(8, m) = Ω(poly(m)), [29] uses a reduction from Gdc g,q n to Consensus. To solve Gdc g,q n (X , Y ), Alice knowing X and Bob knowing Y simulate the Consensus protocol P in the following way: In the simulation, the input (X , Y ) is mapped to a dynamic network. Roughly speaking, if Gdc g,q n (X , Y ) = 1, the resulting dynamic network will have a diameter of 8. Hence P should decide within r 1 = tc(8, m) rounds on expectation. If Gdc g,q n (X , Y ) = 0, then the resulting dynamic network will have a diameter of roughly q 2 . It is then shown [29] that P must take r 2 = Ω(q) rounds to decide in dynamic networks with such a diameter. The value of q is chosen, as a function of tc (8, m), such that r 2 > 10r 1 . Alice and Bob determine the answer to Gdc based on when P decides: If P decides within 10r 1 rounds, they claim that Gdc g,q n (X , Y ) = 1. Otherwise they claim that Gdc g,q n (X , Y ) = 0. To solve Gdc using the above simulation, Alice and Bob need to simulate P for 10r 1 = 10tc(8, m) rounds. In each round, to enable the simulation to continue, Alice and Bob will need to incur O(log m) bits of communication. Hence altogether, they incur 10tc(8, m) · O(log m) bits for solving Gdc g,q n . The lower bound on the CC of Gdc g,q n then immediately translates to a lower bound on tc (8, m).
Crux of the proof. When solving Gdc, Alice only knows X and not Y . This means that Alice does not actually have the full knowledge of the dynamic network, which is a function of (X , Y ). Hence the proof's central difficulty is to design the dynamic network in such a way that Alice can nevertheless still properly simulate P over that dynamic network. The proof in [29] overcomes this key difficulty by (i) leveraging the cycle promise in Gdc, and (ii) using an adaptive adversary-in particularly, using an adaptive adversary is highlighted [29] as a key technique. We give a concise review below.
Given (X , Y ), the dynamic network constructed in [29] has one chain for each index i ∈ [1, n]. Each chain has three nodes in a line (Fig. 1). Consider as an example the ith chain where x i = 0. Since x i = 0, y i must be either 0 or 1 (by the cycle promise). The set of edges on this chain will be different depending on whether y i is 0 or 1-this serves to make the diameter of the dynamic network different when Gdc = 1 and when Gdc = 0, as discussed earlier. The difficulty for Alice, is that she does not know y i , and hence does not know the exact set of edges on this chain. This prevents her from properly simulating those nodes that she need to simulate for this chain. Similar difficulty applies to Bob.
To overcome this difficulty, if a pair (x i , y i ) is not (0, 0), the adversary in [29] will make an adaptive decision for Fig. 1 The adaptive decisions of the adversary in [29] (a) (b) manipulating the edges on the ith chain, 6 to help enable Alice (and also Bob) to simulate. The cycle promise already tells us that for given x i (e.g., 0), there are two possibilities for y i (e.g., 0 and 1). The adaptive decisions of the adversary will have the following end effects: Under the topology resulted from such adaptive decisions, the behavior of those nodes that Alice needs to simulate will depend only on x i and no longer depend on y i . A similar property holds for Bob. The details on why those adaptive decisions can achieve such end effects are complex, and are related to the fundamental fact that a node does not know its neighbors in a round until it receives messages from them. At the same time, those details are entirely orthogonal to this work. Hence we refer interested readers to [29] for such details. Here we will only describe the specifics of all the adaptive decisions made by the adversary, which is needed for our later discussion: Consider any i where (x i , y i ) is not (0, 0). At the beginning of round t i + 1 where t i is some function of x i and y i , the adversary examines the coin flip outcomes of P and determines whether the middle node ν on the ith chain is sending or receiving in round t i + 1 (see Fig. 1). If ν is sending, the adversary removes a certain edge e that is incidental to ν, immediately in round t i + 1. Otherwise the adversary will remove the edge e in round t i + 2. Except these adaptive decisions, the adversary does not make any other adaptive decisions. In particular, the adversary does not need to make adaptive decisions for chains corresponding to (0, 0).

Roadmap for lower bound proof under oblivious adversaries
This section provides the intuition behind our proof of the Consensus lower bound under oblivious adversaries. To facilitate discussion, we define a few simple concepts. We use A to denote the adaptive adversary described in the previous section. Consider the ith chain in the previous section where (x i , y i ) is not (0, 0), and the middle node ν on that chain. Define binary random variable z A = 0 iff ν is send-ing in round t i + 1 in the execution of P against A . Recall that A removes the edge e on this chain in round Making guesses. The adversary A is adaptive since λ A = z A and z A in turn potentially depends on P's coin flips. (A itself does not flip any coins.) Recall that we aim to obtain a lower bound under oblivious adversaries. But an oblivious adversary A cannot have its decision λ A depend on P's coin flips. At the highest level, our idea of allowing A in the reduction is simple: We let A make a blind guess on whether ν is sending. Specifically, imagine that A by itself sets either λ A = 0 or λ A = 1 with equal probability by flipping a fair coin. Similar to A , the adversary A still removes the edge e in round t i + 1 + λ A , except that now λ A is a fair coin. Some quick clarifications will help to avoid confusion here. Define binary random variable z A = 0 iff ν is sending in round t i + 1 in the execution of P against A . Note that z A potentially depends on P's coin flips. First, such a guess made by A can be either correct (i.e., λ A = z A ) or wrong (i.e., λ A = z A ). The adversary A itself cannot tell whether the guess is correct, since A (being oblivious) does not know z A . Alice and Bob together can tell if the guess is correct, because they are simulating both the protocol P and the adversary A , and hence know z A . But they cannot interfere with the guess even if they know it is wrong. Now if the guess is correct, then A will make the decision in the same way as A , and everything will work out as before. But if the guess is wrong, then A can no longer enable Alice to simulate without knowing Y . More specifically, if the guess is wrong, then for the ith chain, the behavior of those nodes that Alice needs to simulate will depend on the value of y i , and Alice does not know y i . To overcome this main obstacle, our key idea is to add a special leaker entity in the two-party CC problem, which should be viewed as an oracle that is separate from Alice and Bob. Now the CC problem has 3 separate and independent entities: Alice, Bob, and the leaker. Conceptually, when the guess is wrong for the ith chain, the leaker discloses for free to Alice and Bob the pair (x i , y i ). (This is just intuition-in the actual proof, such disclosure from the leaker actually occurs at the very beginning of the simulation.) The knowledge of y i then immediately enables Alice to infer the exact behavior of the nodes that she needs to simulate. Similar arguments apply to Bob.
Roadmap. There are two non-trivial technical issues remaining in the above approach: (i) for which chains to make guesses, and (ii) how the leaker impacts the CC of Gdc. Overcoming them will be the main tasks of Sects. 7 and 8, respectively. Section 9 will present our final Consensus lower bound.

Sanitized adaptive adversaries
The difficulty. It turns out that it does not quite work for Alice and Bob to approach the leaker for help when they feel needed. Consider the following example Gdc 2,4 6 instance with X = 000000 and Y = 111100. As explained in Sect. 5, the dynamic network corresponding to this instance has six chains. For all i, we say that the ith chain is an "| a b chain" if x i = a and y i = b. The first four chains in the dynamic network are thus all | 0 1 chains, while the remaining two are | 0 0 chains. The adaptive adversary A in [29] (see Sect. 5) will make adaptive decisions for all | 0 1 chains, but does not need to do so for | 0 0 chains. Applying the idea from Sect. 6, the oblivious adversary A should thus make guesses for those four | 0 1 chains. Note that A needs to be simulated by Alice and Bob. The difficulty is that Alice does not know for which chains a guess should be made, since she does not know which chains are | 0 1 chains. In fact if she knew, she would have already solved Gdc in this instance. Similar arguments apply to Bob.
A naive fix is to simply make a guess for each of the six chains. Imagine now that the guess turns out to be wrong for the last chain, which is a | 0 0 chain. The leaker then needs to disclose (x 6 , y 6 ). Such disclosure unfortunately directly reveals the answer to the Gdc instance. This in turn, reduces the CC of Gdc to 0, rendering the reduction meaningless. (Not disclosing (x 6 , y 6 ) obviously does not work either, since the non-disclosure itself reveals the answer.) Our idea. To overcome this, we do not let Alice and Bob decide for which chains the adversary A should make a guess. Instead, we directly let our leaker decide which indices should be leaked: For every i where (x i , y i ) = (0, 0), the leaker leaks the pair (x i , y i ) with half probability, to both Alice and Bob. In the earlier example, the leaker will leak each of the indices 1 through 4 independently with half probability.
We ultimately aim to design A such that λ A = z A ⊕ s, where the random variable s = 1 iff the leaker leaks index i. (Recall that z A indicates whether the middle node on the chain is sending in round t i + 1.) To do so, if s = 1, then the adversary A will intentionally use a wrong guess: Specifically, it examines the coin flip outcomes of the protocol P to determine z A , and then set λ A = z A . On the other hand, if s = 0 (meaning that index i is not leaked), then the adversary A will behave in the same way as the adaptive adversary A in Sect. 5: Specifically, the adversary A simply sets λ A = z A (i.e., as if A guessed correctly).
Obviously A here is not oblivious (since λ A now depends on z A ), which seems to defeat the whole purpose. Fortunately, this adaptive adversary A is special in the sense that all the adaptivity has been "sanitized" by taking XOR with the independent coin of s. Intuitively, this prevents A from effectively adapting. The following discussion will formalize and prove that such an A is no more powerful than an oblivious adversary, in terms of incurring the cost of a protocol.
Formal results. Without loss of generality, we model an adversary as making a sequence of binary decisions. These binary decisions determine how the topology of the dynamic network changes. Consider any adaptive adversary A , which may flips its own coins when making decisions. Given a protocol P and any initial inputs to P, let {Z 1 , Z 2 , . . . , Z h } be the set of all distinct sequences of decisions that A can possibly make under some coin flip outcomes C P of P and some coin flip outcomes C A of A . Putting it another way, under any given C P and C A , the sequence of decisions made by A will be Z i (for some i). This adaptive adversary A is called a sanitized adaptive adversary if given the protocol P, the initial inputs to P, and C P , the probability (taken over C A ) of the decision sequence of A being Z i is 1 h for all i.
The following simple theorem confirms that a sanitized adaptive adversary A is no more powerful than an oblivious adversary.
Theorem 2 Consider any given Consensus protocol P and any given initial inputs to P. Let f 1 (A , C P , C A ) be the number of rounds needed for all nodes to output in P under the given input, the adversary A , the coin flip outcomes C P of P, and the coin flip outcomes C A of A . Let f 2 (A , C P , C A ) = 0 if P's outputs on all nodes are correct under the same settings as above, and 1 otherwise. For any sanitized adaptive adversary A and any j ∈ {1, 2}, there exists an oblivious adversary B j such that: For given C P , obviously some Z i will maximize f 1 (B Z i , C P , −), and will in turn make However, this Z i may be different for different C P , which prevents us from proving the theorem via this trivial argument. But a slightly more careful analysis, as following, will work.
By the definition of sanitized adaptive adversary, for any given C P we have: Since C P and C A are independent, there must exists some i 0 ∈ [1, h] such that: We now let B 1 = B Z i 0 . One can easily verify that B 1 indeed satisfies the three properties needed by the lemma: The first and the second property directly follow from the discussion above. The third property requires that for every C P , there exists C A such that B 1 's decisions are the same as the decisions made by A under C P and C A . From the definition of sanitized adaptive adversary, under the given C P , the adversary A will make the sequence of decisions Z i 0 with probability 1 h . Hence under C P and some C A , A will make the sequence of decisions Z i 0 .

Communication complexity with the leaker
To get our final Consensus lower bound , the next key step is to prove a lower bound on the CC of Gdc with the leaker. At first thought, one may think that having the leaker will not affect the CC of Gdc much, since (i) the leakable pairs do not impact the answer to Gdc and hence are "dummy" parts, and (ii) the leaker only leaks about half of such "dummy" parts. But as we will quickly see, the Gdc Lemma 1 For all constant δ ∈ (0, 1 2 ) and all n ≥ 1, we have L δ Gdc 16 √ n ln 1 δ ,2 n = 0.
Thus, having a leaker reduces the CC of Gdc 16 √ n ln 1 δ ,2 n from Ω( √ n) to 0, implying that the impact of the leaker is more subtle than expected. In particular, without a careful investigation, it is not even clear whether the CC of Gdc with our leaker is large enough to translate to our intended Ω(d + poly(m)) lower bound on Consensus.
This section will thus do a careful investigation and eventually establish a formal connection between the CC of Gdc with the leaker (L δ ) and the CC of Gdc without the leaker (R δ ) 7 : Theorem 3 For any constant δ ∈ (0, 1 2 ), there exist constants c 1 > 0 and c 2 > 0 such that for all n, g, q, and n = Directly combining Theorem 3 with Theorem 1, we have: , there exist constants c 1 > 0 and c 2 > 0 such that for all n, g, and q, we have Later we will see that the above lower bound on Gdc with our leaker is sufficient for us to get a final Ω(d + poly(m)) lower bound on Consensus.

Our approach and key ideas
While we will only need to prove Theorem 3 for Gdc, we will consider general two-party problem Π , since the unique specifics of Gdc are not needed here. We will prove Theorem 3 via a reduction: Using any given δ-error protocol P for solving Π n with the leaker, we will construct a δ-error protocol Q for solving Π n without the leaker, where n is some value that is smaller than n. Such a reduction will then lead to R δ (Π n ) = O(L δ (Π n )).
Recall that we use leakable pattern to denote each kind of leakable pairs. For example, Gdc 1,2 n has leakable patterns of (1, 1), (0, 1), and (1, 0). Note that leakable patterns are determined by the problem Π and not by an instance of the problem. We use k ∈ [0, q 2 ] to denote the total number of leakable patterns for Π whose inputs are q-ary strings. For Gdc g,q n , k = 2q − 1. 7 Note that Lemma 1 does not contradict with Theorem 3. For g = . Lemma 1 and Theorem 3 do not contradict because R δ (Gdc g,2 n ) is actually 0. Specifically, for c 2 < 32 √ 2 ln 1 δ , we have g > n and therefore the answer to the Gdc g,2 n problem is always 1-otherwise we would violate the gap promise. Hence R δ (Gdc g,2 n ) = 0. Simulating the leaker via padded pairs. The central difficulty in the reduction is that Alice and Bob running Q need to simulate the leaker, in order to invoke the given protocol P. (Note that P here is the two-party protocol, and has nothing to do with the Consensus protocol.) This is difficult because each party only knows her/his own input. Our first step to overcome this difficulty is to pad known characters to the inputs and then leak only those padded characters, as explained next.
Let (X , Y ) be the given input to Q. Assume for simplicity that (2, 1) is the only leakable pattern in Π , and consider the problem instance in Fig. 2 where X = 02 and Y = 01. Alice and Bob will append/pad a certain number of occurrences of each leakable pattern to (X , Y ). Let (X , Y ) denote the resulting strings after the padding. In the example in Fig. 2, Alice and Bob append 1 occurrence of (2, 1) to (X , Y )-or more specifically, Alice appends 2 to X and Bob appends 1 to Y . Doing so gives X = 022 and Y = 011. Note that doing so does not involve any communication, since the leakable patterns are publicly known. Imagine that Alice and Bob now invoke P using (X , Y ), where X = 022 and Y = 011. Note that the two-party protocol P assumes the help from our leaker. Alice and Bob can easily simulate the leaking of (x 3 , y 3 ), since (x 3 , y 3 ) is the padded pair and they both know that the pair is exactly (2, 1). However, (x 2 , y 2 ) is also a leakable pair. Alice and Bob still cannot simulate the leaking of this pair, since this pair originated from (X , Y ) and they do not know the value of this pair.
To overcome this, Alice and Bob use public coins to generate a random permutation, and then use the permutation to permute X and Y , respectively (Fig. 2). This step does not involve communication. For certain problems Π (e.g., for Gdc), one can easily verify that such permutation will not affect the answer to Π . Such permutation produces an interesting effect, as illustrated in Fig. 2. The upper part of Fig. 2 plots the 6 possible outcomes after the permutation, for our earlier example of X = 022 and Y = 011. Before the permu-tation, the last pair in (X , Y ) is a padded pair. Imagine that Alice and Bob leak this pair. Now after the permutation, this leaked pair will occupy different indices in the 6 outcomes of the permutation.
The bottom part of Fig. 2 illustrates the (real) leaker's behavior over certain inputs. To help understanding, assume here for simplicity that the leaker leaks exactly half of all the leakable pairs. Now consider 3 different inputs (022, 011), (202, 101), and (220, 110). One can see that the behavior of the leaker over these 3 inputs (see Fig. 2) exactly matches the result of permutation as done by Alice and Bob. Hence when Alice and Bob feed the result of the permutation into P while leaking the padded pair, it is as if P were invoked over the previous 3 inputs (each chosen with 1/3 probability) together with the real leaker. This means that P's correctness and CC guarantees should continue to hold, when Alice and Bob invoke P while leaking only the padded pair.
How many pairs to leak. Imagine that (X , Y ) contain o pairs of (2, 1), and Alice and Bob pad p pairs of (2, 1) to (X , Y ). The result of the padding, (X , Y ), will contain o + p pairs of (2, 1). Let f be the number of (2, 1) pairs in (X , Y ) that should be leaked, which obviously follows a binomial distribution with a mean of o+ p 2 . Ideally, Alice and Bob should draw f from the above binomial distribution, and then simulate the leaking of f pairs of (2, 1). (They can do so as long as f ≤ p-with proper p, we easily throw Pr[f > p] into the error.) The difficulty, however, is that Alice and Bob do not know o, and hence cannot draw f with the correct mean of To overcome this, Alice and Bob will estimate the value of o by sampling: For each sample, they use public coin to choose a uniformly random i ∈ [1, n ], and then send each other the values of x i and y i . They will spend total bits for doing this, so that such sampling is effectively "free" and does not impact the asymptotic quality of the reduction. Alice and Bob will nevertheless still not obtain the exact value of o. This means that the distribution they use to draw f will Input: X , n, n , δ, δ , where δ < δ 3 draw a uniformly random integer i ∈ [1, n ] using public coins; 4 send x i to Bob and receive y i from Bob ; append h j copies of a to X , and flag the first b j indices of these h j indices as "to be leaked"; 18 end 19 generate a uniformly random permutation M using public coins; 20 X ← M(X ) /* the flags in X will be treated as part of X and be permuted as well. */; 21 invoke P (together with the other party) using X as input, while leaking all those indices that are flagged, until either P outputs or P has incurred ( 6 δ −δ )cc(P, n) bits of communication ; /* when leaking index i, both x i and y i will be given to P -this can be done since a leaked index here must correspond to a padded pair at Line 17 */; 22 if P has incurred ( 6 δ −δ )cc(P, n) bits of communication then exit with an arbitrary output ; 23 else output P's output and exit ; Protocol 1: Our δ -error protocol Q for solving Π n without our leaker. Q invokes the δ-error two-party protocol P that solves Π n with our leaker. The above only shows Alice's part of Q. Bob's part of Q can be obtained similarly.
be different from the distribution that the (real) leaker uses. Our proof will carefully take into account such discrepancy.

Complete reduction and final guarantees
Pseudo-code. Protocol 1 presents the protocol Q for solving Π n without our leaker, as run by Alice. Q internally invokes the given two-party protocol P, where P solves Π n with our leaker. At Line 1-9, Alice and Bob first exchange sampled indices to estimate the occurrences of each leakable pattern. Next Line 10-12 calculate the amount of padding needed. Line 13-18 do the actual padding, and then for each leakable pattern, flag a certain number of padded pairs as "to be leaked". At Line 19-23, Alice and Bob do a random permutation to obtain (X, Y), and then invoke P on (X, Y) while leaking all those flagged pairs.
We will prove various properties of Protocol 1, which will ultimately lead to the proof for Theorem 3. These properties include Lemmas 2-6 and Theorems 5-6. In particular, we aim to prove that Protocol 1 is correct for all two-party permutation-invariant problem Π . For length-n string X , . Throughout this subsection, we assume that Π is permutation invariant, and when we mention a line number (e.g., Line 5), we refer to the corresponding line of Protocol 1.
We first quantify the estimation quality on the occurrence counts of each leakable pattern as done by the protocol. For 1 ≤ j ≤ k, let w j denote the occurrence count of the jth leakable pattern in (X , Y ). The v j 's in Protocol 1 are essentially estimates for w j . We say that Protocol 1's estimates are good if immediately after Line 9, Proof Let = n 2 2s ln 24k δ −δ . By the definition of good, it suffices to prove: For any j ∈ [1, k], let s j be the number of times v j is incremented by n s in Line 7 of Protocol 1. Each time Line 3 through 7 is executed, v j is incremented only when (x i , y i ) is the jth leakable pattern. Since i is drawn uniformly at random from [1, n ] and since there exists exactly w j indices i ∈ [1, n ] such that (x i , y i ) is the jth leakable pattern, each time Line 3 through 7 is executed v j is incremented with probability exactly w j n . Since Line 3 through 7 is executed s times, s j is the sum of s independent and identical Bernoulli random variables, with each Bernoulli trial having a success probability of w j n . We will apply the Chernoff-Hoeffding bound [16] for absolute error, which states for any 0 ≤ w j n ≤ 1 and a ≥ 0, where it is initially set to zero, and then in Line 7. Thus, v j = s j n s . Hence we have: Finally, taking a union bound for j from 1 through k, we have: Protocol 1 has (X , Y ) as its inputs to Alice and Bob, respectively. It internally converts (X , Y ) to a randomized input (X, Y). For any given (X , Y ), conditioned upon (X, Y) = (X , Y ), we defineT(X , Y ) to be the distribution of the leaked sets, as induced by Protocol 1 at Line 21. Here a leaked set is the set We thus want to quantify the distance between these two distributions.
Consider any two distributions D andD over the same sample space D. We define their L 1 distance (denoted as ||D −D|| and also called variation distance) to be Here f D and fD are the density functions of the two distributions, respectively. The following lemma (whose proof is in "Appendix B") quantifies the L 1 distance betweenT(X , Y ) and T(X , Y ).

Lemma 3 If Protocol 1's estimates are good and if it does not exit at Line 12, then for all
12 .

Lemma 4
If Protocol 1's estimates are good and if it does not exit at Line 12, then for all (X , Y ) in the support of (X, Y), we have: padding some extra leakable patterns to (X , Y ) at Line 17, and (ii) doing a permutation at Line 20.
-Proof for Inequality 1. Consider any (X , Y ) in the support of (X, Y). By the definition of leakable patterns and permutation-invariant functions, Π((X , Y )) = Π((X , Y )). Hence Protocol 1's result must be correct if (i) Protocol 1 does not exit at Line 12, (ii) Protocol 1 does not exit in Line 23 due to P incurring more than 6 δ −δ cc(P, n) bits of communication, and (iii) P gives the correct result for (X , Y ). Recall thatT(X , Y ) is defined to be the distribution of the leaked set fed into P by Protocol 1, while T(X , Y ) is defined to be the distribution of the leaked set that would have been generated by the leaker for (X , Y ). For clarity, we write them asT and T. Define C Q and C P to be the distribution of coin flips made by Q and P, respectively. Define cc(P, X , Y , C P , T) to be the communication incurred (in terms of number of bits) by P, under the input (X , Y ), protocol's coin flip outcomes C P , and leaked set T. Note that T captures all coins flipped by the leaker. We similarly define err(P, X , Y , C P , T), which is 1 if the P's output is wrong, and 0 otherwise. From the condition of the lemma, we already know that Protocol 1 does not exit at Line 12. We have: -Proof for Inequality 2. Protocol 1's communication only involves two parts. The first part is for taking 4 log q samples in Step 1, which incurs at most bits. The second part is for invoking P, incurring no more than 6 δ −δ cc(P, n) bits. We have: We invoked Lemma 3 to obtain the last inequality.
Theorem 5 For all permutation-invariant problem Π , all constants δ and δ such that 0 < δ < δ < 0.5, and all n and n such that n ≥ n + 2kn + 500 Proof For any given protocol P for solving Π n with the leaker and with error δ, we construct a protocol Q for solving Π n without our leaker and with error δ as in Protocol 1. It is easy to verify that n is large enough such that Protocol 1 does not exit at Line 12: Denote z as the event that Protocol 1's estimates are good. By Lemma 2, Pr[z] ≥ 1 − δ −δ 12 . Consider any given input (X , Y ) to our reduction protocol in Protocol 1 and the corresponding random variables (X, Y) obtained at Line 20 of Protocol 1. By Lemma 4, we have: Now we consider the case where z does not hold, i.e., the protocol's estimates are not good. Although most our previous technical lemmas no longer hold, we still know that the error probability is at most 1, and the communication cost, by our protocol design, is at most Since Q solves Π n with at most δ error, we have 6cc(P, n)+ Let P be the optimal protocol for solving Π n with the leaker and with error δ, we have L δ (Π n ) = cc(P, n) ≥ 1 14 R δ (Π n ). Lemma 5 For any given two-party problem Π , any given constants δ and δ such that 0 < δ < δ < 0.5, we have Proof Given a protocol P for Π with error δ , we will construct a protocol with error at most δ as follows: we invoke P for ln(1/δ) 2(0.5−δ ) 2 times, and take the majority of these outputs as the final output. Let random variable z denote the fraction of correct outputs. Since E[z] ≥ 1 − δ , by the Chernoff-Hoeffding bound [16] for absolute error, we have: 1 2 ), all n and n such that n ≥ n + 2kn Proof Obviously, 0 < δ < 0.5δ + 0.25 < 0.5. Apply Lemma 5 (with the values of δ and δ in Lemma 5 being set to δ and 0.5δ + 0.25, respectively) and we have: The above inequality shows that n satisfies the condition needed for Theorem 5. Invoke Theorem 5 and we have L δ (Π n ) ≥ 1 14 R 0.5δ+0.25 (Π n ). Applying Lemma 5 a second time (again with the values of δ and δ in Lemma 5 being set to δ and 0.5δ

Lemma 6 For all q ≥ 2 and all
Theorem 3 For any constant δ ∈ (0, 1 2 ), there exist constants c 1 > 0 and c 2 > 0 such that for all n, g, q, and n = 2 7 ln(1/δ) , and let c 2 be the positive constant such that: We will show that c 1 and c 2 satisfy the desired properties in the theorem. Consider any n, g, q, and n = Otherwise we aim to invoke Theorem 6 with Π n = Gdc g,q n . The Gdc problem is obviously permutation-invariant. From the cycle promise in Gdc g,q n , we further know that k ≤ 2q. We thus have: × ln 48q 2 0.5 − δ > n + 2kn The second last inequality in the above is by Lemma 6. The above shows that n satisfies the condition needed by Theorem 6. Invoking Theorem 6 then immediately gives L δ (Gdc g,q n ) ≥ c 1 R δ (Gdc g,q n ).

Consensus lower bound under oblivious adversaries
This section will ultimately prove our final theorem on Consensus under oblivious adversaries, as follows: We emphasize that the only interface between this section and all previous sections is Theorems 2 and 4-we will only apply those two theorems as black boxes. In particular, Protocol 1 and its analysis will no longer be relevant, and it will be convenient for the reader to forget about those.
In the remainder of this section, we will sometimes refer to round 0, where the Consensus protocol does nothing and where every node is in the receiving state.

Proof overview
Consider any Consensus protocol P with 1 10 error. Let tc(d, m) denote P's time complexity when running over dynamic networks controlled by oblivious adversaries and with d diameter and m nodes. As explained in Sect. 5, the crux will be to prove tc(8, m) ≥ m 1 12 . To do so, we consider the Gdc g,q n problem with our leaker, and set n = m−4 3 , q = 20tc(8, m) + 21, and g = 15q ln q. To solve the Gdc g,q n (X , Y ) problem with the help from our leaker, Alice and Bob simulate P in the following way: In the simulation, the input (X , Y ), together with the leaked information (given by the leaker), is mapped to a sanitized adaptive adversary A that determines the topology of the dynamic network. Roughly speaking, if Gdc g,q n (X , Y ) = 1, the resulting dynamic network will have a diameter of 8. Even though A is an adaptive adversary, by Theorem 2 in Sect. 7, P's time complexity should remain tc(d, m) under A . Hence P should decide within tc(8, m) rounds on expectation. If Gdc g,q n (X , Y ) = 0, then the resulting dynamic network will have a diameter of Θ(q). For P to decide in this dynamic network, we prove that it takes at least roughly q 2 rounds. Note that q 2 > 10tc(8, m)-in other words, it takes longer for P to decide if Gdc g,q n (X , Y ) = 0. Alice and Bob do not know the other party's input, and hence do not have full knowledge of the dynamic network. But the help from our leaker enables them to still properly simulate P's execution. Finally, if P decides within 10tc(8, m) rounds, Alice and Bob claim that Gdc g,q n (X , Y ) = 1. Otherwise they claim Gdc g,q n (X , Y ) = 0. Our proof will show that to solve Gdc g,q n with our leaker, using the above simulation, Alice and Bob incur Θ(tc(8, m) · log n) bits of communication. We thus have Θ(tc (8, m) log n) ≥ L δ (Gdc g,q n ). Together with the lower bound on L δ (Gdc g,q n ) from Theorem 4 in Sect. 8, this will lead to a lower bound on tc (8, m).
Roadmap for the remainder of this section. We will reduce Gdc g,q n with our leaker to Consensus. Here we start with three separate and independent parties: Alice, Bob, and the leaker. Alice and Bob are trying to solve Gdc g,q n (X , Y ), with the help from the leaker. Before Alice and Bob begin, for each leakable pair (x i , y i ), with half probability the leaker leaks the index i. Recall that leaking the index i means that the leaker lets both Alice and Bob know for free the values of i, x i , and y i . Hence initially Alice knows X , as well as all the leaked information. Similarly Bob will initially knows Y , as well as all the leaked information. Once Alice and Bob begin, the leaker does nothing anymore.
In the reduction, Alice and Bob will effectively simulate (i) an adversary based on X , Y , and the leaked information, and (ii) the execution of some black-box Consensus protocol P over a dynamic network determined by such an adversary. The details of the simulation are rather technical, and we will elaborate in the following steps: -We first elaborate the adversary used in the simulation.
-We then describe the simulation done by Alice and Bob, and prove several guarantees of the simulation. -Finally, we put everything together to prove Theorem 7.

Reference adversary
This section describes how we map X , Y , and the leaked information into the adversary used in the simulation, which we call the reference adversary.
Overview. We start with an overview. First, Alice and Bob convert the input (X , Y ) into the processed input (X , Y ), using public coin flips and without any communication. Note that unlike (X , Y ), the processed input (X , Y ) is a random variable, since its value depends on the public coin flips.
Next, the processed input (X , Y ) is mapped into a reference adversary. The reference adversary determines the dynamic network with the following properties: -If Gdc g,q n (X , Y ) = 0, then the dynamic network depends on the pairs (x 1 , y 1 ) through (x n , y n )-namely, the entirety of (X , Y ). The resulting dynamic network will have 3n + 4 nodes and Θ(q) diameter.
-If Gdc g,q n (X , Y ) = 1, then the dynamic network depends only on the pairs (x 1 , y 1 ) through (x n 2 , y n 2 )-namely, the first half of (X , Y ). The resulting dynamic network will have 3n 2 + 2 nodes and diameter of 8.

Preprocessing
Alice and Bob will process the input (X , Y ) to obtain (X , Y ) in the following way, without involving any communication: 1. Alice and Bob use public coins to generate a uniformly random permutation π , and set X = π(X ) and Y = π(Y ), respectively. . . . x n , y n 2 +1 . . . y n ). Our preprocessing aims to achieve the following properties in (X , Y ).
If Gdc g,q n (X , Y ) = 0, our dynamic network will have two parts. The first part corresponds to left(X , Y ), while the second part corresponds to right(X , Y ). To ensure that the network has a diameter of Θ(q), we want both left(X , Y ) and right(X , Y ) to satisfy the following properties (for brevity, the following will only discuss left(X , Y )): -We need left(X , Y ) to contain at least q occurrences of the (0, 0) pattern. By the gap promise, (X , Y ) contains at least g occurrences of the (0, 0) pattern. We will later set g = 15q ln q. However, such g occurrences may not be spread evenly across the first half and the second half of (X , Y ).
As the first step in our preprocessing, Alice and Bob use public coins to generate a random permutation π , and set X = π(X ) and Y = π(Y ), respectively. We can later easily show that with good probability, doing so will make left(X , Y ) contain at least 4q ln q occurrences of the (0, 0) pattern, immediately after the permutation step. -We further need left(X , Y ) to contain a (2, 2) pair, a (4, 4) pair, …, and a (q − 1, q − 1) pair. (Note that left(X , Y ) does not need to satisfy the cycle promise, and hence such pairs are possible.) These pairs are needed to later ensure that the dynamic network constructed by the adversary remains connected in each round. In order to have such pairs in left(X , Y ), the second step in our preprocessing is for Alice and Bob to add some random offsets to each character in left(X , Y ).
Recall that left(X , Y ) is likely to contain at least 4q ln q occurrences of the (0, 0) pattern, immediately after the permutation step. Our hope is to change at least one of these pairs to become a (2, 2) pair, at least one of these pairs to become a (4, 4) pair, and so on. At the same time, we still want a sufficient number of (0, 0) pairs to remain unchanged, so that at the end of the process, we still have q pairs of (0, 0). To achieve this, the offset o i is chosen 2 . Alice and Bob then add o i to x i and y i , respectively. Note that since Alice and Bob do not know which pairs are (0, 0) pairs, they will end up adding offsets to all other pairs as well. This will not cause any problem in our simulation later. Finally, for convenience in discussion (rather than correctness), we do not want the characters in (X , Y ) to be larger than q − 1. Hence if adding the offset makes a character to be larger than q − 1, we simply set the character to be q − 1.
If Gdc g,q n (X , Y ) = 1, our dynamic network will only have one part, which corresponds to left(X , Y ). To ensure that the dynamic network is connected, we will need left(X , Y ) to contain at least one (q − 1, q − 1) pair. This fortunately will have already been achieved by adding the offsets. Namely, regardless of (X , Y ), some pair will likely become (q −1, q − 1) after adding the offset. Y )), and | a b (right(X , Y )) to be the number of occurrences of the (a, b) pattern in (X , Y ), (X , Y ), left(X , Y ), and right(X , Y ), respectively. We say that (X , Y ) is of type-0 if it satisfies all the following: We say that (X , Y ) is of type-1 if it satisfies all the following: It is possible that (X , Y ) is neither type-0 nor type-1. In such a case, we say that (X , Y ) is of type-⊥. Intuitively, if Gdc g,q n (X , Y ) = 0, we would hope (X , Y ) to be of type-0. Similarly, if Gdc g,q n (X , Y ) = 1, we would hope (X , Y ) to be of type-1. But since the preprocessing is a random process, there is no guarantee that this would happen. Still, the following lemma (proof deferred to "Appendix D") shows that we do get what we hope for, with at least 1 − 1 q probability: Lemma 7 Consider any input (X , Y ) of the Gdc g,q n problem and its corresponding processed input (X , Y ). For z ∈ {0, 1}, if q ≥ 20, g ≥ 15q ln q, n ≥ 4g, and Gdc(X , Y ) = z, then Pr[(X , Y ) is of type-z] > 1 − 1 q .

The reference adversary based on processed input
We next define the reference adversary based on (X , Y ). Figure 3 illustrates the dynamic network determined by the reference adversary. We separately consider 3 cases, depending on the type of (X , Y ).
For type-1 (X , Y ). If (X , Y ) is of type-1, then the dynamic network will depend only on left(X , Y ) (i.e., the first half of (X , Y )). The dynamic network will have 3n 2 + 2 nodes, which are all called stable nodes. There are two special nodes α and β in the topology. For each index i (1 ≤ i ≤ n 2 ), there is a vertical chain consisting of three nodes (see Fig. 3a).
During round 0, on each chain, there is an edge connecting the top node and the middle node, and another edge connecting the middle node and the bottom node. The top nodes of all chains are connected to α, and the bottom nodes of all chains are connected to β (see Fig. 3). A chain for index i is called a | a b chain if x i = a and y i = b. If a is even, we call the top edge (i.e., the edge between the top node and the middle node on the chain) as an even edge on this chain. Similarly, if b is even, the bottom edge is an even edge. We say a chain is leaked if the corresponding index is leaked by the leaker in the two-party Gdc problem.
Starting from round 1, the adversary changes the topology in the following way: -For every | 2t 2t−1 and | 2t−1 2t chain (1 ≤ t ≤ q−1 2 ), the adversary removes the even edge on that chain at the beginning of round t + 1.
Here both z and s are random variables. We define z = 1 if the middle node on the chain is receiving in round t + 1, and z = 0 otherwise. We define s = 1 if the chain is leaked, and s = 0 otherwise. Note that this is the only occasion where the reference adversary makes an adaptive decision. Specifically, the decision depends on z, which in turn may depend on the coin flip outcomes of protocol.
It is easy to verify that this adaptive adversary is indeed a sanitized adaptive adversary (recall the definition from Sect. 7): Regardless of the coin flip outcomes C P of P, for the second type of chains above, the adversary removes the even edge at the beginning of round t +1 with half probability and at the beginning of round t + 2 with the remaining half probability. Furthermore, these decisions are independent for different chains.
For type-0 (X , Y ). If (X , Y ) is of type-0, then the dynamic network will have two parts. The first part depends on left(X , Y ), while the second part depends on right(X , Y ). Each part has 3n 2 + 2 nodes, and the network has total 3n + 4 nodes. All nodes in the first part are called stable nodes, while all nodes in second part are unstable nodes. The first part has two special nodes α and β, while the second part has two special nodes γ and λ.
During round 0, the topology among the stable nodes are exactly the same as in the case where (X , Y ) is of type-1. The topology among the unstable nodes are constructed in the same way as the stable nodes, except that we replace α and β with γ and λ, and except that we use right(X , Y ) to construct the n 2 chains (see Fig. 3b). Now γ (λ) is connected to all the top (bottom) nodes in the second part. In the next, a chain may refer to either a chain in the first part or a chain in the second part. Hence the network has total n chains.
Starting from round 1, the adversary changes the topology in the following way (the first two items below are the same as the case when (X , Y ) is of type-1): -For every | 2t 2t−1 and | 2t−1 2t chain (1 ≤ t ≤ q−1 2 ), the adversary removes the even edge on that chain at the beginning of round t + 1.
-For every | 2t 2t+1 and | 2t+1 2t chain (1 ≤ t ≤ q−1 2 ), the adversary removes the even edge on that chain at the beginning of round t +1+(z⊕s). Here z and s have the same meaning as earlier.
-At the beginning of round 1, the adversary removes all the top edges and bottom edges on all the | 0 0 chains. Next, the adversary arbitrarily connects the middle nodes of all | 0 0 chains into a line such that all stable nodes are before the unstable nodes on the line. It then connects the stable node at one end of the line to the middle node of some | 2 2 chain of stable nodes, and the unstable node at the other end of the line to the middle node of some | 2 2 chain of unstable nodes (see Fig. 3b). This serves to keep the topology connected. Since (X , Y ) is of type-0, such | 2 2 chains must exist.
-At the beginning of round t + 1 (1 ≤ t < q−1 2 ), for every | 2t 2t chain, the adversary removes the top and bottom edges on that chain. At the same time, if such a chain consists of stable (unstable) nodes, then the adversary connects the middle node of this chain to the middle node of some arbitrary | 2t+2 2t+2 chain of stable (unstable) nodes. Again, this serves to keep the topology connected. Same as earlier, such | 2t+2 2t+2 chain must exist.
By same reasoning as for when (X , Y ) is of type-1, one can easily verify that when (X , Y ) is of type-0, the reference adversary is also a sanitized adaptive adversary.
For type-⊥ (X , Y ). Finally for completeness, we also need to define the reference adversary when (X , Y ) is of type-⊥. The specifics of how the reference adversary works in this case does not really matter, as long as the dynamic network remains connected in each round. Hence for simplicity, if (X , Y ) is of type-⊥, then the reference adversary is the same as for the case where (X , Y ) is of type-1, except that the adversary does not remove any edges. Thus the dynamic network is effectively a static network. Trivially, when (X , Y ) is of type-⊥, the reference adversary is a sanitized adaptive adversary.

Alice's and Bob's simulation
Overview. This section describes Alice's and Bob's simulation, and proves several properties of the simulation. We begin with an overview, from Alice's perspective. Alice's goal is to simulate P's execution against the reference adversary. Based only on her local knowledge, Alice does not know all the specifics of the reference adversary. Because of this, in any given round, Alice will only simulate P's execution on a subset of the nodes (which are called non-spoiled nodes). The set of non-spoiled nodes for Alice will shrink from round to round-namely, as the simulation goes on, Alice will give Protocol 2: Simulation protocol executed by Alice and Bob to solve Gdc. The Advance_by_one_round() procedure continues the simulation of the protocol P by one round. If P is sending a message in that round, then the procedure will have that message as its return value. Otherwise the procedure has no return value.
up simulating certain nodes due to the lack of sufficient information to do so.
Consider any given round and any non-spoiled node τ for Alice. To simulate the execution of P on τ in that round, among other things, Alice needs to be able to feed the incoming message to τ , if τ is receiving in that round. A unique challenge in our simulation is that since Alice does not know all the specifics of the reference adversary, Alice may not be able to precisely determine which nodes are τ 's neighbors in the current round. Instead, Alice will use her own rule (based only on her local knowledge) to decide the neighbors of τ . We will later prove that such decisions are always good enough for the simulation to be correct.
In the following, we first define the notion of spoiled and non-spoiled nodes. Next we present the pseudo-code for the simulation, and then describe the rules used by Alice and Bob to decide the neighbors. Finally, we prove several properties of the simulation.

Spoiled and non-spoiled nodes
In each round, each node is either spoiled or non-spoiled for Alice. Roughly speaking, a node is non-spoiled for Alice in round r if, based solely on Alice's input X and all the messages sent by the special node β in the dynamic network so far, Alice can simulate the execution of P on this node against the reference adversary in round r . Formally (see Fig. 4 for an example), we define all unstable nodes as always spoiled for Alice, in all rounds. Among the stable nodes, we define α as always non-spoiled for Alice in all round, while β as always spoiled in all rounds. The remaining stable nodes are all on the chains. Consider any given chain with stable nodes, and let υ, ν, and ω be the three nodes on the chain, from the top to the bottom: -A node on a chain that is leaked is always non-spoiled for Alice in all rounds. -A node on a chain that is not leaked is non-spoiled for Alice until it becomes spoiled. -If the chain is not leaked and is in the form of | 2t * , then ν and ω become spoiled since the beginning of round t + 1.
-If the chain is not leaked and is in the form of | 2t+1 * , then ω becomes spoiled since the beginning of round t + 1.
In the above, " * " is a wildcard representing any integer.
We similarly define these concepts for Bob: All unstable nodes and the stable node α are always spoiled for Bob. The node β is never spoiled for Bob. For any chain with stable nodes υ, ν, and ω, from the top to the bottom: -A node on a chain that is leaked is always non-spoiled for Bob in all rounds. -A node on a chain that is not leaked is non-spoiled for Bob until it becomes spoiled.

Fig. 4
An example illustrating which nodes are non-spoiled for Alice (Bob), in round 1 and 2, respectively. The middle nodes of all the chains happen to be sending in both rounds. Note that in any given round, some nodes may be non-spoiled for both Alice and Bob, or for exactly one of them, or for none of them. In the figure, the | 0 0 chains are all in the middle so that the figure does not become cluttered and messy. In general, the | 0 0 chains can be anywhere in the topology -If the chain is not leaked and is in the form of | * 2t , then υ and ν become spoiled since the beginning of round t + 1.
-If the chain is not leaked and is in the form of | * 2t+1 , then υ becomes spoiled since the beginning of round t + 1.

The simulation
Pseudo-code for the simulation. Protocol 2 gives the pseudocode that Alice and Bob use to simulate P's execution on the nodes that are non-spoiled for each of them. Alice and Bob will feed public coin flips into P in the simulation. It will be convenient to imagine that such public coin flips has already been done beforehand, with the outcomes being C P , so that P can be treated as deterministic given C P . Protocol 2 is executed by both Alice and Bob, separately. We will explain Protocol 2 as it is executed by Alice. In Protocol 2, Alice simulates total q−1 2 rounds of P's execution. For each node in the dynamic network, Alice maintains the state for P running on that node. In each round r , Alice first checks all nodes that were non-spoiled for her in round r − 1 and determines whether each of them is sending or receiving in round r . Note that if a node τ was non-spoiled in round r − 1 but becomes spoiled in round r , we will later prove that Alice can still (i) determine whether τ is sending or receiving in round r , and (ii) simulate P on τ in round r if τ is sending in round r (since such a τ 's behavior is not influenced by potential incoming messages in round r ).
Next Alice processes all nodes that were non-spoiled for her in round r − 1 and are sending in round r . For each such node τ , Alice simulates and advances P running on that node by one round. To do so, Alice will need to know the initial input to τ , which may be used by the protocol. Note that incoming messages to τ in previous rounds have already been captured in the current state of the protocol, and there is no need for Alice to provide those again. Since τ is sending, Alice does not provide τ with any incoming message. P on τ will then generate an outgoing message, which Alice adds to the pool of messages to be delivered. Without loss of generality, we assume a message always contains the id of its sender. If τ = α, then Alice will further forward this message to Bob. Note that for Alice, β is always spoiled and hence τ = β.
Finally Alice processes all nodes that remain non-spoiled for her in round r and are receiving in round r . For each such node τ , from the pool of messages to be delivered, Alice chooses all those messages that were sent by τ 's neighbors to construct a set in_msg. Alice decides which nodes are τ 's neighbors according to Alice's rule (described later in Sect. 9.3.3). If in_msg is legal (defined in the next paragraph), then Alice feeds in_msg into P running on τ , and advances P by one round at Line 18.
Checking whether incoming messages are legal. When the processed input (X , Y ) is of type-⊥, the simulated Consensus protocol P on different nodes in Protocol 2 may be inconsistent, and may not correspond to the execution of P over any dynamic network. In such a case, the set in_msg of incoming message as constructed at Line 16 of Protocol 2 may be corrupted-namely, P never expects to receiving such a set of incoming messages. While we will not be concerned with the correctness of P when the processed input is of type-⊥, we do want to ensure that (i) Alice can complete simulation of P on τ at Line 18 within finite amount of time, and (ii) τ will not send excessively large messages in later rounds since Alice will need to forward τ 's message to Bob when τ = α.
To ensure this, at Line 17, Alice check whether in_msg is legal in the following way: Alice exhaustively enumerate all possible dynamic networks with no more than 3n + 4 nodes 9 and no more than r rounds, and all possible initial values of the nodes in the network. Alice next simulates the execution of P with C P under each such setting. Note that all such simulations are done unilaterally by Alice and are completely independent of the simulation done by Alice and Bob together. Alice then checks whether in_msg matches 9 The dynamic network should contain either 3n + 4 nodes or 3n+4 2 nodes. But Alice does not know the total number of nodes in the dynamic network. Hence Alice simply tries all dynamic networks with no more than 3n + 4 nodes. If a message is determined to be legal in this way, then it will already guarantee that (i) the local computation of P on τ takes finite amount of time, and (ii) any message sent by P on τ will not be too large. any set of incoming messages to any node ϕ in any such simulation in round r , where ϕ has the same state as τ at the end of round r − 1 and has the same initial input as τ . Such checking is possible since communication complexity lower bounds hold irrespective of the computational power of Alice and Bob. If there is no such node ϕ, then Alice claims that in_msg is not legal and will abort Protocol 2.

Alice's rule and Bob's rule
Alice's rule. Consider any given round and any node τ that is non-spoiled for Alice in that round. To simulate P on τ , if τ is receiving, Alice needs to determine which nodes are τ 's neighbors in that round, under the reference adversary. As mentioned earlier, Alice cannot determine this precisely based only on her local knowledge. Instead, in her simulation, Alice will decide τ 's neighbors by following her own rule based solely on her local knowledge (i.e., the leaked information and X ) in the following way: -For τ = α: Under the reference adversary, node α has a fixed set of neighbors in all rounds, independent of the values of X and Y . Hence Alice's rule will directly choose those nodes to be α's neighbors in her simulation. -For any non-spoiled node τ on a leaked chain: Let i be the index of this leaked chain. Since the chain is leaked, Alice knows both x i and y i . Alice will then determine the neighbors of τ under the reference adversary, while assuming (X , Y ) to be of type-0. Note that Alice has all necessary information to do so. Alice's rule will choose those nodes to be τ 's neighbors in Alice's simulation. Obviously, Alice's assumption could be wrong. If (X , Y ) is of type-1, then given that τ is on a leaked chain, one can directly verify that under the reference adversary, the neighbors of τ will be the same as for the case where (X , Y ) is of type-0. Hence in this case, the neighbors chosen by Alice's rule will be the same as those under the reference adversary. If instead (X , Y ) is of type-⊥, then the neighbors decided by Alice's rule can be different from the neighbors under the reference adversary. This will however not cause any problem, since when (X , Y ) is of type-⊥, we only need our simulation to have some rather weak guarantees (e.g., terminating within finite amount of time). -For any non-spoiled node τ on a non-leaked chain: Consider any given non-leaked chain, and let i be the index of this chain. Let the 3 nodes on the chain (from top to the bottom) be υ, ν, and ω. We will describe how Alice's rule decides the neighbors of these 3 nodes, which depends on whether x i is even or odd. We separately consider these two cases. The first case is x i = 2t for some integer t. Alice's rule will choose {α, ν} as the neighbors of υ, in rounds 1 through t. Starting from round t + 1, Alice's rule will choose {α} as the neighbor of υ. Intuitively, this corresponds to the edge between υ and ν being removed at the beginning of round t + 1. For nodes ν and ω, Alice's rule will always (in all rounds) choose {υ, ω} and {ν, β} as their neighbors, respectively. (Note however that ν and ω both become spoiled for Alice starting from round t + 1. Hence Alice's rule for ν and ω is only relevant for rounds 1 through t.) The second case is x i = 2t −1 for some integer t. Alice's rule will choose {υ, ω} as the neighbors of ν, in rounds 1 through t. Starting from round t + 1, Alice's rule will choose {υ} as the neighbor of ν. For nodes υ and ω, Alice's rule will always (in all rounds) choose {α, ν} and {ν, β} as their neighbors, respectively.
Some intuition behind Alice's rule. As an example, consider a | 2 3 chain that is not leaked, and let τ and ν be the top node and the middle node of this chain, respectively. Note that τ is always non-spoiled for Alice.
Assume that ν is receiving in round 2. By Alice's rule, in round 2, ν is not a neighbor of τ . But under the reference adversary, the node ν is a neighbor of τ in round 2. Hence τ 's neighbors as decided by Alice's rule are different from τ 's neighbors under the reference adversary. One may suspect that this could cause Alice's simulation to be incorrect. But note that ν is receiving in round 2, and does not send any message. Hence τ will not receive any message from ν, and the simulation on τ will be the same, regardless of whether ν is a neighbor of τ . Intuitively, this is why despite Alice's rule not following the reference adversary precisely, Alice's simulation will still be correct.
On the other hand, if ν is sending in round 2, then under the reference adversary, the node ν is not a neighbor of τ in round 2. In this case, τ 's neighbors as decided by Alice's rule will be the same as τ 's neighbors under the reference adversary.
Bob's rule. Bob's rule is entirely symmetric to Alice's rule, and there is no fundamental difference between Bob's rule and Alice's rule. For completeness, the next fully describes Bob's rule. Consider any given round and any non-spoiled node τ for Bob in that round. In Bob's simulation, Bob will decide τ 's neighbors by following his own rule based solely on his local knowledge (i.e., the leaked information and Y ): -For τ = β: Under the reference adversary, node β has a fixed set of neighbors in all rounds, independent of X and Y . Bob's rule will choose those nodes to be β's neighbors in his simulation.
-For any non-spoiled node τ on a leaked chain: Let i be the index of this leaked chain. Bob, knowing both x i and y i , will determine the neighbors of τ under the reference adversary, while assuming (X , Y ) to be of type-0. Bob's rule will choose those nodes to be τ 's neighbors in Bob's simulation. -For any non-spoiled node τ on a non-leaked chain: Let i be the index of this chain, and let the 3 nodes on this chain (from top to the bottom) be υ, ν, and ω.

Performance of the simulation
We first prove that Alice's and Bob's simulation (using Protocol 2) will always terminate and will not incur too much communication, even when the processed input (X , Y ) is of type-⊥.

Lemma 8 For any Consensus protocol P, there exists positive constant c such that for all n, q, and C P , Protocol 2 always terminates within finite amount of time and incurs at most cq log n bits of communication between Alice and Bob.
Proof For any node τ and any round r , we say that the state of P running on τ (as maintained by Alice or Bob using Protocol 2) is legal if there exists some dynamic network of no more than 3n + 4 nodes, some initial values to the nodes in this dynamic network, and some node ϕ in this dynamic network whose initial value is the same as τ 's, such that when running P on this dynamic network with C P , the state of P on ϕ in round r is exactly the same as the state of P on τ as maintained by Alice or Bob using Protocol 2. We next prove via an induction that for all node τ and all round r , the state of P running on τ in round r is legal. The case for r = 0 is trivial. Assume the claim holds for round r −1, and consider any node τ . If τ is sending in round r , it is easy to see that the state of the Consensus protocol running on τ will continue to be legal. If τ is receiving in round r , then Line 17 of Protocol 2 explicitly ensures that the state will be legal, before continuing.
Next since the state of P on all node τ are always legal 10 in all round r , it immediately means that simulated P running on τ will complete its execution for round r within finite amount of time at Line 8 and Line 18 of Protocol 2. Furthermore at Line 11, the size of out_msg (and hence the size of msg_to_other_party) must satisfy the maximum allowed message size (i.e., O(log n)) for a network with Θ(n) nodes. The lemma follows since in each round, Alice and Bob only communicate once at Line 13 by sending msg_to_other_party to the other party.

Correctness of the simulation
Overview. We next aim to prove that by using Protocol 2, Alice and Bob can indeed correctly simulate P's execution against the reference adversary on the non-spoiled nodes, when (X , Y ) is either of type-0 or type-1. We do not care about the case where (X , Y ) is of type-⊥, as this will only happen with probability less than 1 q . To make our claims rigorous, we need to first define the notion of reference execution. Consider any given Consensus protocol P, any given initial values for all the nodes, any given public coin flip outcomes C P that Alice and Bob generate to feed into P in their simulation, any processed input (X , Y ) that is either type-0 or type-1, any given set of indices that are leaked by the leaker, and the corresponding reference adversary under such a setting. We define the reference execution to be the execution of P under such coin flips, such initial values of the nodes, and such adversary. (Such a reference execution must be deterministic since all coins have been flipped. ) We ultimately aim to prove that the behavior of each node in Alice's and Bob's simulation is exactly the same as in the reference execution. We do this via two steps, and the following provides some intuitions.
For the first step, as an example, let us consider any given round r and any given node τ that is receiving in round r in the reference execution. Assume that τ is non-spoiled for Alice, and hence is being simulated by Alice. Recall that in her simulation, Alice uses her own rule to decide the neighbors of τ in round r , which are later used to determine which messages should be fed into τ . These neighbors may be different from τ 's neighbors in the reference execution. However, Lemma 9 later will prove that all nodes in the symmetric difference of these two sets of neighbors are all receiving in round r . 10 The states of P on all the individual nodes being legal does not necessarily imply that the joint state across all the nodes corresponds to some execution of P over some dynamic network. However, note that the proof here does not rely on the properties on the joint state. The proof here only needs that (i) each node completes its execution for each round within finite amount of time, and (ii) messages sent are not excessively large.
Hence the difference will not impact the set of messages that τ receives in round r . Furthermore, Lemma 9 will also show that all of τ 's sending neighbors (except potentially β) 11 must also be non-spoiled for Alice in round r − 1, which allows Alice to generate the messages that she needs to feed into τ in round r .
Our second step will build upon Lemma 9. We will show (in Lemma 10) via an induction that in both Alice's and Bob's simulation (i.e., Protocol 2), the outgoing message of each node in each round of simulation is exactly the same as the outgoing message of the corresponding node in the corresponding round in the reference execution. Without loss of generality, assume that when a node decides in the Consensus protocol P, the node sends a special message. Hence a node will send such a special message in a round in the simulation if and only if it does so in the corresponding round in the reference execution. This will be the ultimate property that we later need.

Neighbors of nodes.
The following lemma reasons about the neighbors of a node as decided by Alice's rule (Bob's rule), as compared to its neighbors under the reference execution: Lemma 9 Consider any given reference execution, any round 1 ≤ r ≤ q−1 2 , and any node τ in the reference execution that is receiving in the reference execution in round r and is nonspoiled for Alice (Bob) in round r . Let S be the set of nodes that are τ 's neighbors according to Alice's (Bob's) rule in round r and that are sending in the reference execution in round r . Let S be the set of nodes that are τ 's neighbors under the reference adversary in round r and are sending in the reference execution in round r . Then, -For all ϕ ∈ S, either ϕ is non-spoiled in round r − 1 for Alice (Bob) or ϕ = β (ϕ = α).
Proof It suffices to prove the lemma for Alice. Throughout our proof, we will extensively leverage the fact that since we are considering a reference execution, the corresponding processed input (X , Y ) must be either type-0 or type-1. Hence whenever we consider ϕ's neighbors under the reference adversary, we should keep in mind that (X , Y ) is not of type-⊥. Define T to be the set of τ 's neighbors according to Alice's rule in round r , and T to be the set of τ 's neighbors under the reference adversary in round r . Obviously, S ⊆ T and S ⊆ T . Note that S (S ) consists solely of the nodes in T (T ) that are sending in the reference execution. Hence T = T implies S = S .
Since τ is non-spoiled in round r , τ must be a stable node. Such τ can either be the special node α or can be a node on any of the chains consisting of stable nodes. If τ = α, then τ 's neighbors according to Alice's rule are always exactly the same as τ 's neighbors under the reference adversary, and all these neighbors are never spoiled for Alice. Hence the lemma holds when τ = α.
Next we consider the case where τ is on some chain consisting of stable nodes. If the chain is leaked, then regardless where τ is on the chain, we have T = T . Furthermore, since nodes on a leaked chain are always non-spoiled, a node in T must be either β or some non-spoiled node. Hence the lemma holds.
The remainder of our proof covers the case where τ is on some non-leaked chain consisting of stable nodes. Let υ, ν, and ω be the three nodes, from top to the bottom, on any such chain. We exhaustively enumerate all possibilities, depending on what kind of chain it is. Let t be any integer where 0 ≤ t ≤ q−1 2 : -For a | 2t 2t−1 chain or a | 2t 2t chain, υ is always non-spoiled, and ν and ω are non-spoiled iff r < t + 1: where ν is non-spoiled in round r − 1.
Hence the lemma holds in all above cases.
Outgoing messages of nodes. We next aim to prove that the outgoing message of each node in each round of simulation is exactly the same as the corresponding outgoing message in the reference execution. Consider any round r and any node τ . If τ is sending in round r , we say that the outgoing message from τ as determined in round r of Protocol 2 at Line 8 is consistent with the reference execution (or consistent in short), if it is exactly the same as the τ 's outgoing message in the reference execution in round r . Similarly, if τ is receiving in round r , we say that the set of incoming messages fed into τ in round r of Protocol 2 at Line 16 is consistent (with the reference execution) if it is exactly the same as τ 's set of incoming message in the reference execution in round r .
The lemma below actually proves more properties than we need in the end-however, we need those properties for the inductive proof to go through.

Lemma 10
Consider any given reference execution, any node τ in the reference execution, and any r where 1 ≤ r ≤ q−1 2 .
-If τ was non-spoiled for Alice (Bob) in round r − 1 and is sending in the reference execution in round r , then (i) τ will be determined as sending in round r by Alice (Bob) at Line 5 of Protocol 2, and (ii) τ 's outgoing message as determined by round r of Alice's (Bob's) Protocol 2 at Line 8 is consistent with the reference execution. -If τ was non-spoiled for Alice (Bob) in round r − 1 and is receiving in the reference execution in round r , then τ will be determined as receiving in round r by Alice (Bob) at Line 5 of Protocol 2. Furthermore if such a τ continues to be non-spoiled in round r , the set of τ 's incoming messages as determined by round r of Alice's (Bob's) Protocol 2 at Line 16 is consistent with the reference execution.
Furthermore, Line 20 in Protocol 2 will not be executed in round r .

Proof
The last claim that Line 20 will not be executed does not need to be proved separately-as long as we can prove the other claims in the lemma, the last claim will directly follow. The reason is that Line 20 can only be executed when in_msg is not legal at Line 17. However, if the previous claims in the lemma hold, then in_msg must be legal. Thus we will not separately prove the last claim. It suffices to prove the lemma for Alice. We prove via an induction on r . The induction base for r = 0 is trivial since τ by definition is receiving in that round, and the set of incoming messages is empty. For the inductive step, suppose that the lemma holds for all rounds before round r , and we prove the lemma for round r .
First, consider the case where τ is non-spoiled for Alice in round r − 1 and is sending in the reference execution in round r . By definition, τ must be non-spoiled in round 0 through round r − 1. By the inductive hypothesis, in Protocol 2 for every previous round where τ was receiving, the set of incoming messages fed into τ by Alice was consistent with the reference execution. Since everything is deterministic, at Line 5 Alice can determine that τ must be sending in round r , and the outgoing message from τ in round r as generated by Protocol 2 must be consistent as well.
Next consider the case where τ is non-spoiled for Alice in round r − 1 and is receiving in the reference execution in round r . By same argument as earlier, at Line 5 Alice must be able to determine that τ is in a receiving state in round r .
If τ continues to be non-spoiled in round r , let S be the set of nodes that are τ 's neighbors as decided by Alice's rule in round r and that are sending in the reference execution in round r . Consider the set in_msg of messages that Alice constructs as τ 's incoming messages at Line 16. We claim that in_msg is the same as the set of the messages sent by all the nodes in S in the reference execution. It is easy to see that for any node ϕ / ∈ S, the outgoing message from ϕ will not be added to in_msg at Line 16 since by definition of S, ϕ is not τ 's neighbor according to Alice's rule in round r . Hence to prove the claim, we only need to show that for any node ϕ ∈ S, the outgoing message from ϕ that Alice adds to msg_pool (at either Line 8 or Line 14) is consistent with the reference execution. As long as this message is in msg_pool, it will be later added to in_msg at Line 16 since ϕ is τ 's neighbor according to Alice's rule.
If ϕ ∈ S and ϕ = β, then ϕ is sending in round r in the reference execution and ϕ is non-spoiled for Bob in round r − 1. By our earlier argument, at Line 8, the outgoing message from ϕ generated by Bob in round r is consistent with reference execution. Such a message will then be forwarded to Alice at Line 13, and then added to msg_pool at Line 14. If ϕ ∈ S and ϕ = β, by Lemma 9, ϕ must be non-spoiled in round r − 1. Again by our earlier arguments, at Line 8, Alice will generate the consistent outgoing message from ϕ in round r , and add such a message to msg_pool at Line 8.
So far we have proved that in_msg is the same as the set of the messages sent by all the nodes in S in the reference execution. Let S be the set of nodes that are τ 's neighbors in the reference adversary in round r and are sending in the reference execution in round r . Lemma 9 tells us that S = S , which immediately implies that in_msg is consistent with the reference execution and hence completes the proof.

Proving Theorem 7 from the simulation
Two simulations. Before giving the proof for Theorem 7, we first highlight a tricky part in the proof, and provide intuition for that part. We will reduce Gdc(X , Y ) with leaker to Consensus by first converting (X , Y ) to the processed input (X , Y ). The processed input (X , Y ), together with the the leaked information, will determine the reference adversary. Alice and Bob will effectively simulate the Consensus protocol P's execution against the reference adversary, and infer the answer to Gdc(X , Y ) by monitoring P's execution on the special node α. (Of course, other nodes still need to be simulated to enable the simulation of P's execution on α.) Roughly speaking, if Gdc(X , Y ) = 1 (and hence (X , Y ) is likely to be of type-1), then the dynamic network will have a small diameter, implying that P will output quickly on node α. When Gdc(X , Y ) = 0 (and hence (X , Y ) is likely to be of type-0), we instead want P to output in Ω(q) rounds on α.
The tricky part is that even though the dynamic network has Ω(q) diameter when (X , Y ) is of type-0, P may still output fast on the node α and take Ω(q) rounds to output on some other nodes. To overcome this challenge, we will actually do two simulations of P, which are separate and independent. Having such two simulations is a tricky aspect of our proof for Theorem 7. The first simulation is based on the processed input (X , Y ) and the corresponding reference adversary. Next, let X be the string obtained by swapping left(X ) and right(X ). Similarly define Y . With a slight abuse of notation, we also call (X , Y ) as a (a) (b) Fig. 5 The two dynamic networks used in the two simulations, respectively. Here (X , Y ) and (X , Y ) are of type-1 processed input. To avoid notation collision, in this second reference adversary, we rename the nodes α, β, γ (if exists), and λ (if exists) to be α , β , γ , and λ , respectively. Now if (X , Y ) is of type-1, then (X , Y ) must also be of type-1. The two dynamic networks in the two simulations will both have a small diameter (see Fig. 5). This means that P will output fast on both α in the first simulation and α in the second simulation. If (X , Y ) is instead of type-0, then (X , Y ) must also be of type-0. In such case, the two dynamic networks in the two simulations will both have Ω(q) diameter (see Fig. 6). Via a coupling argument, if P does not err, we can show that at least one of the following two cases must hold: (i) in the first simulation P takes Ω(q) rounds to output on α, or (ii) in the second simulation P takes Ω(q) rounds to output on α .
Putting everything together, if Alice observes that P outputs fast on both α in the first simulation and α in the second simulation, then Alice will claim that Gdc(X , Y ) = 0. Otherwise Alice claims that Gdc(X , Y ) = 1. We now present the complete proof for Theorem 7: It is easy to see that there must exist constant c 3 > 0 such that for all m ≥ c 3 , both inequalities hold. We will prove that tc(8, m) ≥ m 1 12 for all m ≥ c 3 . Assume by contradiction that there exists some m ≥ c 3 such that tc(8, m) < m 1 12 . We will proceed with the reduction from Gdc and eventually obtain a contradiction. Let n = m−4 3 , q = 20tc(8, m) + 21, and g = 15q ln q. We Also note that since n > 4g, we have n > q, and hence the Gdc g,q n problem is well-defined. To solve the Gdc g,q n (X , Y ) problem with our leaker, Alice and Bob will simulate the execution of P. Alice and Bob will first generate public coin flip outcomes (denoted as C P ) to feed into P. This effectively makes P deterministic. Alice and Bob setm = 2 3 m = 2 3 (3n + 4), and feedsm into P as an estimate of the total number of nodes, if P needs such an estimate. As we will quickly see, the number of nodes in the dynamic network will be either m or m/2. Hence obviously, suchm satisfies both |m −m m | = 1 3 and |m −m/2 m/2 | = 1 3 . Alice and Bob will simulate P twice on two different dynamic networks, using the same C P . The ids of the nodes in the dynamic network will be determined by the adversary and then given to P as inputs.
-First simulation The first simulation is based on the processed input (X , Y ). We first assign initial values and ids to the nodes under the corresponding reference adversary. All stable nodes has initial values 0. Order all the stable nodes into a total order by some arbitrary criterion, and then assign them ids from 1 to 3 2 n + 2. Note that Alice and Bob can determine the initial values and the ids of all the stable nodes without the need of communication, since these initial values and ids do not depend on (X , Y ). If there are unstable nodes (i.e., when (X , Y ) is of type-0), then they will all have initial values 1. The unstable nodes will have ids from 3 2 n + 3 to 3n + 4, by the total ordering as described later for the stable nodes in the second simulation. Note that by our definition, if a node is non-spoiled in any round, then that node must be a stable node. Hence for any non-spoiled node in any round, by our above reasoning, Alice and Bob must know the initial values and id of that node. Alice and Bob then proceed with the first simulation using Protocol 2. By Lemma 8, such simulation must complete within finite time.
-Second simulation For the second simulation, we construct a second processed input (X , Y ) by swapping left(X , Y ) and right(X , Y ). Specifically, we set X i = X i+ n 2 and Y i = Y i+ n 2 for 1 ≤ i ≤ n 2 , and X i = X i− n 2 and Y i = Y i− n 2 for n 2 + 1 ≤ i ≤ n. It is trivial to see that (X , Y ) and (X , Y ) must be of the same type. The second simulation is based on the processed input (X , Y ). In particular, if (X , Y ) is of type-1, then the reference adversary will use left(X , Y ) to construct the topology. Recall that for clarity, we rename the nodes α, β, γ , and λ to be α , β , γ , and λ in the second simulation. We still need to assign initial values and ids to the nodes under the corresponding reference adversary. All stable nodes have initial values of 1, and all unstable nodes (if any) have initial values of 0. Order all the stable nodes into a total order by some arbitrary criterion. These nodes are then assigned ids from 3 2 n + 3 to 3n + 4. Note that the initial topology among these stable nodes will be exactly the same as the initial topology among the unstable nodes in the first simulation. As mentioned earlier, we used the same total ordering used here to order the unstable nodes in the first simulation, if there were unstable nodes there. If there are unstable nodes (i.e., when (X , Y ) is of type-0), then again, the initial topology among these unstable nodes will be exactly the same as the initial topology among the stable nodes in the first simulation. We will use the same total ordering used in the first simulation to order these unstable nodes, and assign them ids from 1 to 3 2 n + 2. Again, in the second simulation, Alice and Bob know the initial values and ids of all their respective non-spoiled nodes. Alice and Bob then proceed with the second simulation using Protocol 2. By Lemma 8, such simulation must complete within finite time.
-Generating an output Alice monitors when α decides in the first simulation and when α decides in the second simulation. If they both decide by round 10tc(8, m), Alice outputs 1 for the original Gdc problem. Otherwise Alice outputs 0. Note that if either of the simulation aborts at Line 20 of Protocol 2, Alice will output 0 as well. -Correctness of Alice's output If Gdc(X , Y ) = 1, then Lemma 7 tells us that (X , Y ) is of type-1 with probability at least 1 − 1 q . Since (X , Y ) and (X , Y ) must be of the same type, with at least such probability, both of them are of type-1. When both of them are of type-1, Lemma 11 later proves that with probability at least 1 − 1 5 , α in the first simulation and α in the second simulation both decide within 10tc (8, m) rounds. This will make Alice generate the correct output 1. Hence Alice generates the correct output 1 with probability at least If Gdc(X , Y ) = 0, then by Lemma 7 and similar argument as before, we know that with at least 1 − 1 q probability, both (X , Y ) and (X , Y ) are of type-0. When both of them are of type-0, Lemma 12 later proves that with probability at most 3 10 , α in the first simulation and α in the second simulation both decide within 10tc (8, m) rounds. Hence Alice's output is correct with probability at least

communication complexity to time complexity
We have proved so far that Alice and Bob can solve Gdc g,q n with 2 5 error, by simulating P twice. Lemma 8 tells us that in each simulation, Alice and Bob never incur more than cq log n bits of communication. Hence Alice and Bob can solve Gdc g,q n with no more than 2cq log n bits of communication. By the lower bound in Theorem 4, we know that there exist constants c 1 and c 2 such that all The last inequality contradicts with Inequality 4, which completes our proof by contradiction.

Lemma 11
Consider the processed inputs (X , Y ) and (X , Y ) in the proof of Theorem 7, and the corresponding first simulation and second simulation. If both processed inputs are of type-1, then α in the first simulation and α in the second simulation will both decide within 10tc(8, m) rounds with probability at least 1 − 1 5 , where the probability is taken over the coin flips of both the protocol and the adversary. 12 Furthermore, neither the first simulation nor the second simulation will abort at Line 20 of Protocol 2.
Proof Consider the first simulation where the reference adversary A is based on (X , Y ). Since (X , Y ) is of type-1, it is easy to verify that the dynamic network as generated by A has a diameter of no more than 8, under all possible coin flips of the Consensus protocol P and of the reference adversary A . We want to increase the diameter of the dynamic network to exactly 8, so that it corresponds to tc (8, m). Recall from Protocol 2 that P is only simulated for round 1 through q−1 2 . Given this, increasing the diameter to exactly 8 is trivial: Starting from round q−1 2 + 1, we let the dynamic network's topology to be some fixed topology such that the resulting (dynamic) diameter of the dynamic network is exactly 8. Since the simulation has already stopped by round q−1 2 , whatever we do after that will not impact the simulation in any way. (If we want to reason about tc(d, m) for d > 8, then we should increase the diameter to exactly d, which is also trivial to achieve using the above approach.) In the next, when we refer to A (which was originally defined only for the first q−1 2 rounds), we will include the above topology starting from round q−1 2 + 1 as well. Section 9.2.2 already explained that the reference adversary A is a sanitized adaptive adversary. Let the cost of P be the number of rounds before termination. By Theorem 2, we know that there exists some deterministic oblivious adversary B such that P's expected cost under B is no smaller than its expected cost under A . Furthermore also by Theorem 2, we know that for any coin flip outcomes of P, there exist coin flip outcomes of A , such that the decisions made by B are the same as the decisions made by A under those coin flip outcomes. Thus since the dynamic network constructed by A always has a diameter of 8, we know that the dynamic network constructed by B has a diameter of 8 as well.
When running against any given oblivious adversary where the corresponding dynamic network has a diameter of 8 and has m nodes, P promises to terminate within tc (8, m) rounds over average coin flips. Hence P must terminate within tc(8, m) rounds over average coin flips when running against B. In turn, P must terminate within tc (8, m) rounds over average coin flips (of both P and A ) when running against A . By Markov inequality, P terminates within 10tc (8, m) rounds with probability at least 9 10 when running against A .
Since 10tc(8, m) ≤ q−1 2 and since α is always non-spoiled for Alice, Lemma 10 tells us that at Line 8 of Protocol 2, the outgoing message of α as determined by Alice must 12 The adversary here is the reference adversary. The coin flips of the reference adversary are the same as the coin flips of the leaker. Specifically, these coin flips are all the random variables s in Sect. 9.2.2. be consistent (i.e., the same as the corresponding outgoing message in the reference execution). Without loss of generality, assume that when α decides, it sends a special message. Hence if α decides within 10tc(8, m) rounds in the reference execution, Alice must be able to observe that.
By same argument, since (X , Y ) is of type-1, P must terminate within 10tc (8, m) rounds with probability at least 9 10 when running against our reference adversary in the second simulation. Again by Lemma 10, Alice can observe when α decides. A simple union bound shows that with probability at least 1 − 1 5 , Alice will be able to observe that both α and α decide within 10tc(8, m) rounds.
Finally, Lemma 10 also confirms that neither the first simulation nor the second simulation will abort at Line 20 of Protocol 2.

Lemma 12
Consider the processed inputs (X , Y ) and (X , Y ) in the proof of Theorem 7, and the corresponding first simulation and second simulation. If both processed inputs are of type-0, then α in the first simulation and α in the second simulation will both decide within 10tc(8, m) rounds with probability at most 3 10 , where the probability is taken over the coin flips of both the protocol and the adversary. 13 Furthermore, neither the first simulation nor the second simulation will abort at Line 20 of Protocol 2.
Proof We first prove that when the Consensus protocol P runs against our reference adversary in the first simulation, α and γ both decide within 10tc (8, m) rounds with probability at most 3 10 . Let A be our reference adversary in the first simulation, and Sect. 9.2.2 already explained that A is a sanitized adaptive adversary. We will need to construct another sanitized adaptive adversary B, in the following way. Intuitively, B generates the same dynamic network (regardless of the initial values to the nodes) as the dynamic network generated by A when the initial values to the nodes are the initial values assigned in the first simulation. More precisely, under all possible initial values to the nodes, when P's coin flip outcomes are C P , and when B's coin flip outcomes are C B , the adversary B generates the dynamic network G . Here G is the (unique) dynamic network generated by A when the initial values to the nodes are the same as the initial values assigned in the first simulation, when P's coin flip outcomes are C P , and when the coin flip outcomes C A of A satisfies C A = C B . It is easy to verify that since A is a sanitized adaptive adversary, B must be a sanitized adaptive adversary as well.
Consider any given initial inputs to P. For coin flip outcomes C P of P and coin flip outcomes C A of A , define cost(P, A , C P , C A ) to be 0 if the P's output is correct when running against A under C P , C A and the given initial inputs, and 1 otherwise. Since A is a sanitized adaptive adversary, Theorem 2 tells us that there exists some deterministic oblivious adversary such that the protocol's expected cost (over average C P ) under this deterministic oblivious adversary is no smaller than its expected cost under A . On the other hand, when executing against any given oblivious adversary and with any initial values, P promises to have at most 1 10 error over average coin flips. Hence when running against A and with any initial values, P must have at most 1 10 error over average coin flips (of both P and A ). By same argument, when running against B and with any initial values, P must have at most 1 10 error.
Let I denote the Consensus instance in the first simulation. We will construct two additional Consensus instances, in the following way. The Consensus instance I 0 is the same as I except that (i) all nodes in I 0 have initial values of 0, and (ii) I 0 is under adversary B instead of A . We similarly construct I 1 under adversary B where all nodes have initial values of 1. Now consider any given coin flip outcomes C P of P and coin flip outcomes C A of the adversary (which is either A or B). Note that under given C P and C A , the dynamic networks in the three instances as determined by their respective adversaries are exactly the same. We claim that if α and γ both decide within 10tc(8, m) rounds, then under C P and C A , P must err in either I or I 0 or I 1 .
To see why, we consider two cases. If P err in I , we are done. If P does not err in I , without loss of generality, let the decision value be 1. This means that both α and γ decide on 1 within 10tc(8, m) rounds in I . Next consider α's behavior in I 0 . Note that C P and C A have all been fixed, and also that I and I 0 have exactly the same dynamic network. The only difference between I and I 0 is the initial values. Since q ≥ 10tc (8, m), by the way we construct A and B, it is easy to verify that for all nodes τ where (τ, 0) (α, 10tc(8, m)), τ has the same initial value of 0 in both I and I 0 . Only a node τ such that (τ, 0) (α, 10tc(8, m)) may influence α's behavior by round 10tc (8, m). Thus for every node τ that can influence α's behavior by round 10tc (8, m), τ has the same initial value in I and I 0 . Hence α's behavior in I and I 0 must be the same. Since α decides on 1 by round 10tc (8, m) in I , it must also decide on 1 by round 10tc (8, m) in I 0 . But such a decision value is wrong in I 0 .
We have proved that for every C P and C A , if α and γ in the first simulation both decide within 80tc(m) rounds, then P must err in one of the 3 instances. On the other hand, as shown earlier, in each of the instances, P must have at most 1 10 error, over average C P and C A . Hence α and γ in the first simulation both decide within 10tc (8, m) rounds with probability at most 3 10 . So far we have proved that when P runs against our reference adversary in the first simulation, α and γ both decide within 10tc (8, m) rounds with probability at most 3 10 . We call this as the first reference execution. Next we consider running P against our reference adversary in the second simulation (which we call the second reference execution), and consider the node α there. One can verify that when both (X , Y ) and (X , Y ) are of type-0, then under the same C P and C A , the first reference execution and the second reference execution are "isomorphic": A node with a certain id in the first reference execution must have exactly the same behavior as the node with that id in the second reference execution. This means that the behavior of node α in the second reference execution must be exactly the same as the behavior of node γ in the first reference execution. Together with our earlier arguments, this means that with probability at most 3 10 , α in the first reference execution and α in the second reference execution both decide within 10tc (8, m) rounds.
Finally, since 10tc(8, m) ≤ q−1 2 and since α and α are always non-spoiled for Alice, Lemma 10 tells us that at Line 8 of Protocol 2, the outgoing messages of α and α as determined by Alice must be consistent (i.e., the same as the corresponding outgoing messages in the reference execution). Hence if α and α decide within 10tc(8, m) rounds in the respective reference executions, Alice will observe that. Lemma 10 also confirms that neither the first simulation nor the second simulation will abort at Line 20 of Protocol 2.
Let random variable z denote the number of leaked indices. If the answer to the Gdc g,2 n problem is 1, then z is the number of heads obtained when flipping n independent fair coins. Using Chernoff bound, the protocol's error probability is bounded as follows: If the answer to the Gdc g,2 n problem is 0, then z is the number of heads obtained when flipping n − b independent fair coins where b ≥ g = 16 √ n ln 1 δ . Let z be the number of heads obtained when flipping n −14 √ n ln 1 δ independent fair coins. Using Chernoff bound, the protocol's error probability is bounded as follows:  ). We will next prove that: If these two inequalities do hold, then we will have ||T−T|| = ||Ŝ − S|| ≤ ||S − D|| + ||Ŝ − D|| ≤ 9(δ −δ) 12 . We first prove ||S − D|| ≤ 8(δ −δ) 12 , by using Theorem 8.

.
Next we prove ||Ŝ−D|| ≤ δ −δ 12 . The difference betweenŜ and D arises solely from Line 15 in Protocol 1. when b j > h j for some j. Hence: We trivially have h ≥ 2n ≥ 2v j for all j.
Finally, taking a union bound for j from 1 through k gives: Appendix C: Proof for Theorem 8 The section proves Theorem 8. Theorem 8 is not a surprising result, and we do not claim it as a major contribution. We include this proof here mainly for completeness-while the overall approach is quite natural, the proof does involve some tedious and complicated steps, in order to get a relatively strong result. In particular, a weaker form Theorem 8 (i.e., by requiring μ in the theorem to be much larger) can be proved via a less complicated approach. But this weaker form would negatively impact the final asymptotic results in this paper.
Notations. We introduce some additional notations to be used in this section. For any μ where 2μ is a positive integer, recall that B(μ) is defined to be the binomial distribution describing the number of heads obtained when flipping 2μ independent fair coins. Define continuous distribution B(μ) to be the distribution whose density function is 1 2 2μ 2μ x for 0 ≤ x < 2μ + 1, and 0 for other x values. It is easy to verify that B(μ) is indeed a distribution. Intuitively, B(μ) is the continuous version of B(μ). Define N(μ) to be the normal distribution whose mean is μ and whose variance is μ/2. For any distribution D, f D is the distribution's density function.
It is not surprising that ||D − D || is close to ||N − N ||, since normal distribution can be used to approximate binomial distribution. For our proof, however, the complexity arises from need to quantify the approximation error. Since D and D are not continuous distributions, we cannot directly compare them with N and N . Hence we first consider D and D , where D = B(μ 1 ) × B(μ 2 ) × · · · × B(μ k ) and D = B(μ 1 ) × B(μ 2 ) × · · · × B(μ k ). In other words, they are the continuous versions of D and D . It is easy to show that ||D − D || = || D − D ||. We then show that the continuous distributions D and D are close to N and N , respectively. To do so, we will prove that f B (x) is close to f N (x), and in turn that B(μ) is close to N(μ).

C.1 Basic technical lemmas
We first cite a strong form of Stirling's formula, and then prove a few basic technical lemmas. All these will be useful later.
Lemma 13 [6] For all positive integer i,
C.2 Proof for f B (x) being close to f N (x) Lemma 16 below proves that f B (x) and f N (x) are close to easy other, under certain conditions.
We have:

C.5 Putting everything together
In this section, we first show a simple connection between the L 1 distance between two product distributions and the L 1 distances between the respective component distributions in the two product distributions. Next we will put everything together to prove Theorem 8.

Lemma 22
Consider any positive integer k, and any two product distributions D = D 1 × D 2 × · · · × D k and D = D 1 × D 2 × · · · × D k , where D 1 through D k and D 1 through D k are arbitrary continuous distributions. We have For z ∈ {0, 1}, note that (X , Y ) is of type-z iff left(X , Y ) and right(X , Y ) both are of half-type-z.
-Gdc(X , Y ) = 0. By definition, | 0 0 (X , Y ) ≥ g. We first show that immediately after the permutation and before adding the offsets in the preprocessing step, with probability at least 1 − 1 q 2 , | 0 0 (left(X , Y )) ≥ 4q ln q. To see why, we view the permutation as obtained by assigning each index between 1 and n in (X , Y ), one by one, to a new position between 1 and n after the permutation. Each position can only accommodate one index. Hence when we assign an index, we will choose a uniformly random position among all remaining unoccupied positions. Furthermore, we can imagine that we assign those indices corresponding to the | 0 0 patterns in (X , Y ) first, before assigning other indices. There are at least g indices corresponding to the | 0 0 pattern, and let us consider the first g of them. For each such index, regardless what happened prior to our assigning this index, the probability of this index being assigned to the first half of the positions (i.e., to some position between 1 and n 2 ) must be no smaller than 1 3 . The reason is that there will always be at least n 2 − g ≥ n 4 unoccupied positions in the first half of the positions, and at most n 2 unoccupied positions in the second half. Consider the sum z of 15q ln q independent Bernoulli random variables each taking a value of 1 with probability 1 3 . We have, via a simple coupling argument and Chernoff bound: Next, conditioned upon the event that | 0 0 (left(X , Y )) ≥ 4q ln q before adding the offsets in the preprocessing step, we will show that after adding the offsets in the preprocessing step, Pr[left(X , Y ) is half-type-0] > 1 − There are total q−1 2 such j's. Hence by a union bound, with probability at least 1 − 1 q 3 , after adding the offsets, | 2 j 2 j (left(X , Y )) ≥ 1 for all j. Next, after adding the offsets, by a Chernoff bound, we also have: Taking a union bound thus shows that conditioned upon the event that | 0 0 (left(X , Y )) ≥ 4q ln q before adding the offsets, after adding the offsets, Pr[left(X , Y ) is half-type-0] > 1 − 1 q 3 − 1 q 5 . Putting everything together, Pr[left(X , Y ) is half-type-0] > 1 − 1 q 2 1 − 1 q 3 − 1 q 5 > 1 − 3 q 2 . By the same argument, we similarly have Pr[right(X , Y ) is half-type-0] > 1 − 3 q 2 . By union bound we then have Pr[(X , Y ) is type-0] > 1 − 6 q 2 > 1 − 1 q .