package tezos-protocol-013-PtJakart
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-013-PtJakart.raw/Tezos_raw_protocol_013_PtJakart/Sc_rollup_game/Make/index.html
Module Sc_rollup_game.MakeSource
Parameters
module PVM : Sc_rollup_PVM_sem.SSignature
module PVM :
Sc_rollup_PVM_sem.S
with type state = PVM.state
and type proof = PVM.proof
and type context = PVM.contextThe game has two players. The refuter starts.
type t = {turn : player;start_state : PVM.hash;start_at : tick;player_stop_state : PVM.hash;opponent_stop_state : PVM.hash;stop_at : tick;current_dissection : Section.dissection option;
}A game state is characterized by:
turn, the player that must provide the next move.
start_state/start_at, the state the two players agree on.
player_stop_stateandopponent_stop_stateare distinct as the two players disagree on the final state.
stop_atis the position of the final state.
- If the cardinal of
current_dissectionis strictly greater than 1, the current player must choose one of its section and produce a dissection of this section.
- If the cardinal of
current_dissectionis equal to 1, the game has reached its second phase and the current player must provide a proof of the execution step atstart_at.
Invariants: -----------
current_dissectioncannot be empty.start_atis strictly less thanstop_at.player_stop_stateis distinct fromopponent_stop_state.
type conflict_resolution_step = | Refine of {stop_state : PVM.hash;next_dissection : Section.dissection;
}(*Assuming a current
*)dissection, asectionhas been chosen andnext_dissectionis a dissection of this section.stop_stateis a state which is different from the one exposed in for thesectionin the currentdissection.| Conclude of Sc_rollup_PVM_sem.input option * PVM.proof(*When the current
dissectioncontains a single section of length 1, the conflict tick has been found. The player provides aPVM.proofto demonstrate that her final state is the correct one.If the current state is an input state (see
*)Sc_rollup_PVM_sem), the player must provide theinputreceived by the PVM. Notice that the validity of thisinputis externally verified using theSc_rollup_inboxproofs.
The conflict resolution is done in two phases: the refinement phase composed of refinement steps and a final step, the conclusion.
type move = | ConflictInside of {choice : Section.section;conflict_resolution_step : conflict_resolution_step;
}
A game move is a conflict resolution step performed in a given section of the PVM execution trace.
To start the game, the committer must have made a section public...
... and the refuter must have started a dispute.
type reason = | InvalidMove(*One of the player did not respect the game rules, typically by providing a refinement step which is inconsistent with the current dissection.
*)| ConflictResolved(*The game reached the conclusion and the arbiter was able to determine how the conflict must be resolved in conformance with the PVM semantics.
*)
The game can stop for two reasons:
The game can end with no winner if both players have wrong final states at the conflicting step.
After one game move, the game can be over or ongoing.
initial is the initial game state from the commit and the refutation. The first player to play is the refuter, this function also returns refuter's first move.
play game move returns the result of the given move applied on game.