Gas refunds are provided when clearing storage or calling
SELFDESTRUCT on contracts.
The Yellow Paper mentions that refunds are "being capped up to a maximum of half…". What exactly is this "half" and the other components that sum up to a refund? Preferred answer will explain with a specific example (since the Yellow Paper has the definitions).
What are the limits? What attacks would have been possible if refunds were not limited?