Skip to content

Commit 0122a04

Browse files
author
Jason Yellick
committed
[FAB-1940] Split configuration.proto
https://jira.hyperledger.org/browse/FAB-1940 Configuration.proto has become a bit of a kitchen sink, including chain config item definitions, configuration tx definitions, and policy definitions. This CR splits them into three separate protos. Change-Id: I98caf846f9d2f0c3e293b637d8f84bd07f1ce3f2 Signed-off-by: Jason Yellick <[email protected]>
1 parent 36bbeb6 commit 0122a04

10 files changed

+629
-517
lines changed

orderer/sbft/simplebft/simplebft.pb.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/common.pb.go

+5-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/configtx.pb.go

+193
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/configtx.proto

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
Copyright IBM Corp. 2017 All Rights Reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// XXX This is the older mechanism for specifying channel configuration
18+
// it is intended to be removed once there is no more dependency on it.
19+
20+
syntax = "proto3";
21+
22+
import "common/common.proto";
23+
24+
option go_package = "github.com/hyperledger/fabric/protos/common";
25+
26+
package common;
27+
28+
// ConfigurationEnvelope is designed to contain _all_ configuration for a chain with no dependency
29+
// on previous configuration transactions.
30+
//
31+
// It is generated with the following scheme:
32+
// 1. Retrieve the existing configuration
33+
// 2. Note the highest configuration sequence number, store it and increment it by one
34+
// 3. Modify desired ConfigurationItems, setting each LastModified to the stored and incremented sequence number
35+
// a) Note that the ConfigurationItem has a ChainHeader header attached to it, who's type is set to CONFIGURATION_ITEM
36+
// 4. Update SignedConfigurationItem with appropriate signatures over the modified ConfigurationItem
37+
// a) Each signature is of type ConfigurationSignature
38+
// b) The ConfigurationSignature signature is over the concatenation of signatureHeader and the ConfigurationItem bytes (which includes a ChainHeader)
39+
// 5. Submit new Configuration for ordering in Envelope signed by submitter
40+
// a) The Envelope Payload has data set to the marshaled ConfigurationEnvelope
41+
// b) The Envelope Payload has a header of type Header.Type.CONFIGURATION_TRANSACTION
42+
//
43+
// The configuration manager will verify:
44+
// 1. All configuration items and the envelope refer to the correct chain
45+
// 2. Some configuration item has been added or modified
46+
// 3. No existing configuration item has been ommitted
47+
// 4. All configuration changes have a LastModification of one more than the last configuration's highest LastModification number
48+
// 5. All configuration changes satisfy the corresponding modification policy
49+
message ConfigurationEnvelope {
50+
repeated SignedConfigurationItem Items = 1;
51+
}
52+
53+
// ConfigurationTemplate is used as a serialization format to share configuration templates
54+
// The orderer supplies a configuration template to the user to use when constructing a new
55+
// chain creation transaction, so this is used to facilitate that.
56+
message ConfigurationTemplate {
57+
repeated ConfigurationItem Items = 1;
58+
}
59+
60+
// This message may change slightly depending on the finalization of signature schemes for transactions
61+
message SignedConfigurationItem {
62+
bytes ConfigurationItem = 1;
63+
repeated ConfigurationSignature Signatures = 2;
64+
}
65+
66+
message ConfigurationItem {
67+
enum ConfigurationType {
68+
Policy = 0; // Implies that the Value is a marshaled Policy message, and may be referred to by Key as a ModificationPolicy
69+
Chain = 1; // Marshaled format for this type is yet to be determined
70+
Orderer = 2; // Marshaled format for this type is yet to be determined
71+
Peer = 3; // Marshaled format for this type is yet to be determined
72+
MSP = 4; // Marshaled MSPConfig proto
73+
}
74+
ChainHeader Header = 1; // The header which ties this configuration to a particular chain
75+
ConfigurationType Type = 2; // The type of configuration this is.
76+
uint64 LastModified = 3; // The Sequence number in the ConfigurationEnvelope this item was last modified
77+
string ModificationPolicy = 4; // What policy to check before allowing modification
78+
string Key = 5; // A unique ID, unique scoped by Type, to reference the value by
79+
bytes Value = 6; // The byte representation of this configuration, usually a marshaled message
80+
}
81+
82+
message ConfigurationSignature {
83+
bytes signatureHeader = 1; // A marshaled SignatureHeader
84+
bytes signature = 2; // Signature over the concatenation of configurationItem bytes and signatureHeader bytes
85+
}

0 commit comments

Comments
 (0)