Race Condition
A race condition is a software vulnerability that occurs when the outcome of a process depends on the uncontrolled sequence or timing of events. In smart contracts, this happens when multiple functions attempt to modify the same state variable at the same time.
If the order of execution is not strictly enforced, the resulting state can be incorrect, potentially allowing for unauthorized fund transfers or manipulation of derivative prices. This is particularly dangerous in decentralized finance where rapid-fire transactions are common.
Attackers look for these timing windows to execute their exploits before the protocol can react. Preventing race conditions requires careful synchronization and atomic operations.
It is a central concern in the study of market microstructure and order flow. If not managed, race conditions can lead to massive protocol insolvency.
Developers must ensure that all state changes are predictable and independent of execution timing. It is a fundamental challenge in distributed system design.