Skip to content

Commit 7e5e955

Browse files
author
Jason Yellick
committed
[FAB-5590] Add proto fields for isolated_data
The channel creation transaction needs a way to specify additional data that is not otherwise reflected in the standard config. Still, it's desirable to specify this information in a consistent way, so it should be expressed using the same structures as the configuration. This CR introduces the notion of the 'isolated_data' field to the ConfigUpdate message. For now, the only consumer will be the RSCC seed data information, which will be set to the key rscc_seed_data and will be the bytes of a common.Config message. Because we need to be able to be able to inspect this new config message type, we need a way to differentiate channel config from resource config. Thus, this CR also introduces a 'type' field to both the Config message and the ConfigUpdate message. Change-Id: Ida6283dbeeca466aafd9bc6d027ce46e1baee0c6 Signed-off-by: Jason Yellick <jyellick@us.ibm.com>
1 parent d0c97c0 commit 7e5e955

File tree

7 files changed

+197
-74
lines changed

7 files changed

+197
-74
lines changed

protos/common/configtx.pb.go

Lines changed: 101 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/common/configtx.proto

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
/*
22
Copyright IBM Corp. 2017 All Rights Reserved.
33
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.
4+
SPDX-License-Identifier: Apache-2.0
155
*/
166

177
syntax = "proto3";
@@ -24,6 +14,13 @@ option java_package = "org.hyperledger.fabric.protos.common";
2414

2515
package common;
2616

17+
// ConfigType is an enumeration of possible types for the config. The type field in the config is
18+
// an int32 for extensibility, but this enum type should generally be used to populate it
19+
enum ConfigType {
20+
CHANNEL = 0; // The original and default configuration type, defines parameters for the operation of a channel
21+
RESOURCE = 1; // Defines a set of resource names, and their mapping to policies which restrict access to those resources
22+
}
23+
2724
// ConfigEnvelope is designed to contain _all_ configuration for a chain with no dependency
2825
// on previous configuration transactions.
2926
//
@@ -64,7 +61,8 @@ message ConfigPolicySchema {}
6461
// Config represents the config for a particular channel
6562
message Config {
6663
uint64 sequence = 1;
67-
ConfigGroup channel_group = 2;
64+
ConfigGroup channel_group = 2; // channel_group is a bad name for this, it should be changed to root when API breakage is allowed
65+
int32 type = 3;
6866
}
6967

7068
message ConfigUpdateEnvelope {
@@ -82,9 +80,11 @@ message ConfigUpdateEnvelope {
8280
// 4. Each policy is checked against the signatures from the ConfigUpdateEnvelope, any failing to verify are rejected
8381
// 5. The write_set is applied to the Config and the ConfigGroupSchema verifies that the updates were legal
8482
message ConfigUpdate {
85-
string channel_id = 1; // Which channel this config update is for
86-
ConfigGroup read_set = 2; // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set
87-
ConfigGroup write_set = 3; // WriteSet lists the portion of the config which was written, this should included updated Versions
83+
string channel_id = 1; // Which channel this config update is for
84+
ConfigGroup read_set = 2; // ReadSet explicitly lists the portion of the config which was read, this should be sparse with only Version set
85+
ConfigGroup write_set = 3; // WriteSet lists the portion of the config which was written, this should included updated Versions
86+
int32 type = 4; // The type of config this update is intended for (usually a value from ConfigType enum) , must match the type in the Config message
87+
map<string, bytes> isolated_data = 5; // Data which is not to be reflected in the resulting Config, but is still needed for some other purpose. For instance, rscc_seed_data
8888
}
8989

9090
// ConfigGroup is the hierarchical data structure for holding config

protos/peer/admin.pb.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/peer/resources.pb.go

Lines changed: 50 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/peer/resources.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright IBM Corp. All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
syntax = "proto3";
8+
9+
option java_package = "org.hyperledger.fabric.protos.peer";
10+
option go_package = "github.com/hyperledger/fabric/protos/peer";
11+
12+
package protos;
13+
14+
// Resource represents a resource in the peer whose ACL is determined by the policy_ref field
15+
message Resource {
16+
string policy_ref = 1; // The policy name to use for this resource
17+
}

0 commit comments

Comments
 (0)