{"record":{"id":"76d68d775d82cffc","repo":"hyperledger/fabric","slug":"blockdatahashstructure-width-only-supported-at-max","errorCode":null,"errorMessage":"BlockDataHashStructure width only supported at MaxUint32 in this version","messagePattern":"BlockDataHashStructure width only supported at MaxUint32 in this version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/channel.go","lineNumber":214,"sourceCode":"\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateHashingAlgorithm() error {\n\tswitch cc.protos.HashingAlgorithm.Name {\n\tcase bccsp.SHA256:\n\t\tcc.hashingAlgorithm = util.ComputeSHA256\n\tcase bccsp.SHA3_256:\n\t\tcc.hashingAlgorithm = util.ComputeSHA3256\n\tdefault:\n\t\treturn fmt.Errorf(\"Unknown hashing algorithm type: %s\", cc.protos.HashingAlgorithm.Name)\n\t}\n\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateBlockDataHashingStructure() error {\n\tif cc.protos.BlockDataHashingStructure.Width != math.MaxUint32 {\n\t\treturn fmt.Errorf(\"BlockDataHashStructure width only supported at MaxUint32 in this version\")\n\t}\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateOrdererAddresses() error {\n\tif len(cc.protos.OrdererAddresses.Addresses) == 0 {\n\t\treturn fmt.Errorf(\"Must set some OrdererAddresses\")\n\t}\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateNoOrdererAddresses() error {\n\tif len(cc.protos.OrdererAddresses.Addresses) > 0 {\n\t\treturn fmt.Errorf(\"global OrdererAddresses are not allowed with V3_0 capability, use org specific addresses only\")\n\t}\n\treturn nil\n}\n","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/channel.go#L196-L232","documentation":"The BlockDataHashingStructure config value specifies how block data elements are hashed. This Fabric version only supports a width of math.MaxUint32 (hashing all elements together), and validateBlockDataHashingStructure rejects any other width. It exists to keep future widths open while today's code enforces exactly one value.","triggerScenarios":"The BlockDataHashingStructure proto in the channel group has Width != 4294967295 — e.g. Width left at the default 0 because the value was constructed by hand, or a config produced by tooling that emits a concrete count.","commonSituations":"Building cb.ConfigValue in tests with &cb.BlockDataHashingStructure{} (Width 0); older/custom tooling emitting a different width; manual proto construction omitting the field.","solutions":["Set Width to math.MaxUint32 (4294967295) in the BlockDataHashingStructure config value","Regenerate the config with configtxgen, which emits the correct default","In tests, initialize the struct explicitly: &cb.BlockDataHashingStructure{Width: math.MaxUint32}"],"exampleFix":"// before\nbds := &cb.BlockDataHashingStructure{} // Width == 0 -> error\n\n// after\nbds := &cb.BlockDataHashingStructure{Width: math.MaxUint32}","handlingStrategy":"validation","validationCode":"if blockDataHash != nil && blockDataHash.Width != math.MaxUint32 {\n    return errors.New(\"BlockDataHashingStructure.Width must be math.MaxUint32\")\n}","typeGuard":null,"tryCatchPattern":"cc, err := channelconfig.NewChannelConfig(channelGroup, bccsp)\nif err != nil {\n    if strings.Contains(err.Error(), \"BlockDataHashStructure width\") {\n        return fmt.Errorf(\"fix Width to math.MaxUint32 and retry\")\n    }\n    return err\n}","preventionTips":["Always initialize BlockDataHashingStructure with Width: math.MaxUint32 in tests/tools","Use configtxgen-generated configs which emit the supported width","Treat any non-MaxUint32 width as invalid before submitting updates"],"tags":["fabric","channelconfig","block","hashing","version-limitation"],"backgroundTag":"unsupported-config-value","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}