@@ -398,10 +398,9 @@ applyRUpd rewardUpdate ⟦ ⟦ treasury , reserves ⟧ᵃ
398398## Stake Distributions {#sec: stake-distributions }
399399
400400This section defines the functions
401- ` calculatePoolDelegatedStake ` {.AgdaFunction},
402- ` calculateVDelegDelegatedStake ` {.AgdaFunction}, and
403- ` mkStakeDistrs ` {.AgdaFunction}, which calculates stake distributions
404- for voting purposes.
401+ ` calculatePoolDelegatedStake ` {.AgdaFunction} and
402+ ` calculateVDelegDelegatedStake ` {.AgdaFunction}, which calculate stake
403+ distributions for voting purposes.
405404
406405<!--
407406```agda
@@ -525,20 +524,6 @@ the deposits made to governance actions.
525524 count deposits on governance actions towards the stake of
526525 `SPOs`{.AgdaInductiveConstructor} as well.
527526
528- ``` agda
529- mkStakeDistrs
530- : Snapshot
531- → Epoch
532- → UTxOState
533- → GovState
534- → GState
535- → DState
536- → StakeDistrs
537- mkStakeDistrs ss currentEpoch utxoSt govSt gState dState =
538- ⟦ calculateVDelegDelegatedStake currentEpoch utxoSt govSt gState dState
539- , calculatePoolDelegatedStakeForVoting ss govSt ⟧
540- ```
541-
542527<!--
543528```agda
544529private variable
@@ -730,7 +715,7 @@ module Post-POOLREAPUpdate (es : EnactState)
730715
731716This section defines the ` EPOCH ` {.AgdaDatatype} transition rule.
732717
733- In Conway, the ` EPOCH ` {.AgdaDatatype} rule invokes ` RATIFIES ` {.AgdaDatatype},
718+ In Dijkstra the ` EPOCH ` {.AgdaDatatype} rule invokes ` RATIFIES ` {.AgdaDatatype},
734719and carries out the following tasks:
735720
736721+ payout all the enacted treasury withdrawals;
@@ -743,10 +728,16 @@ and carries out the following tasks:
743728+ remove all hot keys from the constitutional committee delegation map
744729 that do not belong to currently elected members;
745730
746- + Apply the resulting enact state from the previous epoch boundary
747- ` fut ` {.AgdaBound} and store the resulting enact state
731+ + apply the resulting enact state from the previous epoch boundary
732+ ` fut ` {.AgdaBound} and store the new enact state
748733 ` fut’ ` {.AgdaBound}.
749734
735+ Unlike Conway, where the mark snapshot is taken before updating the
736+ ledger state, in Dijkstra the ` EPOCH ` {.AgdaDatatype} rule invokes the
737+ ` SNAP ` {.AgdaDatatype} rule _ after_ updating the ledger state. This
738+ change affects the stake distribution used for leader election and
739+ distributing rewards, and for voting on governance actions.
740+
750741``` agda
751742data _⊢_⇀⦇_,EPOCH⦈_ : ⊤ → EpochState → Epoch → EpochState → Type where
752743```
@@ -767,19 +758,25 @@ data _⊢_⇀⦇_,EPOCH⦈_ : ⊤ → EpochState → Epoch → EpochState → Ty
767758 govSt' : GovState
768759 govSt' = Governance-Update.govSt' govUpd
769760
770- stakeDistrs : StakeDistrs
771- stakeDistrs = mkStakeDistrs (Snapshots.mark ss') e utxoSt'
772- govSt' (GStateOf ls) (DStateOf ls)
761+ ls' : LedgerState
762+ ls' = ⟦ utxoSt' , govSt' , ⟦ dState'' , pState'' , gState' ⟧ᶜˢ ⟧
773763
774764 Γ : RatifyEnv
775- Γ = ⟦ stakeDistrs , e , DRepsOf ls , CCHotKeysOf ls , TreasuryOf acnt'' , PoolsOf ls , VoteDelegsOf ls ⟧
765+ Γ = ⟦ calculateVDelegDelegatedStake e utxoSt' govSt' gState' dState''
766+ , calculatePoolDelegatedStakeForVoting (Snapshots.mark ss') govSt'
767+ , e
768+ , DRepsOf ls'
769+ , CCHotKeysOf ls'
770+ , TreasuryOf acnt''
771+ , PoolsOf ls'
772+ , VoteDelegsOf ls' ⟧
776773
777774 in
778- ls ⊢ ss ⇀⦇ tt ,SNAP⦈ ss'
779775 ∙ _ ⊢ ⟦ acnt , DStateOf ls , pState' ⟧ ⇀⦇ e ,POOLREAP⦈ ⟦ acnt' , dState' , pState'' ⟧
776+ ∙ ls' ⊢ ss ⇀⦇ tt ,SNAP⦈ ss'
780777 ∙ Γ ⊢ ⟦ es' , ∅ , false ⟧ ⇀⦇ govSt' ,RATIFIES⦈ fut'
781778 ──────────────────────────────────────────────
782- _ ⊢ ⟦ acnt , ss , ls , es₀ , fut ⟧ ⇀⦇ e ,EPOCH⦈ ⟦ acnt'' , ss' , ⟦ utxoSt' , govSt' , ⟦ dState'' , pState'' , gState' ⟧ᶜˢ ⟧ , es' , fut' ⟧
779+ _ ⊢ ⟦ acnt , ss , ls , es₀ , fut ⟧ ⇀⦇ e ,EPOCH⦈ ⟦ acnt'' , ss' , ls' , es' , fut' ⟧
783780```
784781
785782## The <span class =" AgdaDatatype " >NEWEPOCH</span > Transition System {#sec: the-newepoch-transition-system }
0 commit comments