Re: Inconsistent Private Data Collection Write operation


Senthil Nathan
 

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')" }

  1. As the memberOnlyWrite is set to false by default (not configured in the collection config as well), all peers are authorized to write if it can satisfy the endorsement policy.
  2. Is the endorsement policy syntax correct for your scenario? Shouldn't it be "OR('Org1MSP.member', 'Org2MSP.member')" if you want to allow either of the organization to write to the collection?
Regards,
Senthil


On Fri, Jun 19, 2020 at 3:54 PM Hritik Gupta <hritikgupta9@...> wrote:
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.