cramp: look on net for EAMC. There’s no solution
try stretching a lot beforehand, massage night before?
try doing race intensity (but shorter) bricks in training
and if the magnesium works please let me know as I have the same problem!!
compression gear seemed to help me a bit too.