Repository navigation
Description
Severity: high. Every player in the affected game loses it and its prize draw with no way to recover, and #259 shows the cancel can be forced on purpose.
When the chain doesn't finish forming the groups by the deadline before a game starts, it cancels the game for everyone who signed up, and cancels the game's prize draws too. Players sign up, wait at a table where nobody joins, and then get the end-of-game screen. They did nothing wrong; the chain just needed a bit more time.
This happened on previewnet in game 166 (20 Nov 2026, 17:20 UTC): 1,501 players had signed up for a game with a prize draw. Previewnet's People chain makes a block every 6 s, so its 60 s shuffle phase is 10 blocks; forming the groups for 1,501 players needed about 30, was still in its second step when the 60 s ran out, and the game and draw were cancelled. Collator log: game 166: shuffle deadline 1795195170 passed at 1795195176, the shuffle phase is too short (https://previewnet.substrate.dev/logs/2026-11-20/people-collator1.log). The same game on a 2 s-block chain would need about 60 s, so with a 60 s phase it would land right at the deadline.
This doesn't depend on how the game is configured. A longer shuffle phase makes it rarer, but how long forming the groups takes varies with the number of players and with how quickly the chain gets the steps into blocks, and #259 shows the steps can be pushed out on purpose. Whenever the deadline is missed, by any margin, everyone loses the game. With weekly games that is the week's game.
Code: the cancel is in shuffles (
individuality-community/pallets/game/src/lib.rs
Lines 3310 to 3326 in 23f4270
| }; | |
| let now = T::UnixTime::now(); | |
| if now > Duration::from_secs(game.shuffle_deadline.into()) { | |
| // The configured phases leave no room for the steps this shuffle needs, so this is | |
| // an error introduced by an operator (who configured the pallet). | |
| log::error!( | |
| target: LOG_TARGET, | |
| "game {}: shuffle deadline {} passed at {}, the shuffle phase is too short", | |
| game.index, | |
| game.shuffle_deadline, | |
| now.as_secs(), | |
| ); | |
| Self::on_game_cancelled(&game, CancelReason::ShuffleDeadlineMissed); | |
| game.state = GameState::Cancelling { step: CancellingStep::Step1DrainShuffle }; | |
| Game::<T>::put(game); | |
| return; |
on_game_cancelled cancels the draws (individuality-community/pallets/game/src/lib.rs
Lines 2777 to 2783 in 23f4270
| pub(crate) fn on_game_cancelled(game: &GameInfo<T::AccountId>, reason: CancelReason) { | |
| for airdrop_index in 0..game.airdrops_scheduled { | |
| let event_id = Self::airdrop_event_id(game.index, airdrop_index); | |
| T::Airdrop::cancel(event_id); | |
| } | |
| Self::deposit_event(Event::<T>::GameCancelled { game_index: game.index, reason }); | |
| } |
Expected: when forming the groups takes longer than planned, the people who signed up still play that game and its prize draw still takes place.
To check: a game whose shuffle runs past its planned end still starts with its players and draws, and players see their co-players instead of the end-of-game screen.
Related: why the shuffle runs late in large games, #262.
Activity
andrzejSulkowski commentedon Nov 21, 2026
This is a valuable experiment, but expected. Its a well known shortcoming of the game pallet and thats why we need to do a reasonable estimation of players and set a gracious
shuffleduration in prod.issue #259 needs to get closed indeed and there is always a certain chance that we get a sudden spike of 3x players into one game. The idea is to start with good buffered durations, watch the games and adjust through
parameterconfigured values through quick OpenGov referenda. This is a known scalability issue of the current game.andrzejSulkowski commentedon Nov 21, 2026
But this is very valuable. I see multiple things which should behave differently. Well done @mordamax! 🙇