Reputation: 3
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
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.
You or client application to be more specific have to send your transaction to peers such that it will satisfy chaincode endorsement policy.
Endorsing peer will simulate transaction execution and return results in form of RWSet + signature over RWSet hash to the client.
Client gather all signatures concatenate it with RWset result and submits it to the ordering service
Ordering service collects many transactions which committed by different clients and once in a while cut the block.
Block delivered to the leader peers and being distributed across all peers in the channel.
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.
Once transactions are validated block is eventually committed to the ledger.
Upvotes: 1
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