code: func ReadBlockMetadata(blockMetadata *common.Metadata, configMetadata *etcdraft.ConfigMetadata) (*etcdraft.BlockMetadata, error) {
  	if blockMetadata != nil && len(blockMetadata.Value) != 0 { // we have consenters mapping from block
  		m := &etcdraft.BlockMetadata{}
  		if err := proto.Unmarshal(blockMetadata.Value, m); err != nil {
  			return nil, errors.Wrap(err, "failed to unmarshal block's metadata")
  		}
  		return m, nil
  	}
  
  	m := &etcdraft.BlockMetadata{
  		NextConsenterId: 1,
  		ConsenterIds:    make([]uint64, len(configMetadata.Consenters)),
  	}
  	// need to read consenters from the configuration
  	for i := range m.ConsenterIds {
  		m.ConsenterIds[i] = m.NextConsenterId
  		m.NextConsenterId++
  	}
  
  	return m, nil
  }
docs: // ReadBlockMetadata attempts to read raft metadata from block metadata, if available.
  // otherwise, it reads raft metadata from config metadata supplied.