{"record":{"id":"6c60c6591c275e9c","repo":"hyperledger/fabric","slug":"invalid-block-header-datahash-is-different-from-h","errorCode":null,"errorMessage":"invalid block: Header.DataHash is different from Hash(block.Data)","messagePattern":"invalid block: Header\\.DataHash is different from Hash\\(block\\.Data\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/channelparticipation/validator.go","lineNumber":38,"sourceCode":")\n\n// ValidateJoinBlock checks whether this block can be used as a join block for the channel participation API.\n// It returns the channel ID.\n// It verifies that it is not a system channel by checking that consortiums config does not exist.\n// It verifies it is an application channel by checking that the application group exists.\n// It returns an error when it cannot be used as a join-block.\nfunc ValidateJoinBlock(configBlock *cb.Block) (channelID string, err error) {\n\tif !protoutil.IsConfigBlock(configBlock) {\n\t\treturn \"\", errors.New(\"block is not a config block\")\n\t}\n\n\tif configBlock.Metadata == nil || len(configBlock.Metadata.Metadata) == 0 {\n\t\treturn \"\", errors.New(\"invalid block: does not have metadata\")\n\t}\n\n\tdataHash := protoutil.ComputeBlockDataHash(configBlock.Data)\n\tif !bytes.Equal(dataHash, configBlock.Header.DataHash) {\n\t\treturn \"\", errors.New(\"invalid block: Header.DataHash is different from Hash(block.Data)\")\n\t}\n\n\tenvelope, err := protoutil.ExtractEnvelope(configBlock, 0)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tcryptoProvider := factory.GetDefault()\n\tbundle, err := channelconfig.NewBundleFromEnvelope(envelope, cryptoProvider)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tchannelID = bundle.ConfigtxValidator().ChannelID()\n\n\t// Check channel type\n\t_, isSystemChannel := bundle.ConsortiumsConfig()\n\tif isSystemChannel {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/channelparticipation/validator.go#L20-L56","documentation":"ValidateJoinBlock guard: the SHA-256 hash of the block's data does not match Header.DataHash, so the block's integrity is broken — data was modified after the header was computed, or the block is corrupt. The join request is rejected as invalid.","triggerScenarios":"Thrown at orderer/common/channelparticipation/validator.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-obtain the config block from its authoritative source","Check for transport-level corruption when the block was exported/copied"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}