hyperledger / fabric

Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.
https://wiki.hyperledger.org/display/fabric
Apache License 2.0
15.74k stars 8.85k forks source link

GetStateValidationParameter unexpected empty #3332

Open davidkhala opened 2 years ago

davidkhala commented 2 years ago

fabric 2.4

The scenario

  1. Prepare policy bytes by
    var policy = ext.NewKeyEndorsementPolicy(nil)
    policy.AddOrgs(msp.MSPRole_MEMBER, MSPIDs...)
  2. SetStateValidationParameter with key a and policyBytes. I also did a double check here
  3. After block commit is completed, I query on GetStateValidationParameter.
  4. The result of GetStateValidationParameter is surprisingly empty.

In my first round test I submit and query via new fabric-gateway endpoint. So I suspect if it is issue from new gateway. But in second round test, even in tranditional way (specifying endorsing peers, eventing peers, orderer), this issue can be reproduced.

rajat-dlt commented 1 year ago

Even I've faced this issue, Are there any workarounds for this? I need to set endorsement on a key. The documentation regarding this is also not sufficient, this is not clear that the endorsements we set for a chaincode should always be of lesser degree than the chaincode level endorsements or that this is not the case.