Ex post facto is relevant only in criminal matters.
But it is a bill of attainder.
It’s only a bill of attainder if you consider paying a tax a “punishment”. SCOTUS could flop either way on this. If they declare a tax is a punishment it would open the doors to many other actions. I’ll bet they let it stand.