Game Can Be Stuck Indefinitely If Second Player Never Commits
In the commitMove
function, once the first player commits, the game state transitions from Created
to Committed
. However, the cancelGame
function only allows cancellation when the game is still in the Created
state.
This means:
If playerA
commits, and playerB
never calls**** commitMove
, the game stays stuck in the Committed
state forever.
The game never reaches the reveal phase (revealDeadline
is only set after both players commit).
There is no way for the creator or any player to cancel or recover from this state.
This opens up the game to griefing attacks where a malicious or unresponsive player joins a game and intentionally never commits, permanently stalling it.
Could result in a denial-of-service against active players.
Manual Review
Set a deadline for the commit. For example, 2 hours.
Add a commitDealine
variable to the Game
struct:
Whenever a player commits in the commitMove
function, set a commitDeadline
for both the first and subsequent turns:
Consider allowing both players to cancel a game if one of the players do not commit before the commit deadline:
Reset the commit deadline after each turn in the _determineWinner
function:
Protocol does not provide a way for Player B to exit a game and reclaim their stake if Player A stops participating
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.