The issue is not that Iran would blatantly attack us. They're not that stupid. They know China and Russia oppose Western opposition to Iran just on principle, and those are the nations that can face off with the US, not them. Any action would be an attempt to play to them.
Either they would do it in a way that they could attempt to deny culpability ("it was not us, it was Zionist powers who attacked carrier to make us look guilty, but if US attacks us in retaliation we will kill all of them with no losses because we really rock and stuff"), or they would simply pretend they've been attacked by us (perhaps stage it somehow or even just plain out lie) and then THEY would have to retaliate, all the while claiming innocence.