diff --git a/common/chainconfig/chainconfig.go b/common/chainconfig/chainconfig.go index 5aade7a5c9d..c7506dd7949 100644 --- a/common/chainconfig/chainconfig.go +++ b/common/chainconfig/chainconfig.go @@ -30,6 +30,9 @@ import ( const ( // HashingAlgorithmKey is the cb.ConfigurationItem type key name for the HashingAlgorithm message HashingAlgorithmKey = "HashingAlgorithm" + + // BlockDataHashingStructureKey is the cb.ConfigurationItem type key name for the BlockDataHashingStructure message + BlockDataHashingStructureKey = "BlockDataHashingStructure" ) // Hashing algorithm types @@ -48,10 +51,15 @@ type Descriptor interface { // HashingAlgorithm returns the default algorithm to be used when hashing // such as computing block hashes, and CreationPolicy digests HashingAlgorithm() func(input []byte) []byte + + // BlockDataHashingStructureWidth returns the width to use when constructing the + // Merkle tree to compute the BlockData hash + BlockDatahashingStructureWidth() int } type chainConfig struct { - hashingAlgorithm func(input []byte) []byte + hashingAlgorithm func(input []byte) []byte + blockDataHashingStructureWidth uint32 } // DescriptorImpl is an implementation of Manager and configtx.ConfigHandler @@ -73,6 +81,11 @@ func (pm *DescriptorImpl) HashingAlgorithm() func(input []byte) []byte { return pm.config.hashingAlgorithm } +// BlockDataHashingStructure returns the width to use when forming the block data hashing structure +func (pm *DescriptorImpl) BlockDataHashingStructureWidth() uint32 { + return pm.config.blockDataHashingStructureWidth +} + // BeginConfig is used to start a new configuration proposal func (pm *DescriptorImpl) BeginConfig() { if pm.pendingConfig != nil { @@ -113,6 +126,17 @@ func (pm *DescriptorImpl) ProposeConfig(configItem *cb.ConfigurationItem) error default: return fmt.Errorf("Unknown hashing algorithm type: %s", hashingAlgorithm.Name) } + case BlockDataHashingStructureKey: + blockDataHashingStructure := &cb.BlockDataHashingStructure{} + if err := proto.Unmarshal(configItem.Value, blockDataHashingStructure); err != nil { + return fmt.Errorf("Unmarshaling error for BlockDataHashingStructure: %s", err) + } + + if blockDataHashingStructure.Width == 0 { + return fmt.Errorf("BlockDataHashStructure width must not be zero") + } + + pm.pendingConfig.blockDataHashingStructureWidth = blockDataHashingStructure.Width default: logger.Warningf("Uknown Chain configuration item with key %s", configItem.Key) } diff --git a/common/chainconfig/chainconfig_test.go b/common/chainconfig/chainconfig_test.go index 80e8a63d841..50a1eec7482 100644 --- a/common/chainconfig/chainconfig_test.go +++ b/common/chainconfig/chainconfig_test.go @@ -102,3 +102,46 @@ func TestHashingAlgorithm(t *testing.T) { t.Fatalf("Should have set default hashing algorithm") } } + +func TestBlockDataHashingStructure(t *testing.T) { + expectedWidth := uint32(7) + invalidMessage := + &cb.ConfigurationItem{ + Type: cb.ConfigurationItem_Chain, + Key: BlockDataHashingStructureKey, + Value: []byte("Garbage Data"), + } + invalidWidth := &cb.ConfigurationItem{ + Type: cb.ConfigurationItem_Chain, + Key: BlockDataHashingStructureKey, + Value: utils.MarshalOrPanic(&cb.BlockDataHashingStructure{Width: 0}), + } + validWidth := &cb.ConfigurationItem{ + Type: cb.ConfigurationItem_Chain, + Key: BlockDataHashingStructureKey, + Value: utils.MarshalOrPanic(&cb.BlockDataHashingStructure{Width: expectedWidth}), + } + m := NewDescriptorImpl() + m.BeginConfig() + + err := m.ProposeConfig(invalidMessage) + if err == nil { + t.Fatalf("Should have failed on invalid message") + } + + err = m.ProposeConfig(invalidWidth) + if err == nil { + t.Fatalf("Should have failed on invalid width") + } + + err = m.ProposeConfig(validWidth) + if err != nil { + t.Fatalf("Error applying valid config: %s", err) + } + + m.CommitConfig() + + if newWidth := m.BlockDataHashingStructureWidth(); newWidth != expectedWidth { + t.Fatalf("Unexpected width, got %d expected %d", newWidth, expectedWidth) + } +} diff --git a/protos/common/common.pb.go b/protos/common/common.pb.go index a8ca6b88e2e..f93d77401bd 100644 --- a/protos/common/common.pb.go +++ b/protos/common/common.pb.go @@ -32,6 +32,7 @@ It has these top-level messages: SignaturePolicyEnvelope SignaturePolicy HashingAlgorithm + BlockDataHashingStructure MSPPrincipal OrganizationUnit MSPRole diff --git a/protos/common/configuration.pb.go b/protos/common/configuration.pb.go index 25b1ba14a2e..def8eb13ba4 100644 --- a/protos/common/configuration.pb.go +++ b/protos/common/configuration.pb.go @@ -348,8 +348,8 @@ func (m *SignaturePolicy_NOutOf) GetPolicies() []*SignaturePolicy { return nil } -// HashingAlgorithm is encoded into the configuration transaction as a configuration item of type CHAIN -// with a Key of "HashingAlgorithm" as marshaled protobuf bytes +// HashingAlgorithm is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "HashingAlgorithm" and a Value of HashingAlgorithm as marshaled protobuf bytes type HashingAlgorithm struct { // Currently supported algorithms are: SHAKE256 Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` @@ -360,6 +360,19 @@ func (m *HashingAlgorithm) String() string { return proto.CompactText func (*HashingAlgorithm) ProtoMessage() {} func (*HashingAlgorithm) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} } +// BlockDataHashingStructure is encoded into the configuration transaction as a configuration item of +// type Chain with a Key of "BlockDataHashingStructure" and a Value of HashingAlgorithm as marshaled protobuf bytes +type BlockDataHashingStructure struct { + // width specifies the width of the Merkle tree to use when computing the BlockDataHash + // in order to replicate flat hashing, set this width to MAX_UINT32 + Width uint32 `protobuf:"varint,1,opt,name=width" json:"width,omitempty"` +} + +func (m *BlockDataHashingStructure) Reset() { *m = BlockDataHashingStructure{} } +func (m *BlockDataHashingStructure) String() string { return proto.CompactTextString(m) } +func (*BlockDataHashingStructure) ProtoMessage() {} +func (*BlockDataHashingStructure) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} } + func init() { proto.RegisterType((*ConfigurationEnvelope)(nil), "common.ConfigurationEnvelope") proto.RegisterType((*ConfigurationTemplate)(nil), "common.ConfigurationTemplate") @@ -371,6 +384,7 @@ func init() { proto.RegisterType((*SignaturePolicy)(nil), "common.SignaturePolicy") proto.RegisterType((*SignaturePolicy_NOutOf)(nil), "common.SignaturePolicy.NOutOf") proto.RegisterType((*HashingAlgorithm)(nil), "common.HashingAlgorithm") + proto.RegisterType((*BlockDataHashingStructure)(nil), "common.BlockDataHashingStructure") proto.RegisterEnum("common.ConfigurationItem_ConfigurationType", ConfigurationItem_ConfigurationType_name, ConfigurationItem_ConfigurationType_value) proto.RegisterEnum("common.Policy_PolicyType", Policy_PolicyType_name, Policy_PolicyType_value) } @@ -378,46 +392,48 @@ func init() { func init() { proto.RegisterFile("common/configuration.proto", fileDescriptor1) } var fileDescriptor1 = []byte{ - // 644 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x54, 0xcb, 0x6e, 0xd3, 0x40, - 0x14, 0x8d, 0xf3, 0x70, 0x9a, 0x9b, 0x40, 0xcd, 0x6d, 0x69, 0x4d, 0x54, 0x95, 0xc8, 0x0b, 0x14, - 0xa9, 0x90, 0x88, 0xb4, 0x6c, 0x41, 0x2d, 0x2a, 0xa4, 0x2a, 0x75, 0xa2, 0x49, 0x5b, 0x24, 0x36, - 0xe0, 0xc6, 0x13, 0x67, 0x24, 0xbf, 0x34, 0x76, 0x90, 0xf2, 0x05, 0xfc, 0x03, 0x9f, 0xc2, 0x8a, - 0x4f, 0x43, 0x9e, 0xb1, 0x8d, 0x93, 0x26, 0x2b, 0xdf, 0xc7, 0x39, 0xe7, 0x3e, 0xec, 0x6b, 0x68, - 0x4f, 0x03, 0xcf, 0x0b, 0xfc, 0xfe, 0x34, 0xf0, 0x67, 0xcc, 0x59, 0x70, 0x2b, 0x66, 0x81, 0xdf, - 0x0b, 0x79, 0x10, 0x07, 0xa8, 0xca, 0x5c, 0x7b, 0x2f, 0xc7, 0x24, 0x0f, 0x99, 0x6c, 0x67, 0x44, - 0x2f, 0x0a, 0xbf, 0x87, 0x9c, 0xf9, 0x53, 0x16, 0x5a, 0xae, 0xcc, 0x19, 0x26, 0x3c, 0xff, 0x58, - 0xd4, 0xbb, 0xf4, 0x7f, 0x52, 0x37, 0x08, 0x29, 0xbe, 0x83, 0xda, 0x55, 0x4c, 0xbd, 0x48, 0x57, - 0x3a,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e, 0xbc, - 0xa3, 0x8b, 0xa5, 0xec, 0x6a, 0x58, 0x22, 0x79, 0x04, 0xcf, 0xa0, 0xfa, 0x89, 0x07, 0x5e, 0xda, - 0xd6, 0xf1, 0x96, 0xb6, 0x7a, 0xe6, 0x68, 0x11, 0x8f, 0x66, 0xc3, 0x12, 0x11, 0xe8, 0xf6, 0x35, - 0xa8, 0x32, 0x82, 0x2d, 0x50, 0xcc, 0x74, 0x58, 0xc5, 0xc4, 0x53, 0xd8, 0x11, 0x04, 0x96, 0x1f, - 0xda, 0xd6, 0x41, 0x73, 0xe0, 0x85, 0x2a, 0x8f, 0xc3, 0x78, 0x05, 0xda, 0xd0, 0x8a, 0xe6, 0xcc, - 0x77, 0xce, 0x5d, 0x27, 0xe0, 0x2c, 0x9e, 0x7b, 0xc9, 0xcb, 0xf4, 0x2d, 0x4f, 0xbe, 0xcc, 0x06, - 0x11, 0xf6, 0xc5, 0x9b, 0x6f, 0x27, 0x0e, 0x8b, 0xe7, 0x8b, 0x87, 0x44, 0xba, 0x3f, 0x5f, 0x86, - 0x94, 0xbb, 0xd4, 0x76, 0x28, 0xef, 0xcf, 0xac, 0x07, 0xce, 0xa6, 0x7d, 0xf1, 0x6b, 0x8b, 0xd2, - 0x9f, 0xe0, 0x83, 0x2a, 0xdc, 0xd3, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x22, 0xa7, 0x46, - 0x40, 0x05, 0x00, 0x00, + // 675 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x74, 0x54, 0xdb, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x73, 0x71, 0x9a, 0x49, 0x4a, 0xcd, 0xb6, 0xb4, 0x6e, 0x54, 0x95, 0xc8, 0x0f, 0x28, + 0x52, 0x21, 0x51, 0xd3, 0xf2, 0x0a, 0x6a, 0xa0, 0x90, 0xaa, 0xd4, 0x89, 0x36, 0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 0xe2, 0x6c, 0x9c, 0xc2, 0x61, 0xdf, 0x0b, 0xed, 0xef, 0xef, 0x2d, 0x6e, 0xa5, + 0x84, 0x31, 0x67, 0x33, 0x5b, 0xdc, 0xa7, 0x3d, 0xa8, 0xfc, 0xa4, 0x0e, 0x9f, 0x0a, 0xc6, 0x36, + 0x96, 0x46, 0xff, 0xd5, 0x97, 0x13, 0x97, 0xf2, 0xe9, 0xec, 0x21, 0xa9, 0xa6, 0x3b, 0x9d, 0x47, + 0x84, 0x79, 0xc4, 0x71, 0x09, 0xeb, 0x4e, 0xac, 0x07, 0x46, 0xed, 0xae, 0x78, 0x0d, 0xe3, 0xf4, + 0xdd, 0x7c, 0x50, 0x85, 0x79, 0xf6, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x8f, 0x23, 0x31, 0x8b, 0x73, + 0x05, 0x00, 0x00, } diff --git a/protos/common/configuration.proto b/protos/common/configuration.proto index b35fd720a74..2cefe0fb813 100644 --- a/protos/common/configuration.proto +++ b/protos/common/configuration.proto @@ -118,9 +118,17 @@ message SignaturePolicy { } -// HashingAlgorithm is encoded into the configuration transaction as a configuration item of type CHAIN -// with a Key of "HashingAlgorithm" as marshaled protobuf bytes +// HashingAlgorithm is encoded into the configuration transaction as a configuration item of type Chain +// with a Key of "HashingAlgorithm" and a Value of HashingAlgorithm as marshaled protobuf bytes message HashingAlgorithm { // Currently supported algorithms are: SHAKE256 string name = 1; } + +// BlockDataHashingStructure is encoded into the configuration transaction as a configuration item of +// type Chain with a Key of "BlockDataHashingStructure" and a Value of HashingAlgorithm as marshaled protobuf bytes +message BlockDataHashingStructure { + // width specifies the width of the Merkle tree to use when computing the BlockDataHash + // in order to replicate flat hashing, set this width to MAX_UINT32 + uint32 width = 1; +}