Each block has an upper bound on the amount of gas that can be spent, and thus the amount computation that can be done. This is the Block Gas Limit. If the gas spent exceeds this limit, the transaction will fail.
This leads to a couple of possible Denial of Service vectors:
- Gas Limit DoS on a Contract via Unbounded Operations
- Gas Limit DoS on the Network via Block Stuffing
Caution is advised when you expect to have large arrays that grow over time. Actions that require looping across the entire data structure should be avoided.