Search code examples
hyperledger-fabricblockchainhyperledgerraft

Hyperledger Fabric with Raft Protocol: How are transactions packaged into Blocks?


So I do understand the concept of the Raft Protocol.
But I struggle with it in the use case of a Hyperledger Fabric Ordering Service.

What I understand so far:
When a transaction is proposed and endorsed by peers the application forwards it to the ordering service. The Raft Leader-Node receives this transaction and writes it to his Log then sends it to his Follower-Nodes that also update their Logs.

What I don't understand:

  • Where and how are the blocks created?
  • Do all Nodes create a Block and check if a majority has the same?

I read somewhere that a Blockcutter-method is invoked by the Leader and the resulting Block is then proposed to the local Raft Finite State Machine (what is this?).


Solution

  • It's too wasteful to do a consensus round for each transaction. Instead, the Raft leader aggregates several transactions into a batch, and then creates a block from that batch, using a block cutter object.

    Then, the Raft leader initiates a consensus round to make the block be replicated to all followers via the Raft protocol.