hyperledger-fabrichyperledger

Does Hyperledger Fabric Gateway Service send a transaction to an orderer if there were not enough endorsement approvals from other peers collected?


Starting from Hyperledger Fabric v2.4 there is a Gateway Service. It helps to make transaction flow more easy for the client. So the client doesn't need to collect endorsements manually. But the question is what algorithm is used there.

By default does Hyperledger Fabric Gateway send a transaction to an orderer if an endorser peer hasn't collected enough endorsement approvals from other peers?

If it doesn't send, then is there a way for other organizations in the network to find out that such invalid transaction took place?

Documentation doesn't seem to have direct answer.


Solution

  • The approach the Gateway service uses to gather endorsements for a transaction proposal during an Endorse call is documented in the Fabric documentation. There is a overview of the interaction between application client and the Gateway service for transaction submit here, which consists of Endorse, Submit and CommitStatus calls.

    If it is not possible to gather sufficient endorsements to satisfy the effective endorsement policy for a given transaction invocation, the Gateway service will return an error from the Endorse call, and the client API will surface this as an endorse error (Go, Node, Java). The client will then not make a subsequent Submit call. It is the Submit step where the endorsed transaction is sent to the orderer to be included in a block. In short, if insufficient endorsements are gathered, nothing will be sent to the orderer and nothing will be recorded on the blockchain.

    The only knowledge of the failed endorsement within the Fabric network will be at the Gateway service and at any peers that were invoked to endorse the transaction proposal. Some information should be captured in the logs of each of these participating nodes.