Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the issue of Nil/Zero-length-byte-array value #2310

Merged
merged 1 commit into from
Jan 25, 2021

Conversation

manish-sethi
Copy link
Contributor

Signed-off-by: manish manish.sethi@gmail.com

Type of change

  • Bug fix

Description

  • The zero length byte array value from a node chaincode reaches the fabric as is, instead of as a nil as in the case of a chaincode in golang/java. This prevents current fabric code to set the delete marker in the write-set. This patch fixes this issue.
  • During commit, the write-set that has a value nil/zero-lengh byte array is interpreted as delete.

Additional details

  • The above issue is caused by the fact that unlike golanag and java chaincode shim, the protobuf library used by node shim is not google-protobuf but protobufjs which has a different behavior for the default values.
  • Cherry-pick from PR-2305

Related issues

FAB-18386

Signed-off-by: manish <manish.sethi@gmail.com>
@manish-sethi manish-sethi requested a review from a team as a code owner January 25, 2021 16:52
@yacovm yacovm merged commit 1de0825 into hyperledger:release-2.2 Jan 25, 2021
@manish-sethi manish-sethi deleted the fab-18386-release2.2_1 branch March 8, 2021 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants