Repository navigation
Conversation
| ); | ||
| let mut iterator = Players::<T>::iter_from_key(target_player.clone()); | ||
| let mut credits_awarded = 0; | ||
| // Worst case: the player moves to a next limit. |
There was a problem hiding this comment.
I think the weights need a regen for this.
…ent-limit-parameter
…ent-limit-parameter # Conflicts: # pallets/game/src/lib.rs # pallets/game/src/migration.rs # runtimes/next-people-paseo/src/lib.rs
|
Let me trigger the weight regen for you. /cmd bench --pallet indiv_pallet_game |
|
/cmd bench --pallet indiv_pallet_game |
|
Command "bench --pallet indiv_pallet_game" has started 🚀 See logs here |
|
Command "bench --pallet indiv_pallet_game" has finished ✅ See logs here Runtime weight deviation: |
| } else { | ||
| limit.into() | ||
| } | ||
| } |
There was a problem hiding this comment.
maybe we should fix sp-statement-store to not remove when one dimension is non-zero. this looks like a very tricky API.
| } | ||
|
|
||
| /// Return `PlayerStatementLimit`, or zero when one of its dimensions is zero. | ||
| fn player_statement_limit() -> BoundedStatementAllowance { |
There was a problem hiding this comment.
maybe let's rename this function, it is too close to player_statement_limits I think we should avoid using it directly, so we can make the name more in this direction, like dynamic_player_statement_limit.
| if next != limits.next { | ||
| PlayerStatementLimits::<T>::put(PlayerStatementLimitsRecord { next, ..limits }); | ||
| } | ||
| } |
There was a problem hiding this comment.
maybe we could move it into its own function and the code at the end too, then we write down on top of PlayerStatementLimits that is must never be read/write directly but instead use the manager in the module player_statement_limit::PlayerStatementLimitManager. and put all those functions there. Similar to coinage and recycler_manager::RecyclerManager.
But also it is ok as it is.
The player statement limit is now a dynamic parameter. The game pallet records the allowance it grants to live players and revokes that amount instead of the current limit. When the next game processes players, it moves every live player to the changed limit. A migration stores the allowance that players held before the upgrade.