Sleep is a very sensitive subject. From my personal experience, I found that eating sugary food or chocolate before going to sleep is important. Sleep is influenced by your state of mind of course, and the levels of sugar in the blood.
Whenever you wake up, the body is checking the sugar levels and then decides to continue the sleep or to stay awake and get some new carbs.
It`s somehow equal with the emotional state and thoughts.
I think foods like chocolate, ice cream and cream based sweets are not flatulent and do not ferment during the night. Stay away from bread and fruits, they tend to ferment fast.
I stopped running after 6.00 o`clock. Whenever i arrived with pain after training, my sleep was good with ice cream or chocolate. or both. And sometimes, an aspirin is good for pain.
In this way, if i ever woke up, i could go back to sleep because my body was relaxed and had the energy deposits in standby.