I would not be at the wedding. Your friend was way out of line and callous in inviting him, knowing the circumstances.
She has to learn that there are consequences to her poor choices in life.
And you should not put yourself, your boyfriend and other guests in harms way of the abusive ex.
He might get drunk at the wedding, or before, to build up more nerve to act out.
There are a lot of negative news stories out there every week about people acting out and being violent at parties....leading to bloodshed and injuries and worse.
Your friend may have put you and others in harms way. Why should you agonize over this for months? A wedding should be a joyous event, not a battleground.
Your friend did not handle the situation properly, so therefore, you have every right to back out.
Her wedding might be wonderful fairytale for her, but it's a nightmare for you.