Skip to content

Commit e8eac02

Browse files
authored
Prove that EPOCH not depends on expired dreps (#941)
1 parent a62d7e6 commit e8eac02

File tree

8 files changed

+793
-45
lines changed

8 files changed

+793
-45
lines changed

flake.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{-# OPTIONS --safe --no-import-sorts #-}
2+
open import Axiom.Set using (Theory)
3+
4+
module abstract-set-theory.Axiom.Set.Properties {ℓ} (th : Theory {ℓ}) where
5+
6+
open import abstract-set-theory.Prelude hiding (isEquivalence; trans; map; map₂)
7+
open Theory th
8+
9+
open Equivalence
10+
11+
private variable
12+
A B C : Type ℓ
13+
X Y Z : Set A
14+
15+
module _ {P Q : A Type} {sp-P : specProperty P} {sp-Q : specProperty Q} where
16+
17+
open import Relation.Unary using (_⇒_; Universal)
18+
19+
filter-⇒ : (P⇒Q : Universal (P ⇒ Q)) filter sp-P (filter sp-Q X) ≡ᵉ filter sp-P X
20+
filter-⇒ P⇒Q = filter-⇒-⊆ , filter-⇒-⊇
21+
where
22+
filter-⇒-⊆ : filter sp-P (filter sp-Q X) ⊆ filter sp-P X
23+
filter-⇒-⊆ p with from ∈-filter p
24+
... | (q , p) with from ∈-filter p
25+
... | (_ , p) = to ∈-filter (q , p)
26+
27+
filter-⇒-⊇ : filter sp-P X ⊆ filter sp-P (filter sp-Q X)
28+
filter-⇒-⊇ p with from ∈-filter p
29+
... | (q , p) = to ∈-filter (q , (to ∈-filter (P⇒Q _ q , p)))
30+
31+
module _ {P : A Type} {sp-P : specProperty P} {Q : B Type} {sp-Q : specProperty Q} where
32+
33+
open import Relation.Unary using (_⇒_; Universal)
34+
35+
filter-map : {f : A B} (Qf⇒P : Universal ((Q ∘ f) ⇒ P))
36+
filter sp-Q (map f X) ≡ᵉ filter sp-Q (map f (filter sp-P X))
37+
filter-map {f = f} Qf⇒P = filter-map-⊆ , filter-map-⊇
38+
where
39+
filter-map-⊆ : filter sp-Q (map f X) ⊆ filter sp-Q (map f (filter sp-P X))
40+
filter-map-⊆ p with from ∈-filter p
41+
... | Qa , p with from ∈-map p
42+
... | (a , refl , p) = to ∈-filter (Qa , (to ∈-map (_ , (refl , (to ∈-filter (Qf⇒P a Qa , p))))))
43+
44+
filter-map-⊇ : filter sp-Q (map f (filter sp-P X)) ⊆ filter sp-Q (map f X)
45+
filter-map-⊇ p with from ∈-filter p
46+
... | Qfa , p with from ∈-map p
47+
... | (a , refl , p) with from ∈-filter p
48+
... | (Pa , p) = to ∈-filter (Qfa , (to ∈-map (a , (refl , p))))

src/Ledger/Conway/Specification/Enact/Properties/Computational.lagda.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ open EnactState
1919
2020
open Computational ⦃...⦄
2121
22+
module _ {Γ : EnactEnv} {eSt : EnactState} {ga : GovAction} where
23+
24+
-- TODO: Make this follow from computationalness or viceversa
25+
ENACT-deterministic : ∀ {eSt' eSt''}
26+
→ Γ ⊢ eSt ⇀⦇ ga ,ENACT⦈ eSt'
27+
→ Γ ⊢ eSt ⇀⦇ ga ,ENACT⦈ eSt''
28+
→ eSt' ≡ eSt''
29+
ENACT-deterministic Enact-NoConf Enact-NoConf = refl
30+
ENACT-deterministic (Enact-UpdComm _) (Enact-UpdComm _) = refl
31+
ENACT-deterministic Enact-NewConst Enact-NewConst = refl
32+
ENACT-deterministic Enact-HF Enact-HF = refl
33+
ENACT-deterministic Enact-PParams Enact-PParams = refl
34+
ENACT-deterministic (Enact-Wdrl _) (Enact-Wdrl _) = refl
35+
ENACT-deterministic Enact-Info Enact-Info = refl
36+
2237
instance
2338
Computational-ENACT : Computational _⊢_⇀⦇_,ENACT⦈_ String
2439
Computational-ENACT .computeProof Γᵉ s =

src/Ledger/Conway/Specification/Epoch.lagda.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -713,34 +713,35 @@ module Post-POOLREAPUpdate (es : EnactState)
713713
```agda
714714
open LState
715715
open Governance-Update govUpd
716-
opaque
717716
```
718717
-->
719718
```agda
719+
opaque
720720
govActionReturns : RwdAddr ⇀ Coin
721721
govActionReturns =
722722
aggregate₊ (mapˢ (λ (a , _ , d) → a , d) removedGovActions ᶠˢ)
723723
724724
payout : RwdAddr ⇀ Coin
725725
payout = govActionReturns ∪⁺ WithdrawalsOf es
726726
727+
opaque
727728
refunds : Credential ⇀ Coin
728729
refunds = pullbackMap payout toRwdAddr (dom (RewardsOf dState'))
729730
730-
dState'' : DState
731-
dState'' = ⟦ VoteDelegsOf dState' , StakeDelegsOf dState' , RewardsOf dState' ∪⁺ refunds ⟧
731+
dState'' : DState
732+
dState'' = ⟦ VoteDelegsOf dState' , StakeDelegsOf dState' , RewardsOf dState' ∪⁺ refunds ⟧
732733
733-
unclaimed : Coin
734-
unclaimed = getCoin payout - getCoin refunds
734+
unclaimed : Coin
735+
unclaimed = getCoin payout - getCoin refunds
735736
736-
totWithdrawals : Coin
737-
totWithdrawals = ∑[ x ← WithdrawalsOf es ] x
737+
totWithdrawals : Coin
738+
totWithdrawals = ∑[ x ← WithdrawalsOf es ] x
738739
739-
acnt'' : Acnt
740-
acnt'' = ⟦ TreasuryOf acnt' ∸ totWithdrawals + DonationsOf ls + unclaimed , ReservesOf acnt' ⟧
740+
acnt'' : Acnt
741+
acnt'' = ⟦ TreasuryOf acnt' ∸ totWithdrawals + DonationsOf ls + unclaimed , ReservesOf acnt' ⟧
741742
742-
updates : Post-POOLREAP-Update
743-
updates = Post-POOLREAPUpdate dState'' acnt''
743+
updates : Post-POOLREAP-Update
744+
updates = Post-POOLREAPUpdate dState'' acnt''
744745
```
745746

746747
### Transition Rule

src/Ledger/Conway/Specification/Epoch/Properties.lagda.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module Ledger.Conway.Specification.Epoch.Properties where
1010
1111
open import Ledger.Conway.Specification.Epoch.Properties.Computational
1212
open import Ledger.Conway.Specification.Epoch.Properties.ConstRwds
13+
open import Ledger.Conway.Specification.Epoch.Properties.ExpiredDReps
1314
open import Ledger.Conway.Specification.Epoch.Properties.GovDepsMatch
1415
open import Ledger.Conway.Specification.Epoch.Properties.NoPropSameDReps
1516
```

0 commit comments

Comments
 (0)