The Messenger of Allah ﷺ used to stand in prayer until his feet, or his legs, would swell. When he was asked about it, he would reply, "Should I not be a grateful servant?"
إن كان رسول الله ﷺ ليقوم- أو ليصلي- حتى ترم قدماه- أو- ساقاه- فيقال له: فيقول: أفلا أكون عبدا شكورا.
Bukhari narrated it in the chapter on tahajjud (1130), and Muslim in the Book of the Description of the Resurrection, Paradise, and Hell (2819), both from the hadith of Ziyad bin Alaqa, from Mughira bin Shuba, who mentioned it. The wording given is Bukhari's.In Muslim's wording, the Prophet ﷺ prayed until his feet became swollen, so it was said to him, "Do you exert yourself like this when Allah has forgiven you your past and future sins?" He said, "Should I not then be a grateful servant?"