Blockchain Lab (28) - Byzantine node hijacking blockchain simulation

Simulate Byzantine nodes attacking the blockchain network in the previous FISCO environment. The environment has a total of 100 nodes, using PBFT as the consensus mechanism, and the node numbers are: Node0, Node,..., Node99. The first 2010 blocks of these 100 nodes are exactly the same, and they started to fork from block 2011.

(1) 1 Byzantine node: Node0

The block length of Node0 is 2020, and the block length of Node1 - Node99 is 2030.

When a transaction is initiated on Node0, the Node0 block synchronization fails.

Insert image description here

The transaction is successful on other nodes and the block synchronization is successful.

Insert image description here

This shows that Node0 among 100 nodes was abandoned, but 99 nodes can still achieve PBFT consensus success.

In turn, the same transaction is initiated on the Node99 node and succeeds.

Insert image description here

However, the block of Node0 node was not updated and the node was abandoned.

Insert image description here

(2) 33 Byzantine nodes: Node0 – Node32

Node0 – Node32 block length 2020, Node33 – Node99 block length 2030

A transaction was initiated on Node0. The transaction failed and the block length did not change.

Insert image description here

The block length of Node99 node has also not changed, indicating that the transaction failed.

Insert image description here

In turn, the same transaction initiated on the Node99 node also failed.

Insert image description here

The block length of Node0 node has not changed, and the transaction completely failed.

Insert image description here

At this time, the entire blockchain loses its consensus capability.

(3) 32 Byzantine nodes: Node0 – Node31

Node0 – Node31 block length 2020, Node32 – Node99 block length 2030

When a transaction is initiated on Node0, the block length of Node0 remains unchanged.

Insert image description here

But on Node99, the block length is increased by 1, indicating that the transaction is successful.

Insert image description here

Similarly, if a transaction is initiated on Node99, the transaction is successful, and the block length is increased by 1.

Insert image description here

However, the block length of Node0 node has not changed.

Insert image description here

At this time, the entire blockchain still has consensus capabilities. Conclusion: In the FISCO environment, the condition for PBFT consensus is N>3f+1, where N is the total number of nodes and f is the number of Byzantine nodes.

Guess you like

Origin blog.csdn.net/qq_18807043/article/details/134852984