Inconsistent Private Data Collection Write operation


Hritik Gupta <hritikgupta9@...>
 

Hi all,

I have a fabric 2.0 network with 2 orgs having 1 peer each (similar to test-network). I implemented a private data collection that persists in the off-chain DB of the peer of one of the orgs (Org1, as shown below)
"name": "collectionMarblePrivateDetails", 
"policy": "OR('Org1MSP.member')", 
"requiredPeerCount": 0, 
"maxPeerCount": 3, 
"blockToLive": 0, 
"memberOnlyRead": true, 
"endorsementPolicy": { "signaturePolicy": "OR('Org1MSP.member')" } 
}
I tried to change the value of the key in the private collection by invoking the relevant chaincode method from : (I'm using the submitTransaction method from the Contract class of fabric node-sdk) 
1) an authorized peer
2) an unauthorized peer after making the following change to the collection endorsement policy:
"endorsementPolicy": { "signaturePolicy": "OR('Org1MSP.member'), OR('Org2MSP.member')" } 

Although the above 2 operations work sometimes, but very inconsistently. It fails by giving the following endorsement policy error:

2020-06-19T10:01:19.660Z - warn: [TransactionEventHandler]: strategyFail: commit failure for transaction "8a06bccc8afd555efb4c1a70ac0ce1905c17f135061ca1ec525d760c0101118d": Error: Commit of transaction 8a06bccc8afd555efb4c1a70ac0ce1905c17f135061ca1ec525d760c0101118d failed on peer peer0.org1.example.com:7051 with status ENDORSEMENT_POLICY_FAILURE
Failed to submit transaction: Error: Commit of transaction 8a06bccc8afd555efb4c1a70ac0ce1905c17f135061ca1ec525d760c0101118d failed on peer peer0.org1.example.com:7051 with status ENDORSEMENT_POLICY_FAILURE

The logs from the peer docker containers are as follows:
2020-06-19 10:01:14.584 UTC [committer.txvalidator] validateTx -> ERRO 0f2 Dispatch for transaction txId = 16c33a328f40e579577c1767b0b55054cf903c328cf1a236f1da0aafb1762099 returned error: validation of endorsement policy for chaincode fabcar in tx 15:0 failed: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 2 of the 'Endorsement' sub-policies to be satisfied

Although, aforementioned methods are able to change the key-value in the private collection if executed successfully, it fails a lot many number of times too. I'm not sure why that happens.
Appreciate any help!

Thanks and regards.


--

Hritik Gupta

B.Tech, Computer Science and Engineering

Indian Institute of Technology

Mandi, Himachal Pradesh – 175005

+91-7838869482 | b16097@...


Join fabric@lists.hyperledger.org to automatically receive all group messages.