{"record":{"id":"2c3fb83dbfdf728a","repo":"hyperledger/fabric","slug":"the-blocktolive-in-the-following-existing-collecti","errorCode":null,"errorMessage":"the BlockToLive in the following existing collections must not be modified: %v","messagePattern":"the BlockToLive in the following existing collections must not be modified: (.+?)","errorType":"validation","errorClass":"VSCCEndorsementPolicyError","httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v12/validation_logic.go","lineNumber":318,"sourceCode":"\t// modified for the existing collections.\n\tfor _, oldCollectionConfig := range oldCollectionConfigs {\n\n\t\toldCollection := oldCollectionConfig.GetStaticCollectionConfig()\n\t\t// It cannot be nil\n\t\tif oldCollection == nil {\n\t\t\treturn policyErr(fmt.Errorf(\"unknown collection configuration type\"))\n\t\t}\n\n\t\toldCollectionName := oldCollection.GetName()\n\t\tnewCollection := newCollectionsMap[oldCollectionName]\n\t\t// BlockToLive cannot be changed\n\t\tif newCollection.GetBlockToLive() != oldCollection.GetBlockToLive() {\n\t\t\tmodifiedCollectionsBTL = append(modifiedCollectionsBTL, oldCollectionName)\n\t\t}\n\t}\n\n\tif len(modifiedCollectionsBTL) > 0 {\n\t\treturn policyErr(fmt.Errorf(\"the BlockToLive in the following existing collections must not be modified: %v\",\n\t\t\tmodifiedCollectionsBTL))\n\t}\n\n\treturn nil\n}\n\nfunc validateNewCollectionConfigsAgainstOld(newCollectionConfigs []*pb.CollectionConfig, oldCollectionConfigs []*pb.CollectionConfig,\n) error {\n\tnewCollectionsMap := make(map[string]*pb.StaticCollectionConfig, len(newCollectionConfigs))\n\n\tfor _, newCollectionConfig := range newCollectionConfigs {\n\t\tnewCollection := newCollectionConfig.GetStaticCollectionConfig()\n\t\t// Collection object itself is stored as value so that we can\n\t\t// check whether the block to live is changed -- FAB-7810\n\t\tnewCollectionsMap[newCollection.GetName()] = newCollection\n\t}\n\n\tif err := checkForMissingCollections(newCollectionsMap, oldCollectionConfigs); err != nil {","sourceCodeStart":300,"sourceCodeEnd":336,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v12/validation_logic.go#L300-L336","documentation":"checkForModifiedCollectionsBTL found one or more existing collections whose BlockToLive differs between the old and new config during upgrade. BTL is immutable for existing collections to prevent retroactive purge-window changes (FAB-7810).","triggerScenarios":"Thrown at core/handlers/validation/builtin/v12/validation_logic.go:318 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep BlockToLive unchanged for existing collections in the upgrade config","Define desired BTL only on newly added collections"],"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"}