package tezos-protocol-alpha
type dissection_chunk = Sc_rollup_dissection_chunk_repr.t
type game_state =
| Dissecting of {
dissection : dissection_chunk list;
(*
*)dissection
, a list of states with tick counts. The current player will specify, in the next move, a tick count that indicates the last of these states that she agrees with.default_number_of_sections : int;
(*
*)default_number_of_sections
is the number of sections a disection should contain in the more general case where we still have a high enough number of disputed ticks.
}
(*When the state is
*)Dissecting
, both player are still dissecting the commitment to find the tick to refute.| Final_move of {
agreed_start_chunk : dissection_chunk;
refuted_stop_chunk : dissection_chunk;
}
(*When the state is
Final_move
, eitherAlice
orBob
already played an invalid proof.The other player will have a chance to prove that the
*)refuted_stop_state
is valid. If both players fail to either validate or refute the stop state, the current game state describes a draw situation. In the same way, the draw can be described by the situation where the two players manage to validate or refute the stop state.
Describes the current state of a game.
val game_state_encoding :
game_state Tezos_protocol_environment_alpha.Data_encoding.t
val game_state_equal : game_state -> game_state -> bool
type t = {
turn : player;
inbox_snapshot : Sc_rollup_inbox_repr.history_proof;
dal_snapshot : Dal_slot_repr.History.t;
start_level : Raw_level_repr.t;
inbox_level : Raw_level_repr.t;
game_state : game_state;
}
A game is characterized by:
refuter_commitment_hash
, the hash of the commitment of the player that has initiated the game.
defender_commitment_hash
, the hash of the commitment of the player that is tentatively refuted.
turn
, the player that must provide the next move.
inbox_snapshot
, a snapshot of the inbox state at the moment the game is created. This is only used when checkingInput_step
andBlocked_step
proofs; it makes the proofs easier to create--- otherwise they would have a 'moving target' because the actual inbox may be updated continuously.
dal_snapshot
, a snapshot of the DAL's confirmed slots history at the moment the game is created. In fact, since the confirmed slots history at initialization would likely evolve during the game, we need a (fixed) reference w.r.t. which Dal input proofs would be produced and verified if needed.
level
, the inbox level of the commitment the game is refuting. This is only used when checkingBlocked_step
proofs---the proof will show that the next message available ininbox_snapshot
is atlevel
, so shouldn't be included in this commitment.
game_state
, the current state of the game, seegame_state
for more information.
Invariants: -----------
dissection
must contain at least 2 values (normally it will be 32 values, but smaller if there isn't enough space for a dissection that size. The initial game dissection will be 3 values except in the case of a zero-tick commit when it will have 2 values.)- the first state hash value in
dissection
must not beNone
inbox_snapshot
anddal_snapshot
never change once the game is created
val encoding : t Tezos_protocol_environment_alpha.Data_encoding.t
val pp_dissection :
Tezos_protocol_environment_alpha.Format.formatter ->
dissection_chunk list ->
unit
val player_encoding : player Tezos_protocol_environment_alpha.Data_encoding.t
val pp : Tezos_protocol_environment_alpha.Format.formatter -> t -> unit