Stateful Protocol. #
History Protocol takes into account the whole history of the L2 Protocol.
The main difference is that blocks are conditional valid depending on the elements that were added before the current block (the History.)
Main Definition is that valid now checks that elements do not occurr more than once across the whole history. Here we are a bit redundant, because historic non-duplication implies local non-duplication. However, we choosed to follow a compositional approach. Eventually, we may be interested in adding more properties and it is worth exploring such approach.
So historical_valid
is local_valid
plus no-duplicates accross history.
Lemma historical_concat
characterizes the evolution of the
definition historical_valid
everytime we add a new block.
Since the protocol evolves linearly adding new blocks, this lemma simplifies the
following proofs.
Player two, the player acting as challenger, on top of the previous moves
defined in L2.lean
file, can also challenge new blocks of duplicating elements
across history.
- Local {α ℍ : Type} (ll : P2_Actions α ℍ) : P2_History_Actions α ℍ
- DupHistory_Actions {α ℍ : Type} (epoch n : ℕ) (en : α) (path_p : ISkeleton n) (str_p : Sequence n (ℍ × ℍ × ℍ → Option ChooserSmp)) (m : ℕ) (em : α) (path_q : ISkeleton m) (str_q : Sequence m (ℍ × ℍ × ℍ → Option ChooserSmp)) : P2_History_Actions α ℍ
Instances For
Player one actions are defending the elements they present.
Duplicates in History #
We define how we find elements and duplicates.
Equations
- find_first_dup_in_history elems hist = split_at_first_pred (fun (e : BTree α × ℍ) => find_intersect (fun (x : Skeleton × α) => x.2) e.1.toPaths_elems elems) hist
Instances For
Honest PLayer #
Honest players check new blocks to see if they check the required conditions and if not, they build a challengin move.
L2 History Protocol #
The protocol consists on a player providing information and another player challenging such information. Since we do not have IO here, all players must build and provide all strategies before hand.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Theorem HistoryProtocol
states that the history protocol when played with an
honest player challenging proposed blocks only accepts correct blocks (->) and
correct blocks are accepted by the protocol (<-).