code: func (r *Registrar) ConsensusMigrationCommit() error {
  	r.lock.Lock()
  	defer r.lock.Unlock()
  
  	sysState, sysContext := r.systemChannel.MigrationStatus().StateContext()
  	if !(sysState == ab.ConsensusType_MIG_STATE_START && sysContext > 0) {
  		return errors.Errorf("cannot commit consensus-type migration because system channel (%s): state=%s, context=%d (expect: state=%s, context>0)",
  			r.systemChannel.ChainID(), sysState, sysContext, ab.ConsensusType_MIG_STATE_START)
  	}
  
  	for id, chain := range r.chains {
  		st, ctx := chain.MigrationStatus().StateContext()
  		if id == r.systemChannel.ChainID() {
  			continue
  		}
  		if st != ab.ConsensusType_MIG_STATE_CONTEXT {
  			return errors.Errorf("cannot commit consensus-type migration because standard channel %s, still pending, state=%s", id, st)
  		}
  		if ctx != sysContext {
  			return errors.Errorf("cannot commit consensus-type migration because standard channel %s, bad context=%d, expected=%d", id, ctx, sysContext)
  		}
  	}
  
  	r.systemChannel.MigrationStatus().SetStateContext(ab.ConsensusType_MIG_STATE_COMMIT, sysContext)
  	logger.Debugf("Consensus-type migration: system channel marked as committed, context=%d", sysContext)
  
  	return nil
  }
docs: // ConsensusMigrationCommit checks pre-conditions and commits the consensus-type migration.