Federico Bo
Federico Bo

Reputation: 3

hyperledger transaction commit

If "As the evaluation of the endorsement policy and evaluation of version dependencies in readset are deterministic, all correct peers will also come to the same conclusion", only one peer should be sufficient to validate / commit a transaction. We have to send the transacion to all peers mostly because these peers must update their states. Is it true?

Upvotes: 0

Views: 502

Answers (2)

Artem Barger
Artem Barger

Reputation: 41222

We have to send the transacion to all peers mostly because these peers must update their states. Is it true?

I'm not 100% sure what do you mean, saying "send the transaction to all peers", but let me clarify on this.

  1. You or client application to be more specific have to send your transaction to peers such that it will satisfy chaincode endorsement policy.

  2. Endorsing peer will simulate transaction execution and return results in form of RWSet + signature over RWSet hash to the client.

  3. Client gather all signatures concatenate it with RWset result and submits it to the ordering service

  4. Ordering service collects many transactions which committed by different clients and once in a while cut the block.

  5. Block delivered to the leader peers and being distributed across all peers in the channel.

  6. Each peer independently iterates over all transactions in the block to validate two things: a) conformance with endorsement policy; b) MVCC - multivalue concurrency control, to check for concurrent modifications.

  7. Once transactions are validated block is eventually committed to the ledger.

Upvotes: 1

ChrisMcQueen
ChrisMcQueen

Reputation: 100

You are correct. You have a Distributed Ledger so all transactions must be sent to all peers (to the leader node on that peer) so they can keep an identical copy.

In Hyperledger Fabric the ordering service manages this, in production this should be Kafka.

Upvotes: 0

Related Questions