secure12
secure12

Reputation: 163

Hyperledger Fabric: Creating a transaction proposal

Is it possible to create transactions proposals without them committed to the blockchain? Can I have them executed/committed with another chaincode invocation?

We would like to have more sophiscated endorsement so that some transactions will be committed only if some organizations have validated the transactions. As far as I know, the endorsement procedures in Fabric only check if the read-write sets are correct, but we can't specify any additional checks the endorsers from different organizations have to do. They are just not for this purpose.

If there is a way to create uncommitted transactions, and even a way to execute them afterwards, then different organizations could take the transaction proposals as input to perform validation. After enough organizations have validated, they can execute the transaction to commit it to the blockchain.

Upvotes: 1

Views: 561

Answers (1)

Hnampk
Hnampk

Reputation: 517

In phase 3 of the Transaction flow

The application verifies the endorsing peer signatures and compares the proposal responses to determine if the proposal responses are the same. If the chaincode is only querying the ledger, the application would only inspect the query response and would typically not submit the transaction to the ordering service. If the client application intends to submit the transaction to the ordering service to update the ledger, the application determines if the specified endorsement policy has been fulfilled before submitting (i.e. did peerA and peerB both endorse). The architecture is such that even if an application chooses not to inspect responses or otherwise forwards an unendorsed transaction, the endorsement policy will still be enforced by peers and upheld at the commit validation phase.

It means that the application can keep the endorsed proposal for its own, and submit it later! But you can not use it for another chaincode invocation because each transaction has a unique txid, a unique proposal.

If you're trying to make 02 valid proposals then change the order of them before submitting to the orderer, the peer might then reject your later valid transaction at the validation phase because of the read-write sets

Upvotes: 1

Related Questions