Skip to content

Add player unregistration method - #254

Merged
gui1117 merged 5 commits into
mainfrom
george-unregister-players
Nov 24, 2026
Merged

gui1117 merged 5 commits into
mainfrom
george-unregister-players

Conversation

@georgepisaltu

Copy link
Copy Markdown
Contributor

This PR adds an unregister call in pallet-game which lets registered players essentially mark themselves as absent while the game still accepts sign-ups. The player stays a player and the game counts them as absent. They can neither sign up again nor offboard until the game ends. Their airdrop entries stay in the draws but the player will not be able to claim if they win, which matches the absent behavior.

Changes

  • New call available for players to declare they will not attend the game. This will free up space in the shuffle and it will lead to fewer perceived absent players.
  • Player registration is now an enum of NotRegistered and Registered (which encode like the previous boolean registered variable) and it now has Unregistered to prevent re-registration and spam.
  • unregister joins the one-time excess calls of the account participant origin in origin-restriction.

Signed-off-by: georgepisaltu <george.pisaltu@parity.io>
@georgepisaltu georgepisaltu self-assigned this Nov 18, 2026
@georgepisaltu
georgepisaltu requested a review from a team November 18, 2026 15:26
@georgepisaltu georgepisaltu added enhancement New feature or request D5-nice to have audit optional to have, meant to express "audit it if there is bandwidth" labels Nov 18, 2026
@gui1117 gui1117 added the C0.5-breaking-client-api This PR breaks an API used by off-chain clients (e.g. product-sdk); clients must be updated. label Nov 23, 2026
Comment thread pallets/game/src/lib.rs
Comment on lines 1534 to +1536
/// There must be no game or the existing game must be in registration phase and the player
/// must have not signed up for the game.
/// must have not signed up for the game. A player that unregistered from the game signed
/// up for it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think it reads a bit clearer this way, wdyt?

Suggested change
/// There must be no game or the existing game must be in registration phase and the player
/// must have not signed up for the game.
/// must have not signed up for the game. A player that unregistered from the game signed
/// up for it.
/// There must be no game or the existing game must be in registration phase and the player
/// must have not signed up for the game, even if they then unregistered.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't apply because it doesn't feel 100% correct english.

@agustinustheo

Copy link
Copy Markdown
Member

/cmd bench --pallet indiv_pallet_game

@github-actions

Copy link
Copy Markdown
Contributor

Command "bench --pallet indiv_pallet_game" has started 🚀 See logs here

@andrzejSulkowski

Copy link
Copy Markdown
Collaborator

We should let app folks know that this is no different than a plain absence from the game from the perspective of the player.
So the App could show for example warning if the user will lose personhood when de-registering.

@andrzejSulkowski
andrzejSulkowski enabled auto-merge (squash) November 24, 2026 07:10
@command-bot-individuality-commun

Copy link
Copy Markdown

Command "bench --pallet indiv_pallet_game" has finished ✅ See logs here

Runtime weight deviation:
Base:    upstream/main @ be0c2863169c  (merge-base)
Current: HEAD

1 file scanned · 0 extrinsics above 10% threshold
measured at documented component maxima - pass --max NAME=VALUE for charge-site maxima

@gui1117
gui1117 force-pushed the george-unregister-players branch from 57f0a68 to 0c1217d Compare November 24, 2026 20:15
@gui1117
gui1117 enabled auto-merge (squash) November 24, 2026 20:15
@gui1117
gui1117 merged commit 86f1009 into main Nov 24, 2026
35 of 40 checks passed
@gui1117
gui1117 deleted the george-unregister-players branch November 24, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C0.5-breaking-client-api This PR breaks an API used by off-chain clients (e.g. product-sdk); clients must be updated. D5-nice to have audit optional to have, meant to express "audit it if there is bandwidth" enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants