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

principal game cost & time parameters #64

Open
peersky opened this issue Sep 11, 2024 · 0 comments · May be fixed by #82
Open

principal game cost & time parameters #64

peersky opened this issue Sep 11, 2024 · 0 comments · May be fixed by #82
Labels
Beta Release Project roadmap item for beta release

Comments

@peersky
Copy link
Member

peersky commented Sep 11, 2024

Currently we only enforce timeout limits, which are however bypassed if all players made a move.

After analysing game theoretic risks in our paper, we need to add additional security constraint: ranking instance should have a time constant parameter added which sets minimal time that game must last in order to mint a competence token.

In order to achieve this we need to modify contract initialization parameters:

  • Add principalCost parameter which will be the baseline of what game must collect from participants
  • Add principalTimeConstant parameter which will be minimal time required to finalize tournament
  • Move joinGamePrice parameter to createGame function and store it within IRankifyInstanceCommons.RInstance
  • Move minPlayerSize parameter to createGame function
  • Move maxPlayerSize parameter to createGame function
  • Add minGameTime parameter to createGame function
  • Move RInstanceSettings.gamePrice to RInstance
  • Move RInstanceSettings.minPlayerSize to RInstance
  • Move RInstanceSettings.maxPlayerSize to RInstance
  • Add gamePrice parameter to RInstanceSettings
  • Add principalTimeConstant parameter to RInstanceSettings
  • Add minGameTime parameter to RInstance
  • Remove RankifyInstanceGameOwnersFacet facet from ArguableVotingDistribution.sol , delete facet file & related tests

When creating a game

  • Calculate gamePrice = principalCost * (principalTimeConstant / minGameTime).
  • Create game price for a creator is calculated as a difference between principal cost and what will minimal participants will pay: abs(minPlayerSize*joinGamePrice - gamePrice
  • Require that minGameTime is in range of [1/8th...x8] of principalTimeConstant to avoid boundary cases.
  • Require principalTimeConstant % minGameTime == 0 (or minGameTime % principalTimeConstant == 0 if minGameTime > principalTimeConstant) to avoid division errors.
  • record joinGamePrice to RInstance.joinGamePrice
  • record minGameTime to RInstance.minGameTime

When players joining the game

  • get joinGamePrice from RInstance for a specific gameId
  • get minPlayerSize from RInstance for a specific gameId
  • get maxPlayerSize from RInstance for a specific gameId

When game began:

  • Record game start timestamp
  • closeGame function reverts ifLibTBG.GameInstance.turnStartedAt + RInstance.minGameTime > block.timestamp
@peersky peersky added good first issue Good for newcomers Beta Release Project roadmap item for beta release labels Sep 11, 2024
@peersky peersky changed the title Games must have minimum time ACID instances (rankify games) must have time constraint on ability to quickly mint reward tokens Sep 11, 2024
@peersky peersky changed the title ACID instances (rankify games) must have time constraint on ability to quickly mint reward tokens Rankify Instances should have principal game cost & time parameters Sep 30, 2024
@peersky peersky changed the title Rankify Instances should have principal game cost & time parameters principal game cost & time parameters Sep 30, 2024
@peersky peersky removed the good first issue Good for newcomers label Nov 19, 2024
@peersky peersky linked a pull request Nov 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Beta Release Project roadmap item for beta release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant