code: func (impl *DefaultImpl) ValidateAndPrepareBatch(blockAndPvtdata *ledger.BlockAndPvtData,
  	doMVCCValidation bool) (*privacyenabledstate.UpdateBatch, []*txmgr.TxStatInfo, error) {
  	block := blockAndPvtdata.Block
  	logger.Debugf("ValidateAndPrepareBatch() for block number = [%d]", block.Header.Number)
  	var internalBlock *internal.Block
  	var txsStatInfo []*txmgr.TxStatInfo
  	var pubAndHashUpdates *internal.PubAndHashUpdates
  	var pvtUpdates *privacyenabledstate.PvtUpdateBatch
  	var err error
  
  	logger.Debug("preprocessing ProtoBlock...")
  	if internalBlock, txsStatInfo, err = preprocessProtoBlock(impl.txmgr, impl.db.ValidateKeyValue, block, doMVCCValidation); err != nil {
  		return nil, nil, err
  	}
  
  	if pubAndHashUpdates, err = impl.internalValidator.ValidateAndPrepareBatch(internalBlock, doMVCCValidation); err != nil {
  		return nil, nil, err
  	}
  	logger.Debug("validating rwset...")
  	if pvtUpdates, err = validateAndPreparePvtBatch(internalBlock, impl.db, pubAndHashUpdates, blockAndPvtdata.PvtData); err != nil {
  		return nil, nil, err
  	}
  	logger.Debug("postprocessing ProtoBlock...")
  	postprocessProtoBlock(block, internalBlock)
  	logger.Debug("ValidateAndPrepareBatch() complete")
  
  	txsFilter := util.TxValidationFlags(block.Metadata.Metadata[common.BlockMetadataIndex_TRANSACTIONS_FILTER])
  	for i := range txsFilter {
  		txsStatInfo[i].ValidationCode = txsFilter.Flag(i)
  	}
  	return &privacyenabledstate.UpdateBatch{
  		PubUpdates:  pubAndHashUpdates.PubUpdates,
  		HashUpdates: pubAndHashUpdates.HashUpdates,
  		PvtUpdates:  pvtUpdates,
  	}, txsStatInfo, nil
  }
docs: // ValidateAndPrepareBatch implements the function in interface validator.Validator