iPhone XS Max, 2018. The only reason I might update is for the better camera. But this is marginal. I tend to buy one of the top line iPhone once in about 5 years, with enough memory. And they last long time. I might consider changing battery instead and get another 2 years… Apple is also super good with software updates on old hardware.
They deliberately slowed down phones with defective batteries to prevent them from randomly crashing. Which would cause a lot more people to complain than the phone being slower, but not turning off at 30%.