I have been getting calf and shin cramps to varying degrees every night last few months. I can alleviate with pre bed stretching but always at least a twinge.
Last three nights I’ve worn thermal socks in bed and miraculously, no cramps at all.
I guess the logic is warm feet boost circulation.