US consumer inflation surged to a fresh three-year high in May, with soaring energy prices caused by US President Donald Trump’s Iran war posing a key challenge to Republicans ahead of midterm elections.