Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RealitioArbitratorProxy.computeWinner should add a grace period of 15s to commitment timeout #246

Closed
pacamara opened this issue Apr 10, 2019 · 1 comment

Comments

@pacamara
Copy link

pacamara commented Apr 10, 2019

RealitioArbitratorProxy.computeWinner protects non-timed-out commitments with:

require(revealTS <= uint32(now), 
    "Arbitration cannot be done until the last answerer has had time to reveal its commitment.");

A malicious miner can increase the block time by up to 15s and still get it accepted. For an unrevealed commitment which is in the last 15s of its commitment timeout, and if the miner requested arbitration, computeWinner deems the miner the winner.

Therefore the require(...) should include a 15s grace period to guarantee the commitment is never timed out prematurely.

See pacamara/realitio-contracts#1 for demonstration code.

(Issue identified from code review for bounty #244 )

@clesaege
Copy link
Member

This would complicate the code compared to just giving 15 more seconds of timeout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants