Skip to content

Game: large games are cancelled because the chain advances the game in only about every second block #262

Open

Description

@mordamax

Severity: high. With the 120 s shuffle set on paseo-next-v2 today, a game on a 2 s-block chain is capped at about 3,000 players, below the 5,000 we are load-testing for, and everyone in a larger game loses it.

Players in a large game can lose it entirely. The chain doesn't finish forming the groups before the game starts, so it cancels the game: players wait at a table where nobody joins, then get the end-of-game screen. Games of any size also take longer to wrap up after play than the phase settings expect.

What we measured on previewnet (spec 3005000) on 20 Nov 2026. Previewnet's People chain makes a block every 6 s, so we count in blocks and steps, which don't depend on the block time, and convert to time for a 2 s-block chain below:

  • The chain moves a game forward one step per block at most, and steps landed in only 51% to 59% of blocks in every multi-step phase that day (13 phases, for example 60 of 117 blocks during game 169's player processing, #40907 to #41023). So on average a step every 2 blocks: 4 s on a 2 s-block chain.
  • Forming the groups takes about one step per 100 players, processing players after the game about one step per 25 (game 169, 1,500 players: 15 shuffle steps, 61 processing steps).
  • Game 166 with 1,501 players was cancelled this way: its 60 s shuffle phase was 10 blocks on previewnet, and it needed about 30 (15 steps, a step every 2 blocks). On a 2 s-block chain those 30 blocks would take 60 s, right at the limit of a 60 s phase.

What that means on a chain with 2 s blocks, a step every 2 blocks:

Players Time to form the groups Time to process players after the game
2,000 80 s 5 min
5,000 200 s 13 min
10,000 400 s 27 min

With the 120 s shuffle phase set on paseo-next-v2 today (2 s blocks), games above about 3,000 players would be cancelled. #220 sizes the phases for 2 s blocks assuming a step in 76% of them, so for 10,000 players it suggests 5 minutes for the shuffle and 11 for processing, where a step every 2 blocks needs about 7 and 27. For comparison, paseo-next-v2 (2 s blocks, spec 3004000, before the game steps moved into offchain-worker transactions in #130 and #146) formed the groups of 2,000 players in 15.6 s (game 352).

When this applies: it depends on the block time, the phase lengths set with set_game_phases and the number of players. With phases at least as long as in the table, games of that size are not cancelled.

Why a step skips a block, for whoever picks this up:

  • We read the People collator's transaction pool every 250 ms and compared it with each new block. After a block that contains a step, the offchain worker of that block almost never leaves the next step in the pool, so the next step only comes from the worker of the following block. In games 173, 174 and 175 (20:18 to 21:05 UTC) that happened every time but once. Example: end_registration(173, 42051) landed in #42052, and the next step in the pool was advance_cancelling(173, 42053), nothing from the worker of #42052.
  • From the code this looks like a race: the worker of block N submits right after N is imported, and the pool checks a local submission against its newest view (submit_local in https://github.com/paritytech/polkadot-sdk/blob/master/substrate/client/transaction-pool/src/fork_aware_txpool/view_store.rs). If that view is still N-1, the new step is either not due yet there or carries the same tag as the step still pending there, and it is rejected. We haven't seen this in the node's log, as the collator runs without txpool debug logs.
  • Related: Game: A collator can bias the shuffle #237 and Game: a funded account can cancel a game by crowding out the shuffle steps #259 are about the same steps being left out of blocks.

Expected: a game finishes forming its groups and processing its players within the phase lengths recommended for its size.

To check: with the recommended phases on a 2 s-block chain, a game of 5,000 players starts without being cancelled, and steps land in the share of blocks the recommendation assumes.

Related: a game whose shuffle runs late is cancelled for everyone, #260; on a tight schedule the slow player processing drops the next game, #261.

Activity

  1. added
    bug
    on Nov 20, 2026
  2. andrzejSulkowski commented on Nov 21, 2026

    @andrzejSulkowski
    Collaborator

    [...]. We haven't seen this in the node's log, as the collator runs without txpool debug logs.

    can you enable in the next run the txpool debug logs? It would be good to collect all this data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions