Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 851 Bytes

File metadata and controls

17 lines (11 loc) · 851 Bytes

DoS with Block Gas Limit

Description:

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:

  1. Gas Limit DoS on a Contract via Unbounded Operations
  2. Gas Limit DoS on the Network via Block Stuffing

Remediation

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.

References:

https://swcregistry.io/docs/SWC-128

Clear Large Array Without Blowing Gas Limit