code: func (s *CommonStorageDB) GetStateMetadata(namespace, key string) ([]byte, error) {
  	if !s.metadataHint.metadataEverUsedFor(namespace) {
  		return nil, nil
  	}
  	vv, err := s.GetState(namespace, key)
  	if err != nil || vv == nil {
  		return nil, err
  	}
  	return vv.Metadata, nil
  }
docs: // GetStateMetadata implements corresponding function in interface DB. This implementation provides
  // an optimization such that it keeps track if a namespaces has never stored metadata for any of
  // its items, the value 'nil' is returned without going to the db. This is intented to be invoked
  // in the validation and commit path. This saves the chaincodes from paying unnecessary performance
  // penality if they do not use features that leverage metadata (such as key-level endorsement),