-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-2931] CC instantiation tx validation
This change adds checks that evaluate the chaincode instantiation policy from the chaincode package against the instantiation/upgrade proposal submitter at instantiation/upgrade endorsement time. For instantiate, the instantiation policy is fetched from the cc package on disk. In addition, the instantiation policy is added to the ChaincodeData struct, which is written to the LSCC state. This is necessary to have the policy available for a subsequent chaincode upgrade. On chaincode upgrade, the submitter is evaluated against the instantiation policy of the currently instantiated chaincode. Next, the submitter is evaluated against the instantiation policy of the new chaincode. If both checks pass, the instantiation policy of the new chaincode replaces the previous instantiation policy. Unit tests for instantiate and upgrade are implemented as part of the LSCC tests. To test manually on a runnning system, use the CLI to package, sign, install, instantiate and upgrade chaincode with instantiation policies. A simple example of an instantiation policy for the sample config is: "OR('DEFAULT.member', 'DEFAULT.admin')" Change-Id: I975de7dfa8cc28816b2ea270900b08abb51bb9ef Signed-off-by: Matthias Neugschwandtner <eug@zurich.ibm.com>
- Loading branch information
Matthias Neugschwandtner
committed
Apr 25, 2017
1 parent
8ce1073
commit bb071c5
Showing
4 changed files
with
387 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.