Short sighted... here's my take: Iran knew the Hamas attack would pull the United States into posturing (which it did) and to spread Israel thin, boost oil prices (helping Russians) and weaken the US further to assist China with their takeover of Taiwan...
How do you do all of that?
Lure large US ships to the ME - then sink one or two in the straights of Hormuz. That closes down oil shipping for months. Cripples Iran's ME oil exporters competitors, raises prices for Russian oil, grinds industry to a halt in Europe and the US and allows for China to invade Taiwan while the Pentagon searches for petrolatum products to fuel our war machine caused by Biden draining our emergency reserves... (either Biden was stupid or was paid off... )
The short term solution - stay OUT of the straights. Make loans for refineries... get real.
No doubt Iran’s hands are all over this. They sense US weaknesses and are striking while the iron is hot.