# A Hierarchical Blockchain-Based Trust Measurement Method for Drone Cluster Nodes
## 2 Trust Metric Model of Unmanned Aerial Vehicle Cluster Nodes Based on Hierarchical Blockchain
### Blockchain Data Sharing Mechanism under Resource Constraints
#### 2.3.4 Latency Analysis
Let us assume that the CPU cyclesrequired for signature verification of the prepared message are \(\delta_{3}\), and the size of the prepared message is \(\mu_{3}\). The leader node requires  
\[t_{3}{}^{\prime}=\lceil 1+2f\rceil\frac{\delta_{3}}{f_{i}}+\frac{\mu_{3}}{u_{i}}, \tag{14}\]  
where \(f_{i}\) represents the CPU speed of the leader node and \(u_{i}\) represents the network bandwidth of the leader node. On the other hand, the slave nodes need to validate the signature on the received message from the leader node, generate their own prepared message, and multicast it to other secondary nodes. Therefore, they require  
\[t_{3}{}^{\prime\prime}=\frac{\delta_{2}}{f_{i,m}^{\text{evr}}}+2\frac{\mu_{2}} {u_{i,m}}+\lceil 1+2f\rceil\frac{\delta_{3}}{f_{i}}+\frac{\mu_{3}}{u_{i}}. \tag{15}\]  
It should be noted that the final delay required for this step depends on the time taken by the last node to complete the task. Thus, the array \(T^{3}\) is created by arranging the time required for each node to complete the task in ascending order, giving us \(t_{3}=T_{N}^{3}\). * Commit: In the commit phase, all nodes verify the integrity of the content. Slave nodes also verify if the content block is from the block-producing node. After verification, each node sends confirmation messages to other nodes. When a node receives \(2f\) confirmation messages, it knows that the data are correct and proceeds to the next step. * Latency Analysis: In the commit phase, all nodes need to verify the integrity of the block content, sign it, and multicast the commit message to each slave node. Slave nodes also need to verify the signature of the block-producing node. Let \(\delta_{4}\) represent the CPU cycles required for verifying the integrity, \(\delta_{5}\) represent the CPU cycles required for signing and verifying the commit message, \(\mu_{4}\) represent the size of unloaded information, and \(\mu_{5}\) represent the size of the broadcast message. The latency for the leader node can be calculated as \[t_{4}{}^{\prime}=\frac{\delta_{4}}{f_{i,m}^{\text{evr}}}+2\frac{\mu_{4}}{u_{i, m}}+\lceil 1+2f\rceil\frac{\delta_{5}}{f_{i}}+\frac{\mu_{5}}{u_{i}}.\] (16) The latency for slave nodes can be calculated as \[t_{4}{}^{\prime\prime}=\frac{\delta_{1}+\delta_{4}}{f_{i,m}^{\text{evr}}}+2 \frac{\mu_{4}}{u_{i,m}}+\lceil 1+2f\rceil\frac{\delta_{5}}{f_{i}}+\frac{\mu_{5}}{u_{ i}}.\] (17) Similarly, the array \(T^{4}\) contains the time required for each node to complete the task, sorted in ascending order as \(t_{4}=T_{N}^{4}\). * Reply: All nodes send their signed commit messages to the blockchain, where the data becomes a pending transaction awaiting inclusion in a new block. * Latency Analysis: In the reply phase, all nodes include their signatures in the reply messages and send them to the blockchain. The time required for each node to complete this task can be represented as \[t_{5}{}^{\prime}=\frac{\delta_{6}}{f_{i}}+\frac{\mu_{6}}{u_{i}}.\] (18) By arranging the completion times of all nodes in ascending order, we obtain an array \(T^{5}\), and the final latency, denoted as \(t_{5}=T_{N}^{5}\). The total block generation time of the PBFT consensus within a drone cluster is calculated as  
\[f_{m}^{max}=\sum_{i=1}^{i}f_{i,m}^{ver}. \tag{10}\]0Therefore, the optimization problem can be formulated as  
\[f_{m}^{max}=\sum_{i=1}^{i}f_{i,m}^{ver}. \tag{10}\]1 \[f_{m}^{max}=\sum_{i=1}^{i}f_{i,m}^{ver}. \tag{10}\]2 (20a) \[f_{m}^{max}=\sum_{i=1}^{i}f_{i,m}^{ver}. \tag{10}\]3 (20b) \[f_{m}^{max}=\sum_{i=1}^{i}f_{i,m}^{ver}. \tag{10}\]4 (20c) \[f_{m}^{max}=\sum_{i=1}^{i}f_{i,m}^{ver}. \tag{10}\]5  
where Equations (20a) and (20b) represent that the total bandwidth consumption of all offloaded tasks in cluster head node \(m\) does not exceed \(B_{m}\), Equation (20c) represents the computational resource constraint of the cluster head node, and Equation (20d) ensures that the allocated resources for PBFT verification tasks do not exceed the total CPU resources of cluster head node \(m\).