{"record":{"id":"b33790a7e44c8383","repo":"hyperledger/fabric","slug":"transaction-d-in-block-d-has-skipped-validation","errorCode":null,"errorMessage":"transaction %d in block %d has skipped validation","messagePattern":"transaction (.+?) in block (.+?) has skipped validation","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"core/committer/txvalidator/v14/validator.go","lineNumber":244,"sourceCode":"\t}\n\n\t// Initialize metadata structure\n\tprotoutil.InitBlockMetadata(block)\n\n\tblock.Metadata.Metadata[common.BlockMetadataIndex_TRANSACTIONS_FILTER] = txsfltr\n\n\telapsedValidation := time.Since(startValidation) / time.Millisecond // duration in ms\n\tlogger.Infof(\"[%s] Validated block [%d] in %dms\", v.ChannelID, block.Header.Number, elapsedValidation)\n\n\treturn nil\n}\n\n// allValidated returns error if some of the validation flags have not been set\n// during validation\nfunc (v *TxValidator) allValidated(txsfltr txflags.ValidationFlags, block *common.Block) error {\n\tfor id, f := range txsfltr {\n\t\tif peer.TxValidationCode(f) == peer.TxValidationCode_NOT_VALIDATED {\n\t\t\treturn errors.Errorf(\"transaction %d in block %d has skipped validation\", id, block.Header.Number)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc markTXIdDuplicates(txids []string, txsfltr txflags.ValidationFlags) {\n\ttxidMap := make(map[string]struct{})\n\n\tfor id, txid := range txids {\n\t\tif txid == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\t_, in := txidMap[txid]\n\t\tif in {\n\t\t\tlogger.Error(\"Duplicate txid\", txid, \"found, skipping\")\n\t\t\ttxsfltr.SetFlag(id, peer.TxValidationCode_DUPLICATE_TXID)","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/committer/txvalidator/v14/validator.go#L226-L262","documentation":"After validating a block, the validator asserts that every transaction received a validation flag. If any transaction still has TxValidationCode_NOT_VALIDATED, internal bookkeeping failed, so the whole block validation returns this error instead of committing a partially validated block.","triggerScenarios":"allValidated (called from Validate) finds a flag in txsfltr equal to NOT_VALIDATED after the per-transaction validation loop — a validator path failed to set a commit/validation code for that transaction.","commonSituations":"Custom validation plugin returning without setting a validation code; internal Fabric bug in a validation path; corrupted/malformed block causing a validation branch to skip flag assignment.","solutions":["Identify which validator (VSCC plugin) handled the transaction and why it didn't set a flag; check peer logs for preceding errors","Fix or replace the custom validation plugin so it always returns a validation code","Upgrade the peer to the latest patch release in case of a known validator bug","Isolate the offending block/transaction and reprocess or refetch the block from the ordering service"],"exampleFix":"// before: plugin returns without setting code\nfunc (p *MyPlugin) Validate(...) error { if bad { return errors.New(\"x\") } ... }\n// after\n// return a proper validation code via the common errors mechanism\nreturn errors.WithCommonValidationCode(errors.New(\"x\"))","handlingStrategy":"type-guard","validationCode":"// after custom validation, verify all flags are set\nfor _, f := range txsfltr {\n    if peer.TxValidationCode(f) == peer.TxValidationCode_NOT_VALIDATED {\n        return errors.New(\"unset validation flag\")\n    }\n}","typeGuard":"func allFlagsSet(flags txflags.ValidationFlags) bool {\n    for _, f := range flags {\n        if peer.TxValidationCode(f) == peer.TxValidationCode_NOT_VALIDATED { return false }\n    }\n    return true\n}","tryCatchPattern":"if err := validator.Validate(block); err != nil && strings.Contains(err.Error(), \"has skipped validation\") {\n    // halt commit pipeline, inspect plugin/validator, do not commit the block\n}","preventionTips":["Custom validators must always set a validation code before returning","Unit-test plugin behavior for every error path","Upgrade peers to patched Fabric releases","Validate blocks against a reference validator in staging"],"tags":["validation","block","internal"],"backgroundTag":"validation-flag-missing","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"}