Brazil
Their case
They will charged with Art. 129 of the Penal Code, "lesão corporal" (loosely translated to bodily harm), punishable by incarceration of 3 months to a year - theoretically.
4th paragraph does have provocation as a factor to reduce the sentence, described as "motivated by reason with relevant social or moral value or under intense emotion, right after unfair provocation on the victim's part", allowing the judge to reduce the punishment by 1/6 to 1/3. So then they can be in prison for 1 to 10 months in this case. Note that it is up to the judge's discretion to define if this applies.
In case they don't inflict severe wounds (i.e. no risk to life, no permanent disability, not labor-inducing and the person is not incapacitated for work for more than 30 days) AND you also inflict wounds in the same extent, the punishment can be changed to a fine
You
You can be charged with Art. 140, "Injúria" (which doesn't translate to directly injury, it is more akin to insult, even though it can be physical, like painting things on someone's face) which is defined by "insulting someone, offending their dignity or decorum" - if they decide to press charges, as this is not automatically prosecutable. This is punishable by incarceration of 1 to 6 months or a fine.
If the name you call is considered a slur (referring to race / color, ethnicity, nationality, religion, age, disability...), then your punishment increases to 1 to 3 years in prison AND a fine.
You can also get charged with the same bodily harm charge described above. If the judge rules that your insult was not severe enough to justify physical violence AND you didn't use excessive force, you can go scot-free of this charge under legitimate defense.