@@ -13,11 +13,11 @@ open import Data.List.Relation.Unary.Any using (here)
13
13
14
14
open import Leios.SpecStructure
15
15
16
- module Leios.Simple.Deterministic (⋯ : SpecStructure) (let open SpecStructure ⋯) where
16
+ module Leios.Simple.Deterministic (⋯ : SpecStructure 2 ) (let open SpecStructure ⋯) (Λ μ : ℕ ) where
17
17
18
- import Leios.Simple
19
- open import Leios.Simple ⋯ hiding (_-⟦_/_⟧⇀_)
20
- module ND = Leios.Simple ⋯
18
+ import Leios.Simplified
19
+ open import Leios.Simplified ⋯ Λ μ hiding (_-⟦_/_⟧⇀_)
20
+ module ND = Leios.Simplified ⋯ Λ μ
21
21
22
22
open import Class.Computational
23
23
open import Class.Computational22
@@ -37,7 +37,7 @@ private variable s s' s0 s1 s2 s3 s4 s5 : LeiosState
37
37
ks ks' : K.State
38
38
msgs : List (FFDAbstract.Header ffdAbstract ⊎ FFDAbstract.Body ffdAbstract)
39
39
eb : EndorserBlock
40
- ebs : List EndorserBlock
40
+ rbs : List RankingBlock
41
41
txs : List Tx
42
42
V : VTy
43
43
SD : StakeDistr
@@ -61,15 +61,15 @@ data _-⟦Base⟧⇀_ : LeiosState → LeiosState → Type where
61
61
62
62
Base₂a : ∀ {ebs} → let open LeiosState s renaming (BaseState to bs) in
63
63
∙ needsUpkeep Base
64
- ∙ eb ∷ ebs ≡ filter (λ eb → isVote2Certified votingState eb × eb ∈ᴮ slice L slot 2 ) EBs
65
- ∙ bs B.-⟦ B.SUBMIT (inj₁ eb) / B.EMPTY ⟧⇀ bs'
64
+ ∙ eb ∷ ebs ≡ filter (λ eb → isVote2Certified s eb × eb ∈ᴮ slice L slot 2 ) EBs
65
+ ∙ bs B.-⟦ B.SUBMIT (this eb) / B.EMPTY ⟧⇀ bs'
66
66
───────────────────────────────────────────────────────────────────────
67
67
s -⟦Base⟧⇀ addUpkeep record s { BaseState = bs' } Base
68
68
69
69
Base₂b : let open LeiosState s renaming (BaseState to bs) in
70
70
∙ needsUpkeep Base
71
- ∙ [] ≡ filter (λ eb → isVote2Certified votingState eb × eb ∈ᴮ slice L slot 2 ) EBs
72
- ∙ bs B.-⟦ B.SUBMIT (inj₂ ToPropose) / B.EMPTY ⟧⇀ bs'
71
+ ∙ [] ≡ filter (λ eb → isVote2Certified s eb × eb ∈ᴮ slice L slot 2 ) EBs
72
+ ∙ bs B.-⟦ B.SUBMIT (that ToPropose) / B.EMPTY ⟧⇀ bs'
73
73
───────────────────────────────────────────────────────────────────────
74
74
s -⟦Base⟧⇀ addUpkeep record s { BaseState = bs' } Base
75
75
@@ -80,7 +80,7 @@ Base⇒ND (Base₂b x x₁ x₂) = Base₂b x x₁ x₂
80
80
opaque
81
81
Base-total : LeiosState.needsUpkeep s Base → ∃[ s' ] s -⟦Base⟧⇀ s'
82
82
Base-total {s = s} needsUpkeep with
83
- (let open LeiosState s in filter (λ eb → isVote2Certified votingState eb × eb ∈ᴮ slice L slot 2 ) EBs)
83
+ (let open LeiosState s in filter (λ eb → isVote2Certified s eb × eb ∈ᴮ slice L slot 2 ) EBs)
84
84
in eq
85
85
... | [] = -, Base₂b needsUpkeep (sym eq) (proj₂ B.SUBMIT-total)
86
86
... | x ∷ l = -, Base₂a needsUpkeep (sym eq) (proj₂ B.SUBMIT-total)
@@ -108,8 +108,8 @@ data _-⟦IB-Role⟧⇀_ : LeiosState → LeiosState → Type where
108
108
s -⟦IB-Role⟧⇀ addUpkeep s IB-Role
109
109
110
110
IB-Role⇒ND : s -⟦IB-Role⟧⇀ s' → just s ND.-⟦ SLOT / EMPTY ⟧⇀ s'
111
- IB-Role⇒ND (IB-Role x x₁ x₂) = IB-Role x x₁ x₂
112
- IB-Role⇒ND (No-IB-Role x x₁) = No-IB-Role x x₁
111
+ IB-Role⇒ND (IB-Role x x₁ x₂) = Roles ( IB-Role x x₁ x₂)
112
+ IB-Role⇒ND (No-IB-Role x x₁) = Roles ( No-IB-Role x x₁)
113
113
114
114
opaque
115
115
IB-Role-total : LeiosState.needsUpkeep s IB-Role → ∃[ s' ] s -⟦IB-Role⟧⇀ s'
@@ -125,7 +125,7 @@ data _-⟦EB-Role⟧⇀_ : LeiosState → LeiosState → Type where
125
125
126
126
EB-Role : let open LeiosState s renaming (FFDState to ffds)
127
127
LI = map getIBRef $ filter (_∈ᴮ slice L slot (Λ + 1 )) IBs
128
- LE = map getEBRef $ filter (isVote1Certified votingState ) $
128
+ LE = map getEBRef $ filter (isVote1Certified s ) $
129
129
filter (_∈ᴮ slice L slot (μ + 2 )) EBs
130
130
h = mkEB slot id π sk-EB LI LE
131
131
in
@@ -142,8 +142,8 @@ data _-⟦EB-Role⟧⇀_ : LeiosState → LeiosState → Type where
142
142
s -⟦EB-Role⟧⇀ addUpkeep s EB-Role
143
143
144
144
EB-Role⇒ND : s -⟦EB-Role⟧⇀ s' → just s ND.-⟦ SLOT / EMPTY ⟧⇀ s'
145
- EB-Role⇒ND (EB-Role x x₁ x₂) = EB-Role x x₁ x₂
146
- EB-Role⇒ND (No-EB-Role x x₁) = No-EB-Role x x₁
145
+ EB-Role⇒ND (EB-Role x x₁ x₂) = Roles ( EB-Role x x₁ x₂)
146
+ EB-Role⇒ND (No-EB-Role x x₁) = Roles ( No-EB-Role x x₁)
147
147
148
148
opaque
149
149
EB-Role-total : LeiosState.needsUpkeep s EB-Role → ∃[ s' ] s -⟦EB-Role⟧⇀ s'
@@ -172,8 +172,8 @@ data _-⟦V1-Role⟧⇀_ : LeiosState → LeiosState → Type where
172
172
s -⟦V1-Role⟧⇀ addUpkeep s V1-Role
173
173
174
174
V1-Role⇒ND : s -⟦V1-Role⟧⇀ s' → just s ND.-⟦ SLOT / EMPTY ⟧⇀ s'
175
- V1-Role⇒ND (V1-Role x x₁ x₂) = V1-Role x x₁ x₂
176
- V1-Role⇒ND (No-V1-Role x x₁) = No-V1-Role x x₁
175
+ V1-Role⇒ND (V1-Role x x₁ x₂) = Roles ( V1-Role x x₁ x₂)
176
+ V1-Role⇒ND (No-V1-Role x x₁) = Roles ( No-V1-Role x x₁)
177
177
178
178
V1-Role-Upkeep : s -⟦V1-Role⟧⇀ s' → LeiosState.needsUpkeep s V1-Role × ¬ LeiosState.needsUpkeep s' V1-Role
179
179
V1-Role-Upkeep (V1-Role x x₁ x₂) = x , addUpkeep⇒¬needsUpkeep
@@ -198,8 +198,8 @@ data _-⟦V2-Role⟧⇀_ : LeiosState → LeiosState → Type where
198
198
s -⟦V2-Role⟧⇀ addUpkeep s V2-Role
199
199
200
200
V2-Role⇒ND : s -⟦V2-Role⟧⇀ s' → just s ND.-⟦ SLOT / EMPTY ⟧⇀ s'
201
- V2-Role⇒ND (V2-Role x x₁ x₂) = V2-Role x x₁ x₂
202
- V2-Role⇒ND (No-V2-Role x x₁) = No-V2-Role x x₁
201
+ V2-Role⇒ND (V2-Role x x₁ x₂) = Roles ( V2-Role x x₁ x₂)
202
+ V2-Role⇒ND (No-V2-Role x x₁) = Roles ( No-V2-Role x x₁)
203
203
204
204
V2-Role-Upkeep : s -⟦V2-Role⟧⇀ s' → LeiosState.needsUpkeep s V2-Role × ¬ LeiosState.needsUpkeep s' V2-Role
205
205
V2-Role-Upkeep (V2-Role x x₁ x₂) = x , addUpkeep⇒¬needsUpkeep
@@ -215,14 +215,14 @@ data _-⟦_/_⟧⇀_ : LeiosState → LeiosInput → LeiosOutput → LeiosState
215
215
Slot : let open LeiosState s renaming (FFDState to ffds; BaseState to bs)
216
216
s0 = record s
217
217
{ FFDState = ffds'
218
- ; Ledger = constructLedger ebs
218
+ ; Ledger = constructLedger rbs
219
219
; slot = suc slot
220
220
; Upkeep = ∅
221
221
; BaseState = bs'
222
222
} ↑ L.filter isValid? msgs
223
223
in
224
224
∙ Upkeep ≡ᵉ allUpkeep
225
- ∙ bs B.-⟦ B.FTCH-LDG / B.BASE-LDG ebs ⟧⇀ bs'
225
+ ∙ bs B.-⟦ B.FTCH-LDG / B.BASE-LDG rbs ⟧⇀ bs'
226
226
∙ ffds FFD.-⟦ Fetch / FetchRes msgs ⟧⇀ ffds'
227
227
∙ s0 -⟦Base⟧⇀ s1
228
228
∙ s1 -⟦IB-Role⟧⇀ s2
@@ -244,7 +244,7 @@ data _-⟦_/_⟧⇀_ : LeiosState → LeiosInput → LeiosOutput → LeiosState
244
244
245
245
Base₁ :
246
246
──────────────────────────────────────────────────────────────
247
- s -⟦ SUBMIT txs / EMPTY ⟧⇀ record s { ToPropose = txs }
247
+ s -⟦ SUBMIT (inj₂ txs) / EMPTY ⟧⇀ record s { ToPropose = txs }
248
248
249
249
-- Protocol rules
250
250
0 commit comments