In the PBFT consensus algorithm,
- Consensus nodes take turns out of blocks ,
- There is only one leader packing block in each round of consensus ,
- The leader index is calculated by a formula .
(block_number + current_view) % consensus_node_num
After the node calculates that the current leader index is the same as its own index, it starts to pack the block.
The block packing is mainly completed by the PBFTSealer thread. The main work of the Sealer thread is shown in the following figure:
https://www.bookstack.cn/read/fisco-bcos-v2.0/a740cf9a9be89bd7.md