{"record":{"id":"c678159fa8456f62","repo":"hyperledger/fabric","slug":"missing-consensus-type-property-in-config","errorCode":null,"errorMessage":"missing consensus type property in config","messagePattern":"missing consensus type property in config","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/configverifier.go","lineNumber":172,"sourceCode":"\n\tif len(conf.ChannelGroup.Groups[\"Orderer\"].Policies) == 0 {\n\t\treturn fmt.Errorf(\"empty policies in 'Orderer' group\")\n\t}\n\n\tif conf.ChannelGroup.Groups[\"Orderer\"].Policies[\"BlockValidation\"] == nil {\n\t\treturn fmt.Errorf(\"block validation policy is not found in the policies of 'Orderer' group\")\n\t}\n\n\tactualPolicy := conf.ChannelGroup.Groups[\"Orderer\"].Policies[\"BlockValidation\"].Policy\n\n\tif !proto.Equal(expectedConfigPol, actualPolicy) {\n\t\treturn fmt.Errorf(\"block validation policy should be a signature policy: %v but it is %v instead\", expectedConfigPol, actualPolicy)\n\t}\n\n\tconsensusTypeConfigValue := conf.ChannelGroup.Groups[\"Orderer\"].Values[\"ConsensusType\"]\n\n\tif consensusTypeConfigValue == nil {\n\t\treturn fmt.Errorf(\"missing consensus type property in config\")\n\t}\n\n\tconsensusTypeValue := &protosorderer.ConsensusType{}\n\tif err := proto.Unmarshal(consensusTypeConfigValue.Value, consensusTypeValue); err != nil {\n\t\treturn fmt.Errorf(\"invalid consensus type property in config: %v\", err)\n\t}\n\n\tconfigOptions := &smartbft.Options{}\n\tif err := proto.Unmarshal(consensusTypeValue.Metadata, configOptions); err != nil {\n\t\treturn fmt.Errorf(\"invalid options encoded in consensus metadata: %v\", err)\n\t}\n\n\tif configOptions.LeaderRotation == smartbft.Options_ROTATION_ON {\n\t\treturn fmt.Errorf(\"leader rotation must be turned off for this version or be unspecified\")\n\t}\n\n\treturn nil\n}","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/configverifier.go#L154-L190","documentation":"The verifier reads the ConsensusType value from the Orderer group of the proposed channel config. If Values[\"ConsensusType\"] is absent, it cannot determine the consensus metadata and rejects the config update. Every validated config for a SmartBFT channel must carry the ConsensusType entry.","triggerScenarios":"A config update (or genesis config) proposed to a SmartBFT channel whose Orderer group's Values map has no \"ConsensusType\" key.","commonSituations":"Hand-crafted channel creation configs; tooling that strips orderer values; partial config updates that accidentally remove the ConsensusType value; using templates built for a non-BFT consensus type.","solutions":["Add/restore the ConsensusType value (type=etcdraft/BFT with proper Metadata) in the Orderer group of the config","Regenerate the channel config with configtxgen using a SmartBFT-compatible profile","Check the config update diff to ensure no write deletes the ConsensusType key"],"exampleFix":"// before (Orderer.Values lacks ConsensusType after a bad update)\n\"Values\": {\"BatchSize\": ...}\n// after\n\"Values\": {\"ConsensusType\": {\"ModPolicy\": \"Admins\", \"Value\": <marshaled orderer.ConsensusType{Type: \"smartbft\", Metadata: <smartbft.Options>}>}}","handlingStrategy":"validation","validationCode":"if conf.ChannelGroup.Groups[\"Orderer\"].Values[\"ConsensusType\"] == nil {\n    return errors.New(\"config is missing Orderer.ConsensusType value\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never delete orderer group values in a config update; diff with configtxlator first","Generate channel configs only via configtxgen with a SmartBFT profile","Assert ConsensusType presence in generated configs in CI"],"tags":["hyperledger-fabric","smartbft","config-validation","missing-consensus-type"],"backgroundTag":"missing-config-property","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"}