## 3 Scalable Dynamic Multi-Agent Byzantine Consensus
### Process
#### 3.2.1 Process in Pre-Prepare Stage
In the consensus process, if any steps are not executed or timed out, the node's voting result is regarded as disagreement. Therefore, within a certain period of time, the result will be returned to the client. Regardless of whether the final result is agreement or disagreement, it is treated as the correct result. Therefore, the system satisfies the definition of liveness in a distributed environment. ### Fault-Tolerance Analysis for SDMA-PBFT

We will discuss the fault-tolerance performance of our SDMA-PBFT algorithms in this subsection. We discuss the fault tolerance in two situations:

#### 3.7.1 No Faulty Nodes Are Agent Nodes

In this scenario, there are two possibilities: One is that the faulty nodes are evenly distributed in each area and the number of faulty nodes that are running within an area does not exceed \(1/3\) of the total number of nodes. At this time, the voting result within the area is correct and has no effect on the system output result, and the system's fault tolerance is:

\[\text{Fault tolerance}=\frac{n}{k}\times\left(k-1\right)/3 \tag{17}\]

The second possibility is that faulty nodes are concentrated in an area. After running PBFT in this area, the agent node will produce erroneous output according to the principle of the minority obeying the majority. At this point, the agent sends the results to the previous level. After the upper-level PBFT vote, the agent node is exposed and the agent node is set as an ordinary node and does not participate in voting. The fault tolerance of the system in this case is:

\[\text{Fault tolerance}=(\frac{n}{k}-1)/3 \tag{18}\]

#### 3.7.2 An Agent Node is a Faulty Node

The agents may be faulty nodes, it can be seen in Figure 6. In this case, the faulty agent node will affect all the nodes in the area, thereby resulting in the voting results of the area being incorrect. If the agent nodes are faulty in more than one-third of the total area, the system crashes. In this case, the fault tolerance of the system is:

\[\text{Fault tolerance}=(\frac{n}{k}-1)/3 \tag{19}\]

According to the above analysis, if the faulty nodes are evenly distributed, the fault-tolerance performance of the system is not changed. If a faulty node is an agent node, the system's fault tolerance performance is reduced. To improve the fault tolerance, we have limited the choice of agent nodes. To ensure the security of the system and improve the fault tolerance, the choice of agent is very important. For example, if an agent is a malicious node, all the nodes for which this agent is responsible can be viewed as faulty. As a result, it will substantially reduce the security of the system. Therefore, in our system, the choice of agent is changed periodically. When a new node joins or the view changes, the system reselects the agent node, runs a dynamic spanning-tree algorithm, and sets up new agent nodes. At the same time, a reputation mechanism is added to the system. If a node is found to be a malicious node, the node will be punished, the reputation value of the node will be halved, and it will be blocked from participating in the next round of voting. The incorporation of the reputation mechanism can effectively prevent the emergence of faulty agents. ## 4 Experiments

In this section, we have conducted experiments on traffic simulation, latency and throughput in permissioned blockchain. Our experiments are conducted in wide area network (WAN). Each node runs SDMA-PBFT algorithms, and the permissioned blockchain system is BHchain, which is developed by our team. The bandwidth can reach 1000 Mb/s in the laboratory environment and 100 Mb/s in WAN. The nodes of a blockchain system use the desktop to run the algorithm, which is configured under the main frequency of 3.6 Ghz with two cores, and the RAM is 4 GB. ### Traffic Simulation

Traffic is an important indicator of system performance. The more messages a system broadcasts or multicasts, the longer it takes. Therefore, to improve the performance of the system, reducing traffic is an option. Figure 6: When the agents are faulty nodes.