diff --git a/common/config/api.go b/common/config/api.go new file mode 100644 index 00000000000..c3bfaa7ec7f --- /dev/null +++ b/common/config/api.go @@ -0,0 +1,28 @@ +/* +Copyright IBM Corp. 2017 All Rights Reserved. + +SPDX-License-Identifier: Apache-2.0 +*/ +package config + +import ( + cb "github.com/hyperledger/fabric/protos/common" +) + +// Config encapsulates config (channel or resource) tree +type Config interface { + // ConfigProto returns the current config + ConfigProto() *cb.Config + + // ProposeConfigUpdate attempts to validate a new configtx against the current config state + ProposeConfigUpdate(configtx *cb.Envelope) (*cb.ConfigEnvelope, error) +} + +// Manager provides access to the resource config +type Manager interface { + // GetChannelConfig defines methods that are related to channel configuration + GetChannelConfig(channel string) Config + + // GetResourceConfig defines methods that are related to resource configuration + GetResourceConfig(channel string) Config +} diff --git a/core/aclmgmt/aclmgmt.go b/core/aclmgmt/aclmgmt.go index 3b1edc3b63f..f9574fe8816 100644 --- a/core/aclmgmt/aclmgmt.go +++ b/core/aclmgmt/aclmgmt.go @@ -42,9 +42,11 @@ const ( QSCC_GetBlockByTxID = "QSCC.GetBlockByTxID" //CSCC resources - CSCC_JoinChain = "CSCC.JoinChain" - CSCC_GetConfigBlock = "CSCC.GetConfigBlock" - CSCC_GetChannels = "CSCC.GetChannels" + CSCC_JoinChain = "CSCC.JoinChain" + CSCC_GetConfigBlock = "CSCC.GetConfigBlock" + CSCC_GetChannels = "CSCC.GetChannels" + CSCC_GetConfigTree = "CSCC.GetConfigTree" + CSCC_SimulateConfigTreeUpdate = "CSCC.SimulateConfigTreeUpdate" //Chaincode-to-Chaincode call CC2CC = "CC2CC" diff --git a/core/aclmgmt/defaultaclprovider.go b/core/aclmgmt/defaultaclprovider.go index 0680ed3cd28..afba61073a8 100644 --- a/core/aclmgmt/defaultaclprovider.go +++ b/core/aclmgmt/defaultaclprovider.go @@ -81,6 +81,8 @@ func (d *defaultACLProvider) initialize() { //c resources d.cResourcePolicyMap[CSCC_GetConfigBlock] = CHANNELREADERS + d.cResourcePolicyMap[CSCC_GetConfigTree] = CHANNELREADERS + d.cResourcePolicyMap[CSCC_SimulateConfigTreeUpdate] = CHANNELWRITERS //---------------- non-scc resources ------------ //Propose diff --git a/core/peer/peer.go b/core/peer/peer.go index 6f91bbf4477..fca7d50aaeb 100644 --- a/core/peer/peer.go +++ b/core/peer/peer.go @@ -15,6 +15,7 @@ import ( "github.com/hyperledger/fabric/core/ledger/customtx" "github.com/hyperledger/fabric/common/channelconfig" + cc "github.com/hyperledger/fabric/common/config" "github.com/hyperledger/fabric/common/configtx" configtxtest "github.com/hyperledger/fabric/common/configtx/test" "github.com/hyperledger/fabric/common/deliver" @@ -738,3 +739,41 @@ func (flbs fileLedgerBlockStore) AddBlock(*common.Block) error { func (flbs fileLedgerBlockStore) RetrieveBlocks(startBlockNumber uint64) (commonledger.ResultsIterator, error) { return flbs.GetBlocksIterator(startBlockNumber) } + +// NewResourceConfigSupport returns +func NewConfigSupport() cc.Manager { + return &configSupport{} +} + +type configSupport struct { +} + +// GetChannelConfig returns an instance of a object that represents +// current channel configuration tree of the specified channel. The +// ConfigProto method of the returned object can be used to get the +// proto representing the channel configuration. +func (*configSupport) GetChannelConfig(channel string) cc.Config { + chains.RLock() + defer chains.RUnlock() + chain := chains.list[channel] + if chain == nil { + peerLogger.Error("GetChannelConfig: channel", channel, "not found in the list of channels associated with this peer") + return nil + } + return chain.cs.bundleSource.ChannelConfig().ConfigtxValidator() +} + +// GetResourceConfig returns an instance of a object that represents +// current resource configuration tree of the specified channel. The +// ConfigProto method of the returned object can be used to get the +// proto representing the resource configuration. +func (*configSupport) GetResourceConfig(channel string) cc.Config { + chains.RLock() + defer chains.RUnlock() + chain := chains.list[channel] + if chain == nil { + peerLogger.Error("GetResourceConfig: channel", channel, "not found in the list of channels associated with this peer") + return nil + } + return chain.cs.bundleSource.ConfigtxValidator() +} diff --git a/core/peer/peer_test.go b/core/peer/peer_test.go index b3a9bd36e7e..f0eaf98b61d 100644 --- a/core/peer/peer_test.go +++ b/core/peer/peer_test.go @@ -159,6 +159,13 @@ func TestCreateChainFromBlock(t *testing.T) { t.Fatalf("failed to get correct block") } + cfgSupport := configSupport{} + chCfg := cfgSupport.GetChannelConfig(testChainID) + assert.NotNil(t, chCfg, "failed to get channel config") + + resCfg := cfgSupport.GetResourceConfig(testChainID) + assert.NotNil(t, resCfg, "failed to get resource config") + // Bad block block = GetCurrConfigBlock("BogusBlock") if block != nil { diff --git a/core/scc/cscc/configure.go b/core/scc/cscc/configure.go index 15397536caf..faf7894e774 100644 --- a/core/scc/cscc/configure.go +++ b/core/scc/cscc/configure.go @@ -22,11 +22,11 @@ limitations under the License. package cscc import ( - "errors" "fmt" "github.com/golang/protobuf/proto" "github.com/hyperledger/fabric/common/channelconfig" + "github.com/hyperledger/fabric/common/config" "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/core/aclmgmt" "github.com/hyperledger/fabric/core/chaincode/shim" @@ -37,6 +37,7 @@ import ( "github.com/hyperledger/fabric/protos/common" pb "github.com/hyperledger/fabric/protos/peer" "github.com/hyperledger/fabric/protos/utils" + "github.com/pkg/errors" ) // PeerConfiger implements the configuration handler for the peer. For every @@ -44,15 +45,18 @@ import ( // committer calls this system chaincode to process the transaction. type PeerConfiger struct { policyChecker policy.PolicyChecker + configMgr config.Manager } var cnflogger = flogging.MustGetLogger("cscc") // These are function names from Invoke first parameter const ( - JoinChain string = "JoinChain" - GetConfigBlock string = "GetConfigBlock" - GetChannels string = "GetChannels" + JoinChain string = "JoinChain" + GetConfigBlock string = "GetConfigBlock" + GetChannels string = "GetChannels" + GetConfigTree string = "GetConfigTree" + SimulateConfigTreeUpdate string = "SimulateConfigTreeUpdate" ) // Init is called once per chain when the chain is created. @@ -67,7 +71,7 @@ func (e *PeerConfiger) Init(stub shim.ChaincodeStubInterface) pb.Response { mgmt.GetLocalMSP(), mgmt.NewLocalMSPPrincipalGetter(), ) - + e.configMgr = peer.NewConfigSupport() return shim.Success(nil) } @@ -140,6 +144,19 @@ func (e *PeerConfiger) Invoke(stub shim.ChaincodeStubInterface) pb.Response { } return getConfigBlock(args[1]) + case GetConfigTree: + // 2. check policy + if err = aclmgmt.GetACLProvider().CheckACL(aclmgmt.CSCC_GetConfigTree, string(args[1]), sp); err != nil { + return shim.Error(fmt.Sprintf("\"GetConfigTree\" request failed authorization check for channel [%s]: [%s]", args[1], err)) + } + + return e.getConfigTree(args[1]) + case SimulateConfigTreeUpdate: + // Check policy + if err = aclmgmt.GetACLProvider().CheckACL(aclmgmt.CSCC_SimulateConfigTreeUpdate, string(args[1]), sp); err != nil { + return shim.Error(fmt.Sprintf("\"SimulateConfigTreeUpdate\" request failed authorization check for channel [%s]: [%s]", args[1], err)) + } + return e.simulateConfigTreeUpdate(args[1], args[2]) case GetChannels: // 2. check local MSP Members policy // TODO: move to ACLProvider once it will support chainless ACLs @@ -157,13 +174,13 @@ func (e *PeerConfiger) Invoke(stub shim.ChaincodeStubInterface) pb.Response { func validateConfigBlock(block *common.Block) error { envelopeConfig, err := utils.ExtractEnvelope(block, 0) if err != nil { - return errors.New(fmt.Sprintf("Failed to %s", err)) + return errors.Errorf("Failed to %s", err) } configEnv := &common.ConfigEnvelope{} _, err = utils.UnmarshalEnvelopeOfType(envelopeConfig, common.HeaderType_CONFIG, configEnv) if err != nil { - return errors.New(fmt.Sprintf("Bad configuration envelope: %s", err)) + return errors.Errorf("Bad configuration envelope: %s", err) } if configEnv.Config == nil { @@ -180,8 +197,8 @@ func validateConfigBlock(block *common.Block) error { _, exists := configEnv.Config.ChannelGroup.Groups[channelconfig.ApplicationGroupKey] if !exists { - return errors.New(fmt.Sprintf("Invalid configuration block, missing %s "+ - "configuration group", channelconfig.ApplicationGroupKey)) + return errors.Errorf("Invalid configuration block, missing %s "+ + "configuration group", channelconfig.ApplicationGroupKey) } return nil @@ -227,6 +244,72 @@ func getConfigBlock(chainID []byte) pb.Response { return shim.Success(blockBytes) } +// getConfigTree returns the current channel and resources configuration for the specified chainID. +// If the peer doesn't belong to the chain, returns error +func (e *PeerConfiger) getConfigTree(chainID []byte) pb.Response { + if chainID == nil { + return shim.Error("Chain ID must not be nil") + } + channelCfg := e.configMgr.GetChannelConfig(string(chainID)).ConfigProto() + if channelCfg == nil { + return shim.Error(fmt.Sprintf("Unknown chain ID, %s", string(chainID))) + } + resCfg := e.configMgr.GetResourceConfig(string(chainID)).ConfigProto() + if resCfg == nil { + return shim.Error(fmt.Sprintf("Unknown chain ID, %s", string(chainID))) + } + agCfg := &pb.ConfigTree{ChannelConfig: channelCfg, ResourcesConfig: resCfg} + configBytes, err := utils.Marshal(agCfg) + if err != nil { + return shim.Error(err.Error()) + } + return shim.Success(configBytes) +} + +func (e *PeerConfiger) simulateConfigTreeUpdate(chainID []byte, envb []byte) pb.Response { + if chainID == nil { + return shim.Error("Chain ID must not be nil") + } + if envb == nil { + return shim.Error("Config delta bytes must not be nil") + } + env := &common.Envelope{} + err := proto.Unmarshal(envb, env) + if err != nil { + return shim.Error(err.Error()) + } + cfg, err := supportByType(e, chainID, env) + if err != nil { + return shim.Error(err.Error()) + } + _, err = cfg.ProposeConfigUpdate(env) + if err != nil { + return shim.Error(err.Error()) + } + return shim.Success([]byte("Simulation is successful")) +} + +func supportByType(pc *PeerConfiger, chainID []byte, env *common.Envelope) (config.Config, error) { + payload := &common.Payload{} + + if err := proto.Unmarshal(env.Payload, payload); err != nil { + return nil, errors.Errorf("failed unmarshaling payload: %v", err) + } + + channelHdr := &common.ChannelHeader{} + if err := proto.Unmarshal(payload.Header.ChannelHeader, channelHdr); err != nil { + return nil, errors.Errorf("failed unmarshaling payload header: %v", err) + } + + switch common.HeaderType(channelHdr.Type) { + case common.HeaderType_CONFIG_UPDATE: + return pc.configMgr.GetChannelConfig(string(chainID)), nil + case common.HeaderType_PEER_RESOURCE_UPDATE: + return pc.configMgr.GetResourceConfig(string(chainID)), nil + } + return nil, errors.Errorf("invalid payload header type: %d", channelHdr.Type) +} + // getChannels returns information about all channels for this peer func getChannels() pb.Response { channelInfoArray := peer.GetChannelsInfo() diff --git a/peer/channel/join.go b/peer/channel/join.go index 064315452ff..7f589c02fea 100644 --- a/peer/channel/join.go +++ b/peer/channel/join.go @@ -124,7 +124,7 @@ func executeJoin(cf *ChannelCmdFactory) (err error) { if proposalResp.Response.Status != 0 && proposalResp.Response.Status != 200 { return ProposalFailedErr(fmt.Sprintf("bad proposal response %d", proposalResp.Response.Status)) } - logger.Infof("Successfully submitted proposal to join channel '%s'", channelID) + logger.Info("Successfully submitted proposal to join channel") return nil } diff --git a/protos/common/configtx.proto b/protos/common/configtx.proto index 29f26d33f45..1f917cad972 100644 --- a/protos/common/configtx.proto +++ b/protos/common/configtx.proto @@ -112,4 +112,4 @@ message ConfigPolicy { message ConfigSignature { bytes signature_header = 1; // A marshaled SignatureHeader bytes signature = 2; // Signature over the concatenation signatureHeader bytes and config bytes -} +} \ No newline at end of file diff --git a/protos/common/configuration.proto b/protos/common/configuration.proto index 6c7bbbf29e5..2bdc8ab74b6 100644 --- a/protos/common/configuration.proto +++ b/protos/common/configuration.proto @@ -86,4 +86,4 @@ message Capabilities { // message rather than a constant, so that we may extend capabilities with other fields // if the need arises in the future. For the time being, a capability being in the // capabilities map requires that that capability be supported. -message Capability { } +message Capability { } \ No newline at end of file diff --git a/protos/peer/admin.pb.go b/protos/peer/admin.pb.go index 9cfdb4f9d13..e0f74769d2c 100644 --- a/protos/peer/admin.pb.go +++ b/protos/peer/admin.pb.go @@ -72,6 +72,7 @@ It has these top-level messages: ChaincodeValidation VSCCArgs ChaincodeEndorsement + ConfigTree SignedChaincodeDeploymentSpec SignedTransaction ProcessedTransaction diff --git a/protos/peer/resources.pb.go b/protos/peer/resources.pb.go index 776b7643e53..516531afb7b 100644 --- a/protos/peer/resources.pb.go +++ b/protos/peer/resources.pb.go @@ -6,6 +6,7 @@ package peer import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import common3 "github.com/hyperledger/fabric/protos/common" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -123,34 +124,65 @@ func (m *ChaincodeEndorsement) GetName() string { return "" } +// ConfigTree encapsulates channel and resources configuration of a channel. +// Both configurations are represented as common.Config +type ConfigTree struct { + ChannelConfig *common3.Config `protobuf:"bytes,1,opt,name=channel_config,json=channelConfig" json:"channel_config,omitempty"` + ResourcesConfig *common3.Config `protobuf:"bytes,2,opt,name=resources_config,json=resourcesConfig" json:"resources_config,omitempty"` +} + +func (m *ConfigTree) Reset() { *m = ConfigTree{} } +func (m *ConfigTree) String() string { return proto.CompactTextString(m) } +func (*ConfigTree) ProtoMessage() {} +func (*ConfigTree) Descriptor() ([]byte, []int) { return fileDescriptor10, []int{5} } + +func (m *ConfigTree) GetChannelConfig() *common3.Config { + if m != nil { + return m.ChannelConfig + } + return nil +} + +func (m *ConfigTree) GetResourcesConfig() *common3.Config { + if m != nil { + return m.ResourcesConfig + } + return nil +} + func init() { proto.RegisterType((*APIResource)(nil), "protos.APIResource") proto.RegisterType((*ChaincodeIdentifier)(nil), "protos.ChaincodeIdentifier") proto.RegisterType((*ChaincodeValidation)(nil), "protos.ChaincodeValidation") proto.RegisterType((*VSCCArgs)(nil), "protos.VSCCArgs") proto.RegisterType((*ChaincodeEndorsement)(nil), "protos.ChaincodeEndorsement") + proto.RegisterType((*ConfigTree)(nil), "protos.ConfigTree") } func init() { proto.RegisterFile("peer/resources.proto", fileDescriptor10) } var fileDescriptor10 = []byte{ - // 275 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x41, 0x4b, 0xc3, 0x40, - 0x10, 0x85, 0xa9, 0x88, 0xb6, 0x63, 0x4f, 0x6b, 0x90, 0x20, 0x08, 0x92, 0x93, 0x8a, 0x24, 0x07, - 0xfd, 0x01, 0xd6, 0xd0, 0x43, 0x4f, 0x96, 0x08, 0x3d, 0x78, 0x29, 0x9b, 0x64, 0x92, 0x2c, 0x24, - 0x3b, 0x61, 0x36, 0x11, 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 0x69, 0xc2, 0x21, 0xe5, 0xaf, - 0xc7, 0x52, 0x75, 0x55, 0x9f, 0x86, 0x19, 0x35, 0xd1, 0x04, 0x8d, 0x1c, 0x1a, 0x39, 0x34, 0x1a, - 0xd0, 0xd4, 0x7d, 0xc0, 0xcb, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x56, 0x6e, 0xf4, 0x9f, - 0x01, 0x00, 0x00, + // 342 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0x4b, 0x4b, 0xeb, 0x40, + 0x14, 0xc7, 0x69, 0xb9, 0xdc, 0xdb, 0x9e, 0xf6, 0x56, 0x19, 0xab, 0x94, 0x82, 0x20, 0x59, 0xa9, + 0x48, 0x02, 0x3e, 0x16, 0xee, 0xac, 0xa1, 0x8b, 0xae, 0x2c, 0x51, 0xba, 0x70, 0x53, 0xa6, 0x93, + 0x93, 0x64, 0x20, 0x99, 0x09, 0x67, 0x52, 0xb1, 0x1b, 0x3f, 0xbb, 0x64, 0xa6, 0x8d, 0x05, 0xbb, + 0xca, 0x79, 0xfc, 0xce, 0x3f, 0xe7, 0x31, 0x30, 0x2c, 0x11, 0x29, 0x20, 0x34, 0x7a, 0x4d, 0x02, + 0x8d, 0x5f, 0x92, 0xae, 0x34, 0xfb, 0x6b, 0x3f, 0x66, 0x7c, 0x2a, 0x74, 0x51, 0x68, 0x15, 0x08, + 0xad, 0x12, 0x99, 0x56, 0x9f, 0x2e, 0xed, 0xdd, 0x40, 0x6f, 0x32, 0x9f, 0x45, 0xdb, 0x22, 0x76, + 0x0e, 0x50, 0xea, 0x5c, 0x8a, 0xcd, 0x92, 0x30, 0x19, 0xb5, 0x2e, 0x5a, 0x97, 0xdd, 0xa8, 0xeb, + 0x22, 0x11, 0x26, 0x5e, 0x08, 0x27, 0x61, 0xc6, 0xa5, 0x12, 0x3a, 0xc6, 0x59, 0x8c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, 0xe8, 0xca, 0xbd, 0x8b, 0xbb, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x20, 0xfe, + 0xe3, 0xfb, 0x36, 0x02, 0x00, 0x00, } diff --git a/protos/peer/resources.proto b/protos/peer/resources.proto index ec0d4c8c67e..cdcdeb1f772 100644 --- a/protos/peer/resources.proto +++ b/protos/peer/resources.proto @@ -11,6 +11,8 @@ option go_package = "github.com/hyperledger/fabric/protos/peer"; package protos; +import "common/configtx.proto"; + // APIResource represents an API resource in the peer whose ACL is determined by the policy_ref field message APIResource { string policy_ref = 1; // The policy name to use for this API @@ -50,3 +52,10 @@ message ChaincodeEndorsement { // Eventually we may wish add an arg here, just like the ChaincodeValidation message, but // omitting now until there is a need for it. } + +// ConfigTree encapsulates channel and resources configuration of a channel. +// Both configurations are represented as common.Config +message ConfigTree { + common.Config channel_config = 1; + common.Config resources_config = 2; +} \ No newline at end of file