Phalanx: A Practical Byzantine Ordered Consensus Protocol
Abstract
Byzantine fault tolerance (BFT) consensus is a fundamental primitive for distributed computation. However, BFT protocols suffer from the ordering manipulation, in which an adversary can make front-running. Several protocols are proposed to resolve the manipulation problem, but there are some limitations for them. The batch-based protocols such as Themis has significant performance loss because of the use of complex algorithms to find strongly connected components (SCCs). The timestamp-based protocols such as Pompe have simplified the ordering phase, but they are limited on fairness that the adversary can manipulate the ordering via timestamps of transactions. In this paper, we propose a Byzantine ordered consensus protocol called Phalanx, in which transactions are committed by anchor-based ordering strategy. The anchor-based strategy makes aggregation of the Lamport logical clock of transactions on each participant and generates the final ordering without complex detection for SCCs. Therefore, Phalanx has achieved satisfying performance and performs better in resisting ordering manipulation than timestamp-based strategy.
Index Terms:
Blockchain, Byzantine Fault Tolerance, Ordering Manipulation, Distributed SystemI Introduction
Byzantine Fault Tolerance (BFT) consensus protocols could be used to deal with arbitrary behaviors. However, the most widely used BFT consensus protocols (PBFT[1][2], HotStuff [3], etc.), limited types of malicious manners could be prevented because of the limitation of the leader-based system model. The leader always determines the next proposal to be applied, while backups can only detect whether a leader is crashed or the proposal is proposed on a duplicated serial number. Therefore, the leader could always decide on the content of proposals and could decide the ordering of proposals to commit. As for permissioned blockchain and some of the permissionless blockchain, they are mostly constructed based on leader-based BFT consensus protocols that Diem (Libra) is based on DiemBFT (HotStuff [3]) and Solana takes use of protocol based on PBFT, so we need to deal with the potential risks on ordering manipulation.
The possibilities of manipulating the ordering have left latent danger of malicious behavior. In recent works [4], researchers found that the manipulation of transactions in the permissionless blockchain, such as Ethereum [5], has made the attackers grab millions of profits. In the traditional financial system, front-running is a well-known illegal means to grab profits, especially on Wall Street [6]. For instance, when a broker receives a market order from a customer to buy a large amount of stock, before placing the order for the customer, he or she buys a few amounts of shares of the same stock for the broker’s account. Then, the broker places the customer’s order and the price of the stock will be driven up. If we allow the broker to immediately sell his or her shares, a significant profit will be generated in just a short time. The profits are just a part of the additional cost to the customer’s purchase caused by the broker’s self-dealing. In the situation such as sec-killing, the priority of transactions determines whether the dealer can get the products he or she prefers.
To deal with the ordering manipulation in BFT protocols, recently, the property called order-fairness has been widely discussed. Researchers have found that though collecting quorum[7] votes to decide the context of transactions seems like an effective approach. However, the Condorcet Paradox [8] [9] prevents us to reach a deterministic execution ordering. So that, how to resolve the Condorcet Paradox is the major barrier to designing a practical protocol to achieve order-fairness. Kelkar et al. proposed Aequitas[10] and Themis[11], which are batch-based protocols and achieve the order-fairness between by detecting strongly connected components (SCCs). But because of the complex graph algorithm to detect SCCs, the performance of Aequitas/Themis seems not satisfying. Pompe[12] proposed by Zhang et al. and Wendy[13] proposed by Kursawe et al. are timestamp-based protocols. They discard the logical clock and ordering the transactions with the timestamps. Because of the linearity of real clock, these protocols avoid the Condorcet Paradox and simplify the ordering phase to reduce performance loss. However, the timestamp-based protocols are easily destroyed by manipulating timestamps [14]. It might not be a good choice to construct industrial systems. (See Section VI for details)
It should be noted that we cannot distinguish the adversarial participants from the honest ones in a distributed system, and recent works [10] [11] [12] show that we cannot make the final ordering completely independent of Byzantine nodes. However, we are supposed to minimize the impact of the adversary on execution ordering, and an effective Byzantine ordered strategy should try to eliminate malicious behavior as much as possible and reduce the impact on performance at the same time.
In this paper, we aim to introduce a new strategy that could avoid complex graph detection and could achieve more fairness than the timestamp-based protocols. Based on previous work, we believe that the Byzantine ordered consensus has two properties, free will and correctness. Because of the vulnerability of real clock, we take the Lamport Logical Clock as the indicator to order transactions. Then, to achieve the fairness, we make aggregation of each participant preferences on transactions ordering to find the anchor commands with linear reliable context to make a commitment. It has prevented the occurrence the Condorcet Paradox, and the complex graph detection has been avoided. So that, we design, implement, and evaluate Phalanx, a anchor-based Byzantine ordered consensus protocol. It avoids complex graph detection and reflects the real preference of each node to commit transactions. In summary, we make the following contributions:
-
•
We propose anchor-based ordering strategy, which has avoided graph detection and could resist ordering manipulation.
-
•
We propose a protocol called Phalanx which has achieved anchor-based ordering and we implement it as a modular component. We release it for public use111https://github.com/Grivn/phalanx.
-
•
We conduct a comprehensive evaluation of Phalanx for performance and reliability. Phalanx does not introduce too much performance loss and has advantages in the WAN environment. And Phalanx performs better in resisting ordering manipulation than timestamp-based strategy.
II System Model and Anchor-Based Ordering
In this section, we firstly present the system model, then define ordering properties. Finally we introduce our strategy to prevent ordering manipulation with logical clock, and how to avoid the occurrence of the Condorcet Paradox.
II-A System Model
We consider a system of consensus nodes (hereinafter referred to as nodes for short) and any number of proposers (or we can call them clients). In this paper, we focus on the adversary in nodes and ignore the potential malicious behavior of proposers. We assume that an adversary can control up to nodes.
Command and Context. The command is the atomic unit for our Byzantine ordered consensus system. It is generated by proposers. Let denotes command. For commands and , we use notion to describe their context, which means the sequential relationship between and . If should be committed before , then . The command can be assigned with sequence number to indicate the preference ordering for the proposer. Whenever proposer is trying to propose request , it should generate a command with data structure , in which is the identifier of proposer, is the request content, is a monotonically increasing sequence number which indicates the sending order for current command on , is the digest of command that .
Partial Ordering and Total Ordering. The commands generated by proposers would be broadcast to every node. The node needs to generate its partial ordering according to the order of reception. And generates logs to describe its partial ordering. Each node has a logical clock starting from 0. Every time has received command , the logical clock is advanced by 1. Then, generates a log for assigned with current logical clock. The structure is , in which is the identifier of , is the logical clock stamp when current log has been generated, is the digest of that .
Taking the partial ordering of each node as the material, Byzantine ordered consensus would make all the trusted nodes obtain a consistent total ordering. The commands would be committed according to the consistent total ordering and would send back reply message to specific proposers.
Let denotes log. Call that , if and only if . Let denote the context in ’s partial ordering. For logs and from , there are and that and . There is a context that if and only if . Although the partial ordering for each node might- be different, every non-faulty node would eventually find the same total ordering to commit commands.
II-B Network Model
The modular implemented Phalanx component should be combined with a BFT protocol so that the network assumptions should support both Phalanx component itself and the combined original BFT protocol.
The communication in Phalanx component is asynchronous, so that, in addition to the network assumption of the original BFT protocol, we only need to satisfy the messages sent from one participant will reach the recipient(s) eventually. As asynchronous network assumption is the weakest one in BFT protocol groups’ network assumptions, the Phalanx component will not impact the robustness of the original BFT cluster.
Besides, there is another basic assumption called sending-receiving model that messages receiving order should always be the same as their sending order. For instance, is trying to send messages toward . If has sent before , must receive before . It could be achieved easily with the use of sequence numbers.
II-C Ordering Properties
In state-of-the-art leader-based BFT consensus protocols, the total ordering is determined by the leader and followers can only detect limited malicious behaviors. It doesn’t respect the collective preferences of each correct participant, and, because a leader has controlled the total ordering, there is a risk of suffering a manipulation attack, which means the adversaries make the transactions more likely to be committed according to their own wishes.
Byzantine ordered consensus protocol is used to tolerate Byzantine faults in ordering manipulation. To achieve it, we believe Byzantine ordered consensus protocol should have two essential properties, free will and fairness.
Free Will. Free will is a concept proposed by Zhang et al. [12]. Briefly, it means no one could manipulate the total ordering directly. For instance, here is a pair of commands and . If their context in each node’s partial ordering indicates (or ), their context in the total ordering must be the same that (or ). If some of the nodes prefer while others , in the total ordering of trusted node, the context between such a pair of commands should be determined by every participant’s preference which means both of them have an opportunity to be committed at first.
Fairness. The ordering in reality deserves some intuitive expectations as below. 1) The commands proposed by the same proposer may born with context that for , we have , iff . 2) The commands proposed by different proposers may deserve context because of the physical limitations. For instance, and are located in the same place. If has proposed several seconds earlier than proposing , deserves the context in the total ordering commitment. Although, the ordering can be affected by multiple factors that we cannot find the totally correct ordering, we can make the context in total ordering show the intuitive expectations to the maximum.
By using some reasonable ordering strategies, which take every node’s partial ordering into thought, we can always achieve certain free-will characteristics. To achieve better fairness, we need to aggregate the logical clock from each participant. However, the Condorcet Paradox prevents us to find distinct total ordering. Next, we would like to introduce our method to deal with the paradox.
II-D Anchor-Based Ordering
Definition 1 (Reliable Context).
For a pair of commands and , there is a reliable context (or ), iff at least one non-faulty node believes (or ).
Theorem 1.
Let denote the reliable context. For commands and , if there are nodes believe , then there is reliable context .
For the reliable context is generated by the non-faulty nodes, selecting it into the total ordering satisfy the free-will. If the context is not reliable, it means the context could be generated by a byzantine node, and might be the will of the adversaries. It is risky to select such a unreliable context into total ordering.
Linear Anchor. To prevent the Condorcet Paradox, we need to find something with linearity. Here, a series of commands with linear reliable context can help us commit the commands. We call such series of commands as anchor commands. Let denote a anchor command. With the reliable context between anchor commands, we find a partial ordering set .
Then we need to commit the anchor commands according to the partial ordering set. Each time when we commit an anchor command , we need to generate command set which is constructed with and the commands with reliable context . After that, the commands would be committed linearly, which has avoided the Condorcet Paradox, and make the ordering process more practical and conducive to implementation.
In the next section, we would like to introduce the protocol we design with the anchor-based ordering strategy.
III Phalanx
Phalanx is a Byzantine ordered consensus protocol that can be implemented as a modular component and combined with any state-of-the-art BFT consensus algorithms, without neither additional hardware support nor additional network assumptions. It could help the BFT protocols to achieve anchor-base ordering strategy, and not take much effect on the original protocol. In this section, we would like to introduce Phalanx and make proof of its basic properties.
III-A Overview
Phalanx has two types of roles: proposers and nodes. A proposer could propose command with given order. The non-faulty nodes are trying to reach consensus on the total ordering of commands.

As is shown in Fig. 1, a node is constructed with three main parts: mempool, consensus, and executor. Whenever node has received the command sent from proposers, firstly, put them into ’s partial ordering according to FIFO (First-In-First-Out) receiving the ordering. Then, pending logs for are created. After the process of order-protocol, verifiable logs are generated to notify others its own partial ordering. The mempool is a container of logs received from each node. In consensus module, using the logs in mempool, we generate order-batch to trigger consensus and get the same log stream for non-faulty nodes with the help of any state-of-the-art BFT protocols. Taking the log stream as material, in executor, the non-faulty nodes eventually find the same total ordering for commands. In particular, we list some basic notations as needed in Table I. As for the sets and vectors, unless otherwise specified, they do not have preset size. If the vector have preset size, every element in it should have a initial value.
Notation | Description |
---|---|
Command. | |
Context. | |
Reliable context. | |
Node. | |
The node with identifier . | |
Proposer. | |
The proposer with identifier . | |
Empty value. | |
A set or a vector | |
The element in whose keyword is . | |
FIFO queue. | |
Take out the front-log in the FIFO queue. | |
Read the front-log without taking it out. | |
Remove the front-log in the FIFO queue. | |
Add the element to the end of queue. | |
The number of elements in current queue. | |
Calculate the hash of . | |
Partial signature generated with private key. | |
Generate partial signature for . | |
Verify the partial signature . | |
Aggregate the partial signatures for . | |
Verify the aggregated signature with public key. |
III-B Cryptographic Notations
We use standard hash function (e.g., SHA256) to generate the digest of messages. Generate the digest of , , then could be regarded as the identifier of . If there is another message , we say that is the same as if and only if .
We assume a public key infrastructure (PKI) of each participant in our system including proposers and nodes which means each of them is identified by its own public key. When proposer or node is trying to send message , the communication transmission will be carried out reliably through .
Besides, we make use of ()-threshold signature among nodes. There is a single public key and each holds a distinct private key. If event needs to be determined by the vote of the nodes. Sending a vote means approval, and not sending a vote means denial. Each time when sends a vote, it generates a partial signature with its private key . We could verify the validation of partial signature with with . When there is a set of valid partial signatures and , generate aggregated signature for , . Every node could verify the aggregated signature with the single public key that . If it is a valid aggregated signature, the function should return value.
The aggregated signature could be regarded as a kind of certificate, denoted as . If is valid, then it means there are nodes have voted on event . Make use of -threshold signature to generate for in BFT consensus algorithm, and we could verify the to check the quorum agreement on .
III-C Mempool
Each node has its own mempool. Let denote it. Whenever receives commands from proposers, the would receive them and generate partial ordering according to FIFO receiving ordering. At the same time, certified logs would be generated with ordering protocol and notify other participants.
Notation | Description |
---|---|
The mempool module for node . | |
The verifiable log to describe ordering preference. |
Structures. The structure notion for mempool is shown in Table II. To make the log verifiable, we upgrade the structure of in section 3. The verifiable is , in which is the timestamp when we generate current log, is the digest of previous log, which refers to the log with sequence number (if is equal to 1, then is empty), is the digest of current log that , is a certificate generated by ordering protocol with nodes and it could be used to verify the validation of current log.
Notation | Description |
---|---|
An integer, initialized to 0, is used to track the latest log | |
generated by that it is logical clock. | |
A log type element, initialized to , which is used to track | |
the log without certificate. | |
An -sized vector of log, where , initialized to , | |
is used to track the latest verifiable log from . | |
A FIFO queue command, is used to receive the commands | |
from proposers. |
States. To operate the ordering protocol, needs to maintain local states as is shown in Table III. The is used to track the latest log. The is used to track the log without certificate. The -sized vector is used to track the latest verifiable log. The is used to receive the commands from proposers.
Protocol. As is shown in Fig. 2, nodes run order-protocol to generate verifiable logs. The steps are as follows.

Step 1: Pre-Order. If the FIFO queue isn’t empty and there isn’t a pending log that , would take the front element and then try to generate verifiable log for it. advances its local logical clock , and generates the order tuple without certificate , , , . Store the tuple as a pending log that . Then, broadcasts pre-order message PRE_ORDER and starts to wait for the responses from nodes (including itself).
Step 2: Vote. A node (including itself) receives the pre-order message sent from and tries to verify the tuple with ’s latest verifiable log that . First, should have a valid digest. Next, if is , then should be equal to 1. If is not , then should be the next log of that and . If satisfies these requirements above, it could be regarded as a valid tuple. Then, the node would respond with VOTE , where is the digest of that , and is a partial signature generated by for digest that . Whenever has voted log from , will not vote for another log from that .
Step 3: Order. Whenever receives response from , it verifies the partial signature with . If it is valid, accept it. When has received valid responses from nodes (including itself), there is a set of valid partial signatures and is equal to . Generate aggregated signature with the set and complete log that . Next, broadcasts partial order message ORDER to notify others with its latest verifiable partial order. When node receives the log from , verify it with . If it’s valid, then update the latest log of in local states that .
At last, the logs generated by is constructed like Fig. 3. The subscript of in the figure indicates the log’s serial number. The digests of logs construct a chained structure and the certificate could be used to verify the validation of each log. Besides, stores the commands and verifiable logs has received. Every time trying to use them, we could get the command according to its digest and get log according to tuple , where is the author of partial order and is the sequence number.

III-D Consensus
Let denotes the consensus module for node . It is used to find the same log stream for each non-faulty node. To achieve this goal, Phalanx could employs any state-of-the-art BFT protocols, such as PBFT, HotStuff, and even HoneyBadgerBFT, an asynchronous protocol. The primitive BFT protocol could help the non-faulty node reach consensus on the order of -batch. Here, in Phalanx, the contents of consensus batch are replaced by the latest logs for each node. We call it order-batch. After the consensus process of primitive BFT protocol, we can find the consistent logs set to generate total ordering in the executor module.
Notation | Description |
---|---|
The consensus module for node . | |
An order-batch, which is constructed with element . | |
An -sized vector of log, where , initialized to , | |
stores the latest verifiable log from . | |
A set of logs , in which the elements are the logs | |
from every node. |
Structures. The consensus module takes use of some basic data structures as is shown in Table IV. We take the order-batch into the primitive BFT consensus process. After the consensus agreement of the ordering to submit , non-faulty nodes can generate the same logs set . In addition, the elements in should be sorted by the strategy that sort the logs in ascending order according to the sequence number , and if logs have the same sequence number, sort them in ascending order according to the generators’ identifier .
Notation | Description |
---|---|
An -sized vector of integers where , initialized with 0, | |
tracks the sequence number of logs which is committed in | |
consensus module from , and we could regard as | |
a kind of vector clock | |
A FIFO queue for sets of logs . |
States. Each node ’s consenter maintains the basic local states as is shown in Table V. The -sized verctor is used to track the sequence number of committed logs. The FIFO queue is used to store the logs.
Actions. If we employ leader-based BFT protocol, such as PBFT or HotStuff, the order-batch could be always generated by the leader in the current view (or round), so that we could provide a standard interface to generate order-batch. Whenever the leader has found a latest log for in mempool which has a larger sequence number than , it could try to generate order-batch and trigger the BFT protocol. The content in could be generated from mempool that . After the process of BFT protocol, every non-faulty node will find , in which there are a series of order-batches in the same order.
Next, commit the order-batches in one by one. Whenever trying to commit , a set of logs would be generated. The steps are as follows.
Step 1. Verify the certificates of logs in . If there is an invalid log, stop the process and change the leader in BFT protocol. If they are valid, initialize an empty log set . For each logs in , we should process it according to step 2.
Step 2. Let and . If , just return. If , then (1) update with , (2) add into , (3) get the logs generated by with sequence number belonging to from mempool and add them into . If we cannot find the expected logs from mempool, request other nodes for it and verify the digests and certificates.
Step 3. After the process of each log in , add into the end of .
As for employing leadless BFT protocols, the generation of order-batch depends on the generation strategy of the primitive protocol. For instance, in HoneyBadger-BFT (HB-BFT), each node would generate a slice of the proposal, and the final committed block is constructed by part of them. So that, if we employ Phalanx in HB-BFT, node would just propose its latest log to trigger BFT protocol. After each time the BFT protocol consensus process is finished, an order-batch could be constructed. At last, we could find a series of order-batches in the same order and commit them one by one to generate the log sets to update .
After the process of consensus module, each non-faulty node would find the same FIFO queue . The FIFO queue is going to be used in executor module to generate total ordering.
III-E Executor

The executor module aims to get the final ordering (total ordering) according to the log stream in . To achieve anchor-based ordering, we need to find the anchor commands with specific ordering rules. In this part, we would like to introduce the generation of final ordering.
Notation | Description |
---|---|
The executor module for node . | |
A command info to collect essential information for | |
one command’s commitment. |
Structures. The command is the basic unit for Byzantine ordered consensus. Here, as is shown in Table VI, we take command info to collect essential information for command’s commitment. We say that if and only if is used to collect essential information for command . The command info that contains: (1) , the digest of command that . (2) , An -sized vector of logs where , initialized to , tracks the log from that , and the method would return the number of element in which is not . (3) , a set that is used to store the timestamps. Whenever is added into , would be added into . The timestamps in are sorted in ascending numerical order. If the length of is greater or equal to , then the -th one would be recognized as trusted timestamp.
Notation | Description |
---|---|
A set of strings, tracks the digests of commands | |
which have been committed. | |
A vector of command info, where refers | |
to the command info whose digest is equal to . | |
An -sized vector of FIFO queues, where is the | |
FIFO queue . | |
The queue used to record the logs from | |
according to the commitment order into executor. | |
The front-log in that . | |
If , then . | |
An -sized vector of front-logs, where tracks | |
the front-log . |
States. Each node ’s executor maintains the states as is shown in Table VII. The set is used to track the committed commands. The vector is used to track the command info in executor module. The -sized vector is used to store the commands submitted from consensus module. The refers to the FIFO queue , which is used store the logs of . The refers to the front-log in . And we use an -sized vector to track the .
Actions. Whenever is not empty, take the front element in it that and try to process with the ordering process as follows.
Step 1. Commit logs in one by one into executor module. For each log in , read the command info from at first that (if there doesn’t exist such a command info, initiate it). Update with and add into the end of FIFO queue .
Step 2. Find the anchor-set. Initialize an empty anchor-set . Read every FIFO queue in . While reading , if the front-log points to a committed command that , then remove it and read the latest front-log. Repeat the process till the front-log is or points to uncommitted command. Add each into a vector that tracks the front-log . If there exists commands that at least front-logs point to , then put all these command info into , return the anchor-set . If not, jump into alter path.
alter path. For all the command info with , get the command info with the lowest trusted timestamp. Then regard the command as anchor command . If , that we can find , , that there is not a reliable context , then add into . Repeat this process until no such a can be found or the added into has .
Step 3. Check the front set. For each command info in , if , then remove from . If that there are at least non-empty values in but is less than , then directly return an empty anchor-set.
Step 5. Commit the commands according to . First of all, sort the command info {c} in anchor-set according to the in ascending order by trusted timestamp of . If the trusted timestamps are the same, then sort the command info alphabetically. After that, according to the sorted command info set , we would commit the command that one by one. To obtain the command , we could read the mempool or request it from others.
As is shown in Fig 4, it is the journey for non-faulty nodes to create total ordering after each participant has generated partial ordering in its mempool.
After the commitment of commands, each non-faulty node gets the same total ordering to execute them. After the execution of the command, nodes would feedback the results to proposers. If the proposer has received the same response for one command, accept the execution result for it.
III-F Proof
Theorem 2 (Validity).
If a non-faulty node appends into its final ordering, then at least one non-faulty node has selected into its partial ordering.
Proof:
Before command has been committed into final ordering, the node should collect at least logs from different participants pointing to it. The logs are related to nodes’ partial ordering. As the adversary can only control up to nodes, has been selected at least one non-faulty node. ∎
Theorem 3 (Consistency).
For logs and from the same node, if their certificates are valid, then .
Proof:
For logs and both generated by , assume that they have valid certificates and . So that, nodes have voted for and which means at least nodes have voted for logs from on sequence number twice. But the adversary can only control up to nodes. Therefore, here is a paradox. ∎
Theorem 4 (Consistency).
For non-faulty nodes and , let and denote their total ordering. If there is context in , then we could eventually find in .
Proof:
In consensus module, every non-faulty node will find the same log stream. While generating the total ordering, non-faulty node should process the log stream by order. Because of the strategy of SMR, if the log stream is the same, the state on each node would be the same. So that, the final ordering on each non-faulty node is the same. ∎
Theorem 5 (Consistency).
For nodes and , regard their final order decision as and . If , then .
Theorem 6 (Finality).
For valid verifiable logs and from the same node that , if there is a committed order-batch that , then each non-faulty node can receive the consistent .
Proof:
For the verifiable logs and from , , , . Because of the validation of , nodes have voted for it, which means they have already received . While the commitment of logs in executor, we could request from others, since there are at most f malicious nodes, everyone could receive the valid at last. ∎
Theorem 7 (Anchor Linearity).
Let denote the set of anchor commands generated by Phalanx. There is a partial ordering set .
Proof:
For and is committed before , make an assumption that there isn’t reliable context that . If is selected by normal path, then at least nodes believe we should commit at first, so that there is . If is selected by alter path, then the commands without are committed at the same anchor-set, so that for the uncommitted , there is reliable context that . ∎
As for the commands belonging to the same anchor-set, the timestamp-based strategy can be taken to decide their ordering. For there are at most faulty nodes, the -th largest timestamp is most likely sent from a non-faulty node, when we have received at least logs pointing to specific command from different nodes.
IV Implementation
We implement Phalanx as a modular component in Go and should employ it with state-of-the-art BFT protocol. Bamboo[15] is an evaluation framework for chained-BFT protocols in Go. It has implemented multi kinds of chained-BFT protocols, e.g. chained HotStuff, StreamLet and etc.. Here, we complete Phalanx system on Bamboo chained-BFT implementations. The following experiments concentrate on the Phalanx system employed on HotStuff in Bamboo. Refer to HotStuff as HS. Refer to the extended protocol from HS as Phalanx-HS.
To amortize the cost of protocol, batching is a common optimization for performance improvement. In our implementation of Phalanx, we would like to make use of batching strategy. Each proposer could propose a command batch with requests in it. Each node could generate one batched log to declare its ordering preference for a series of commands that node could request ordering phase every interval to declare its partial ordering in that duration. As for the performance, the batching strategy amortize the cost of hash calculation and signature verification, and Phalanx could achieve a more satisfying performance with batching strategy.
V Experiment and Evaluation
In this section, we evaluate the performance and reliability of Phalanx system which is employed in BFT protocol implementations on Bamboo. The main concern is about the impact of Phalanx component on latency and throughput in our system. To analyze it, we compare Phalanx system with its baseline BFT protocols in both LAN and WAN environments. Next, we concentrate on the fair ordering functionality of Phalanx. After that, we compare the robustness of anchor-based Phalanx with timestamp-based strategy.
V-A Performance Evaluation
Baseline and Metrics. We take HS as the baseline of our performance evaluation. We would like to compare the throughput and latency between HS and Phalanx-HS in both LAN and WAN environment. In this part, we concentrate on the performance loss caused by Phalanx component and some other factors which could affect performance. The latency has ignored the transmission delay of commands.
LAN Deployment and Performance. We deployed our evaluation on 4 instances in the same datacenter to compare the performance of baseline and Phalanx. Each Phalanx node ran on Aliyun ECS c7 with 8vCPU (Intel Xeon 8369B) and 16GiB memory.
For each datacenter, we use the default batch size and the ordering interval ms. The results are shown in Table VIII. If there is only 1 proposer () to propose commands in Phalanx-HS, the throughput of it is almost the same as HS while the latency of Phalanx-HS is 15.3% higher than HS. If we increase the number of proposers from 1 to 4, the throughput of Phalanx-HS increases in direct proportion to the number of proposers, while the latency of Phalanx-HS has barely changed. Then, we evaluate the performance of HS with , and we found that its performance is almost the same as Phalanx-HS with and .
throughput (txs/s) | latency (ms) | |
---|---|---|
HS(b=200) | 38,680 | 54.1 |
Phalanx-HS(b=200, p=1) | 35,956 | 62.4 |
Phalanx-HS(b=200, p=2) | 51,815 | 63.8 |
Phalanx-HS(b=200, p=3) | 72,197 | 62.3 |
Phalanx-HS(b=200, p=4) | 100,564 | 63.6 |
HS(b=800) | 119,499 | 57.4 |
WAN Deployment and Performance. We deployed our evaluation on 4 geo-distributed nodes to compare the performance of baseline and Phalanx. Each Phalanx node ran on Aliyun ECS c5e with 8vCPU (Intel Xeon 8269CY) and 16GiB memory. Servers are located in Silicon Valley, Frankfurt, London, and Tokyo.
For each geo-distributed node, we use the default batch size and the ordering interval ms. The results are as shown in Table IX. If there is only 1 proposer () to propose commands in Phalanx-HS, the throughput of it is almost the same as HS. However, the latency of Phalanx-HS is 5.57% lower than HS, which is satisfying. It is mainly because that the main bottleneck of geo-distributed system is network communication and the order-batch which only contains the latest logs of each participant has reduced the volume of HS consensus proposal. Besides, each part of Phalanx (mempool, consensus, and executor) are running concurrently, which can make full use of computing resources. Then, we increase the number of proposers from 1 to 4, and also find that the throughput of Phalanx-HS increases in direct proportion to the number of proposers with barely changed latency in geo-distributed environment.
throughput (txs/s) | latency (ms) | |
---|---|---|
HS(b=200) | 1,288 | 1,324.6 |
Phalanx-HS(b=200, p=1) | 1,294 | 1,250.8 |
Phalanx-HS(b=200, p=2) | 2,515 | 1,264.8 |
Phalanx-HS(b=200, p=3) | 3,781 | 1,142.5 |
Phalanx-HS(b=200, p=4) | 5,196 | 1,252.1 |
Evaluation. Compared to the baseline, Phalanx incurs signatures and more network communications to process verifiable logs. However, the order-batch reduces the volume of the state-of-the-art BFT proposals. Then, as for the latency for Phalanx, it is about 15% higher than HS in LAN and could be slightly lower than HS in WAN environment. As for throughput, Phalanx is almost the same as HS if there is only 1 proposer, and the throughput of Phalanx increases in direct proportion to the number of proposers, while the latency of Phalanx-HS has barely changed. It can be considered that Phalanx does not bring too much performance loss, and it has advantages in some situations.
V-B Fault-Tolerance Functionality
Simulation for Ordering Manipulation. In this part, we simulate the ordering manipulation to verify the ability for Phalanx to resist attacks. For the commands generated by the same proposer, there should be an intuitively distinct ordering that we need to commit the earlier proposed command at first. So that, we add sequence number on commands proposed to note the intuitive distinct ordering. To simulate the Byzantine behaviour, we inject some codes to make the adversary disorder the commands it has received and generate wrong partial ordering. With the monitoring on whether the commands are committed according to the sequence number, we can evaluate the ability to resist ordering manipulation.
reordered commands ratio | |
---|---|
following byzantine | 99.8% |
0% | |
0% | |
21.1% |
Table X shows the change of reordered commands ratio with the number of Byzantine nodes. If there is no adversary that , no intuitively distinct context is broken. If there is one Byzantine node and follow the attacker’s ordering, then almost all the intuitively distinct contexts are destroyed. However, after the activation of Phalanx strategy, only almost every intuitively distinct context has been resisted. If the number of adversarial nodes is larger than the fault-tolerance threshold, we can find there are part of command pairs with intuitively distinct context have been reordered.
V-C Adversary Resistance
In this part, we compare the adversarial attack resistance ability between timestamp-based strategy and Phalanx. For Byzantine fault tolerance protocols, if the number of Byzantine nodes is no larger than the fault-tolerance threshold, we expect the intuitively distinct contexts should be preserved. Here, we do not implement a timestamp-based protocol[12][13]. We compare the Phalanx with timestamp-based strategy directly.
Phalanx | Timestamp-based | |
0 | ✓ | ✓ |
1 | ✓ | ✓ |
2 | ✓ | ✓ |
3 | ✓ | |
4 | ✓ | |
5 | ✓ |
We deployed our evaluation on 16 nodes. Each Phalanx node ran on Aliyun ECS c7 with 8vCPU (Intel Xeon 8369B) and 16GiB memory. We inject codes to make some of them malicious and set 2 proposers. Increase the byzantine node number from 0 to threshold () and detect the ratio of commands which have been reordered. Here, let us consider that the system has resisted manipulation attack if the ratio of reordered commands is less than 0.5%. As is shown in Table XI, both Phalanx and timestamp-based strategy could reserve the intuitively distinct context without any Byzantine nodes. However, if there exists Byzantine nodes in current situation, the timestamp-based strategy sometimes cannot prevent manipulation attack, while Phalanx could still reverse intuitively distinct contexts.

To take further evaluation on adversary resistance, we deployed our evaluation on 34 nodes. Each Phalanx node ran on Aliyun ECS c7 with 4vCPU (Intel Xeon 8369B) and 8GiB memory. We also inject codes to make some of them malicious and set 2 proposers. Increase the byzantine node number from 0 to threshold () and detect the reordered commands ratio. As is shown in Fig 5, the probability of timestamp-based strategy causing command reordered which has destroyed intuitively distinct context is significantly higher than Phalanx. As the number of Byzantine nodes increases within the threshold, the commands ordered by timestamp-based strategy will be much easier to be attacked, while the reordered commands ratio through Phalanx does not increase rapidly. We found that the Phalanx performs better in resisting ordering manipulation than timestamp-based strategy.
Besides, we find that, whenever reordered commands ratio of Phalanx goes up, there are more anchor-sets selected through alter path. It is an attention-worth problem that can be further studied in the future.
VI Related Works
Aequitas[10] proposed by Kelkar et al. in 2020 are the first class of protocols which have achieved weak order-fairness in both synchronous and asynchronous situations. To deal with Condorcet Paradox, Aequitas construct a relation graph of transactions and find out all of the strongly connected components (SCCs) and the transactions in the same SCC would constitute Condorcet Paradox. After that Aequitas could find deterministic ordering to execute each SCC, and the transactions in the same SCC would be applied in the same batch. It could be considered as a batch-based ordering protocol. In 2021, Themis[11] was proposed by Kelkar et al.. It is the upgraded batch-based ordering protocol from Aequitas. It has resolved the liveness problem and has reduced communication complexity. However, to detect SCCs in relation graph, the commonly used algorithm such as Tarjan[16] and Kosaraju[17] have high computation complexity which is related to the number of transactions and their context. It is an obvious system bottleneck. The experiment of Themis shows that its throughput is about 20% of HS with the same batch-size in LAN.
Pompe[12] proposed by Zhang et al. has also proposed a practical protocol to deal with ordering manipulation. Here, transactions are ordered according to the medium timestamp that it is a naturally linear ordering indicator which could avoid Condorcet Paradox. With this simplified ordering strategy, Pompe has achieved higher throughput at competitive latencies compared with the state-of-the-art BFT protocols. As the indicator is constructed by timestamps, the ordering strategy in Pompe could be regarded as a timestamp-based ordering protocol. In the same year, Wendy[13] proposed by Kursawe et al. has also achieved order-fairness with medium timestamp similar to Pompe.
Although, without detecting SCCs, timestamp-based ordering strategy seems like to have resolved the bottleneck of Byzantine ordered protocols, it just provides each node an opportunity to decide the final order, which reduces the impact of the adversary but cannot prevent arbitrary behavior of manipulating ordering. As is shown in Table XII. There are 4 nodes that is a malicious node. Here is a pair of commands and with intuitively distinct context that they are proposed by the same proposer and is proposed several seconds before . and receive these commands slightly later, while received these commands earlier. If we select , , and as the final set, then ’s medium timestamp 2 would be smaller than that such pair of commands would be reserved.
0 | 3 | 3 | 3 | |
1 | 4 | 2 | 4 |
Fiary[18], proposed by Stathakopoulou et al. is an ordering system with the assistance of TEE to prevent front-running attacks. Fairy needs to introduce specific hardware to support the operation of the protocol, and its correctness depends on the reliability of the TEE itself. So that, the scope of its application is relatively limited. In 2021, Cachin et al. also theoretically proposed a quick order fairness atomic broadcasting protocol [19], which can ensure that messages are delivered in different fair orders. However, it has not been implemented.
VII Conclusion
To propose an efficient Byzantine ordered consensus protocol, we propose anchor-based ordering strategy and design a protocol called Phalanx based on it. Phalanx is a practical Byzantine ordered protocol, which can be employed in each state-of-the-art BFT protocol. The ordering phase in Phalanx does not take too much performance loss that only 15% more latency and slightly decrease of throughput in LAN. Because of the optimization of communication, the latency of Phalanx is lower than HS in WAN. As for resisting ordering manipulation, Phalanx is better than the timestamp-based strategy. Besides, the ratio of anchor-sets generated through alter path seems to be taken to track the reliability of Phalanx, which could be further studied in the future.
References
- [1] M. Castro, B. Liskov et al., “Practical byzantine fault tolerance,” in OSDI, vol. 99, no. 1999, 1999, pp. 173–186.
- [2] M. Castro and B. Liskov, “Practical byzantine fault tolerance and proactive recovery,” ACM Transactions on Computer Systems (TOCS), vol. 20, no. 4, pp. 398–461, 2002.
- [3] M. Yin, D. Malkhi, M. K. Reiter, G. G. Gueta, and I. Abraham, “Hotstuff: Bft consensus with linearity and responsiveness,” in Proceedings of the 2019 ACM Symposium on Principles of Distributed Computing, 2019, pp. 347–356.
- [4] P. Daian, S. Goldfeder, T. Kell, Y. Li, X. Zhao, I. Bentov, L. Breidenbach, and A. Juels, “Flash boys 2.0: Frontrunning in decentralized exchanges, miner extractable value, and consensus instability,” in 2020 IEEE Symposium on Security and Privacy (SP). IEEE, 2020, pp. 910–927.
- [5] V. Buterin et al., “Ethereum white paper,” GitHub repository, vol. 1, pp. 22–23, 2013.
- [6] M. Lewis, Flash boys: a Wall Street revolt. WW Norton & Company, 2014.
- [7] R. Shostak, M. Pease, and L. Lamport, “The byzantine generals problem,” ACM Transactions on Programming Languages and Systems, vol. 4, no. 3, pp. 382–401, 1982.
- [8] F. Brandt, V. Conitzer, U. Endriss, J. Lang, and A. D. Procaccia, Handbook of computational social choice. Cambridge University Press, 2016.
- [9] M. d. Condorcet, “Essay on the application of analysis to the probability of majority decisions,” Paris: Imprimerie Royale, 1785.
- [10] M. Kelkar, F. Zhang, S. Goldfeder, and A. Juels, “Order-fairness for byzantine consensus,” in Annual International Cryptology Conference. Springer, 2020, pp. 451–480.
- [11] M. Kelkar, S. Deb, S. Long, A. Juels, and S. Kannan, “Themis: Fast, strong order-fairness in byzantine consensus,” Cryptology ePrint Archive, 2021.
- [12] Y. Zhang, S. Setty, Q. Chen, L. Zhou, and L. Alvisi, “Byzantine ordered consensus without byzantine oligarchy,” in 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI 20), 2020, pp. 633–649.
- [13] K. Kursawe, “Wendy, the good little fairness widget: Achieving order fairness for blockchains,” in Proceedings of the 2nd ACM Conference on Advances in Financial Technologies, 2020, pp. 25–36.
- [14] M. Kelkar, S. Deb, and S. Kannan, “Order-fair consensus in the permissionless setting.” IACR Cryptol. ePrint Arch., vol. 2021, p. 139, 2021.
- [15] F. Gai, A. Farahbakhsh, J. Niu, C. Feng, I. Beschastnikh, and H. Duan, “Dissecting the performance of chained-bft,” arXiv preprint arXiv:2103.00777, 2021.
- [16] R. Tarjan, “Depth-first search and linear graph algorithms,” SIAM journal on computing, vol. 1, no. 2, pp. 146–160, 1972.
- [17] M. Sharir, “A strong-connectivity algorithm and its applications in data flow analysis,” Computers & Mathematics with Applications, vol. 7, no. 1, pp. 67–72, 1981.
- [18] C. Stathakopoulou, S. Rüsch, M. Brandenburger, and M. Vukolić, “Adding fairness to order: Preventing front-running attacks in bft protocols using tees,” in 2021 40th International Symposium on Reliable Distributed Systems (SRDS). IEEE, 2021, pp. 34–45.
- [19] C. Cachin, J. Mićić, and N. Steinhauer, “Quick order fairness,” arXiv preprint arXiv:2112.06615, 2021.