# DoS via block gas limit permanently bricks functions that iterate over unbounded arrays Functions that iterate over dynamically growing arrays (such as refunding all participants or distributing rewards to all holders) can exceed the block gas limit as the array grows, making the function permanently uncallable. The Fomo3D exploit demonstrated a related attack: an attacker stuffed 13 consecutive blocks with high-gas transactions to prevent other players from calling the game's timer function. The defense is to avoid unbounded loops over growing data structures. Use pull-payment patterns (users withdraw individually) instead of push patterns (contract pays everyone), and paginate any operations that must iterate over large collections. Since [[insufficient gas griefing in relayer patterns allows forwarders to starve subcalls while outer transactions succeed]], gas accounting is fragile across the entire call chain, not just within a single function. --- Relevant Notes: - [[DoS via unexpected revert exploits fallback functions that intentionally revert to block ETH transfers]] — another DoS vector, often co-present in batch payment patterns - [[evm memory gas costs grow quadratically making large allocations prohibitively expensive]] — gas costs compound the iteration problem via quadratic memory expansion - [[insufficient gas griefing in relayer patterns allows forwarders to starve subcalls while outer transactions succeed]] — another gas-based DoS mechanism in meta-transaction contexts - [[unbounded return data from external calls forces quadratic memory cost gas consumption via RETURNDATASIZE]] — sibling gas-based DoS exploiting quadratic memory costs through a different vector Topics: - [[vulnerability-patterns]]