package tezos-protocol-013-PtJakart
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=ad9e08819871c75ba6f4530b125f7d157799398e4d77a1e6bfea9d91ff37ff55
sha512=c5dc4d40cc09bc6980fbbdb5c2e105bf4252cf9cfcb2b49660b0ebe4dc789f6709ec3b3bf2f87d81580d3eed9521eeb1c960f24d9b14eb0285aaba1f84d10a9b
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.