Skip to content

Commit 1ae6334

Browse files
committed
fix docs to reflect changes to certs rule
1 parent 2ecec7b commit 1ae6334

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

build-tools/static/md/mkdocs/includes/links.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
[Auxiliary POOL transition system]: Ledger.Conway.Specification.Certs.md#auxiliary-pool-transition-system
77
[Calculation of Fees for Reference Scripts]: Ledger.Conway.Specification.Fees.md#sec:calculation-of-fees
88
[Cardano Staking: How To Stake ADA]: https://www.ledger.com/academy/cardano-staking-how-to-stake-ada
9-
[CERT]: Ledger.Conway.Specification.Certs.md#certs-rules
10-
[CERTS]: Ledger.Conway.Specification.Certs.md#certs-rules
11-
[CERTS rules]: Ledger.Conway.Specification.Certs.md#certs-rules
9+
[CERT]: Ledger.Conway.Specification.Certs.md#sec:the-certs-transition-system
10+
[CERTS]: Ledger.Conway.Specification.Certs.md#sec:the-certs-transition-system
11+
[CERTS rules]: Ledger.Conway.Specification.Certs.md#sec:the-certs-transition-system
1212
[CHAIN]: Ledger.Conway.Specification.Chain.md#chain-transition-system
1313
[DELEG]: Ledger.Conway.Specification.Certs.md#auxiliary-deleg-transition-system
1414
[ENACT]: Ledger.Conway.Specification.Enact.md#enact-transition-system

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

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ data _⊢_⇀⦇_,GOVCERT⦈_ : CertEnv → GState → DCert → GState → Type
504504
⟦ e , pp , vs , wdrls , cc ⟧ ⊢ ⟦ dReps , ccKeys ⟧ ⇀⦇ ccreghot c mc ,GOVCERT⦈ ⟦ dReps , ❴ c , mc ❵ ∪ˡ ccKeys ⟧
505505
```
506506

507-
## The <span class="AgdaDatatype">CERTS</span> Transition System
507+
## The <span class="AgdaDatatype">CERTS</span> Transition System {#sec:the-certs-transition-system}
508508

509509
This section culminates in the definition of the `CERTS`{.AgdaDatatype} transition
510510
system by bundling previously defined pieces together into a
@@ -532,18 +532,26 @@ data _⊢_⇀⦇_,CERT⦈_ : CertEnv → CertState → DCert → CertState →
532532
Γ ⊢ ⟦ stᵈ , stᵖ , stᵍ ⟧ ⇀⦇ dCert ,CERT⦈ ⟦ stᵈ , stᵖ , stᵍ' ⟧
533533
```
534534

535-
### The <span class="AgdaFunction">CERTBASE</span> Function
535+
### The <span class="AgdaFunction">PRE-CERT</span> Transition Rule
536536

537-
Here we define the `CERTBASE`{.AgdaFunction} function which handles the following
537+
Here we define the `PRE-CERT`{.AgdaDatatype} transition rule. This rule is applied
538+
at the start of the `CERTS`{.AgdaDatatype} transition rule and handles the following
538539
important housekeeping tasks:
539540

540541
+ check the correctness of withdrawals and ensure that withdrawals only
541542
happen from credentials that have delegated their voting power;
542543

543-
+ set the rewards of the credentials that withdrew funds to zero;
544+
+ set the activity timer of all `DRep`{.AgdaInductiveConstructor}s that voted
545+
to `drepActivity`{.AgdaField} epochs in the future;
544546

545-
+ and set the activity timer of all `DRep`{.AgdaInductiveConstructor}s that voted
546-
to `drepActivity`{.AgdaField} epochs in the future.
547+
+ set the rewards of the credentials that withdrew funds to zero.
548+
549+
Regarding the second item, if there is a new governance proposal to vote on in this transaction,
550+
then expiry for all `DReps`{.AgdaInductiveConstructor} will be increased by
551+
the number of dormant epochs. However, the `PRE-CERT`{.AgdaDatatype} transition occurs in
552+
`LEDGER`{.AgdaDatatype} *before* the `GOV`{.AgdaDatatype} rule, so it cannot validate
553+
any governance proposal. This is not a problem since the entire transaction will
554+
fail if the proposal is not accepted in the `GOV`{.AgdaDatatype} rule.
547555

548556
<!--
549557
```agda
@@ -562,18 +570,20 @@ data _⊢_⇀⦇_,PRE-CERT⦈_ : CertEnv → CertState → ⊤ → CertState →
562570
∙ filter isKeyHash wdrlCreds ⊆ dom voteDelegs
563571
∙ mapˢ (map₁ stake) (wdrls ˢ) ⊆ rewards ˢ
564572
────────────────────────────────
565-
⟦ e , pp , vs , wdrls , cc ⟧ ⊢ ⟦ ⟦ voteDelegs , stakeDelegs , rewards ⟧ , stᵖ , ⟦ dReps , ccHotKeys ⟧ ⟧
566-
⇀⦇ _ ,PRE-CERT⦈
567-
⟦ ⟦ voteDelegs , stakeDelegs , constMap wdrlCreds 0 ∪ˡ rewards ⟧ , stᵖ , ⟦ refreshedDReps , ccHotKeys ⟧ ⟧
573+
⟦ e , pp , vs , wdrls , cc ⟧ ⊢ ⟦ ⟦ voteDelegs , stakeDelegs , rewards ⟧ , stᵖ , ⟦ dReps , ccHotKeys ⟧ ⟧ ⇀⦇ _ ,PRE-CERT⦈ ⟦ ⟦ voteDelegs , stakeDelegs , constMap wdrlCreds 0 ∪ˡ rewards ⟧ , stᵖ , ⟦ refreshedDReps , ccHotKeys ⟧ ⟧
574+
```
575+
576+
### The <span class="AgdaFunction">POST-CERT</span> Transition Rule
568577

578+
The `POST-CERT`{.AgdaFunction} transition rule is applied at the end of the
579+
`CERTS`{.AgdaDatatype} rule and it ensures that only valid registered
580+
`DReps`{.AgdaInductiveConstructor} are included in the final `CertState`{.AgdaRecord}.
581+
582+
```agda
569583
data _⊢_⇀⦇_,POST-CERT⦈_ : CertEnv → CertState → ⊤ → CertState → Type where
570584
571585
CERT-post :
572-
⟦ e , pp , vs , wdrls , cc ⟧
573-
⊢ ⟦ ⟦ voteDelegs , stakeDelegs , rewards ⟧ , stᵖ , stᵍ ⟧
574-
⇀⦇ _ ,POST-CERT⦈
575-
⟦ ⟦ voteDelegs ∣^ ( mapˢ vDelegCredential (dom (GState.dreps stᵍ)) ∪ fromList (vDelegNoConfidence ∷ vDelegAbstain ∷ []) )
576-
, stakeDelegs , rewards ⟧ , stᵖ , stᵍ ⟧
586+
⟦ e , pp , vs , wdrls , cc ⟧ ⊢ ⟦ ⟦ voteDelegs , stakeDelegs , rewards ⟧ , stᵖ , stᵍ ⟧ ⇀⦇ _ ,POST-CERT⦈ ⟦ ⟦ voteDelegs ∣^ (mapˢ vDelegCredential (dom (DRepsOf stᵍ)) ∪ fromList (vDelegNoConfidence ∷ vDelegAbstain ∷ [])) , stakeDelegs , rewards ⟧ , stᵖ , stᵍ ⟧
577587
578588
_⊢_⇀⦇_,CERTS⦈_ : CertEnv → CertState → List DCert → CertState → Type
579589
_⊢_⇀⦇_,CERTS⦈_ = RunTraceAfterAndThen _⊢_⇀⦇_,PRE-CERT⦈_ _⊢_⇀⦇_,CERT⦈_ _⊢_⇀⦇_,POST-CERT⦈_

0 commit comments

Comments
 (0)