function actorIdToActorNum(opId, actorIds) {
  if (!opId || !opId.actorId) return opId
  const counter = opId.counter
  const actorNum = actorIds.indexOf(opId.actorId)
  if (actorNum < 0) throw new RangeError("missing actorId") // should not happen
  return { counter, actorNum, actorId: opId.actorId }
}
Maps an opId of the form {counter: 12345, actorId: 'someActorId'} to the form
{counter: 12345, actorNum: 123, actorId: 'someActorId'}, where the actorNum
is the index into the `actorIds` array.