Skip to content

Commit

Permalink
[FAB-1940] Split configuration.proto
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Jason Yellick committed Jan 30, 2017
1 parent 36bbeb6 commit 0122a04
Show file tree
Hide file tree
Showing 10 changed files with 629 additions and 517 deletions.
6 changes: 3 additions & 3 deletions orderer/sbft/simplebft/simplebft.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions protos/common/common.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

193 changes: 193 additions & 0 deletions protos/common/configtx.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 85 additions & 0 deletions protos/common/configtx.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
Copyright IBM Corp. 2017 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// XXX This is the older mechanism for specifying channel configuration
// it is intended to be removed once there is no more dependency on it.

syntax = "proto3";

import "common/common.proto";

option go_package = "github.com/hyperledger/fabric/protos/common";

package common;

// ConfigurationEnvelope is designed to contain _all_ configuration for a chain with no dependency
// on previous configuration transactions.
//
// It is generated with the following scheme:
// 1. Retrieve the existing configuration
// 2. Note the highest configuration sequence number, store it and increment it by one
// 3. Modify desired ConfigurationItems, setting each LastModified to the stored and incremented sequence number
// a) Note that the ConfigurationItem has a ChainHeader header attached to it, who's type is set to CONFIGURATION_ITEM
// 4. Update SignedConfigurationItem with appropriate signatures over the modified ConfigurationItem
// a) Each signature is of type ConfigurationSignature
// b) The ConfigurationSignature signature is over the concatenation of signatureHeader and the ConfigurationItem bytes (which includes a ChainHeader)
// 5. Submit new Configuration for ordering in Envelope signed by submitter
// a) The Envelope Payload has data set to the marshaled ConfigurationEnvelope
// b) The Envelope Payload has a header of type Header.Type.CONFIGURATION_TRANSACTION
//
// The configuration manager will verify:
// 1. All configuration items and the envelope refer to the correct chain
// 2. Some configuration item has been added or modified
// 3. No existing configuration item has been ommitted
// 4. All configuration changes have a LastModification of one more than the last configuration's highest LastModification number
// 5. All configuration changes satisfy the corresponding modification policy
message ConfigurationEnvelope {
repeated SignedConfigurationItem Items = 1;
}

// ConfigurationTemplate is used as a serialization format to share configuration templates
// The orderer supplies a configuration template to the user to use when constructing a new
// chain creation transaction, so this is used to facilitate that.
message ConfigurationTemplate {
repeated ConfigurationItem Items = 1;
}

// This message may change slightly depending on the finalization of signature schemes for transactions
message SignedConfigurationItem {
bytes ConfigurationItem = 1;
repeated ConfigurationSignature Signatures = 2;
}

message ConfigurationItem {
enum ConfigurationType {
Policy = 0; // Implies that the Value is a marshaled Policy message, and may be referred to by Key as a ModificationPolicy
Chain = 1; // Marshaled format for this type is yet to be determined
Orderer = 2; // Marshaled format for this type is yet to be determined
Peer = 3; // Marshaled format for this type is yet to be determined
MSP = 4; // Marshaled MSPConfig proto
}
ChainHeader Header = 1; // The header which ties this configuration to a particular chain
ConfigurationType Type = 2; // The type of configuration this is.
uint64 LastModified = 3; // The Sequence number in the ConfigurationEnvelope this item was last modified
string ModificationPolicy = 4; // What policy to check before allowing modification
string Key = 5; // A unique ID, unique scoped by Type, to reference the value by
bytes Value = 6; // The byte representation of this configuration, usually a marshaled message
}

message ConfigurationSignature {
bytes signatureHeader = 1; // A marshaled SignatureHeader
bytes signature = 2; // Signature over the concatenation of configurationItem bytes and signatureHeader bytes
}
Loading

0 comments on commit 0122a04

Please sign in to comment.