EPOCH and NEWEPOCH Transition Systems for Dijkstra¶
Modelled on the Conway.Conformance.Epoch module, adapted for Dijkstra:
- Deposits live in
CertState(notUTxOState) SNAPandPOOLREAPoperate onCertStateandAcntrather thanUTxOStateandCertState.- govAction deposit returns are taken from
GState.deposits.
getOrphans : EnactState → GovState → GovState getOrphans es govSt = proj₁ $ iterate step ([] , govSt) (length govSt) where step : GovState × GovState → GovState × GovState step (orps , govSt) = let isOrphan? a prev = ¬? (hasParent? es govSt a prev) (orps' , govSt') = partition (λ (_ , record {action = a ; prevAction = prev}) → isOrphan? (a .gaType) prev) govSt in (orps ++ orps' , govSt') getStakeCred : TxOut → Maybe Credential getStakeCred (a , _ , _ , _) = stakeCred a open GovActionState using (returnAddr) -- open RewardAddress using (stake) PoolDelegatedStake : Type PoolDelegatedStake = KeyHash ⇀ Coin record EpochState : Type where constructor ⟦_,_,_,_,_⟧ᵉ' field acnt : Acnt ss : Snapshots ls : LedgerState es : EnactState fut : RatifyState
record NewEpochState : Type where field lastEpoch : Epoch bprev : BlocksMade bcur : BlocksMade epochState : EpochState ru : Maybe RewardUpdate pd : PoolDelegatedStake
applyRUpd : RewardUpdate → EpochState → EpochState applyRUpd rewardUpdate $\begin{pmatrix} \begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#10350}{\htmlId{10350}{\htmlClass{Bound}{\text{treasury}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10361}{\htmlId{10361}{\htmlClass{Bound}{\text{reserves}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10375}{\htmlId{10375}{\htmlClass{Bound}{\text{ss}}}}\, \\ \begin{pmatrix} \begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#10384}{\htmlId{10384}{\htmlClass{Bound}{\text{utxo}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10391}{\htmlId{10391}{\htmlClass{Bound}{\text{fees}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10398}{\htmlId{10398}{\htmlClass{Bound}{\text{donations}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10413}{\htmlId{10413}{\htmlClass{Bound}{\text{govSt}}}}\, \\ \begin{pmatrix} \begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#10425}{\htmlId{10425}{\htmlClass{Bound}{\text{voteDelegs}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10438}{\htmlId{10438}{\htmlClass{Bound}{\text{stakeDelegs}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10452}{\htmlId{10452}{\htmlClass{Bound}{\text{rewards}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10462}{\htmlId{10462}{\htmlClass{Bound}{\text{deposits}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10476}{\htmlId{10476}{\htmlClass{Bound}{\text{pState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10485}{\htmlId{10485}{\htmlClass{Bound}{\text{gState}}}}\, \end{pmatrix} \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10501}{\htmlId{10501}{\htmlClass{Bound}{\text{es}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10506}{\htmlId{10506}{\htmlClass{Bound}{\text{fut}}}}\, \end{pmatrix}$ = $\begin{pmatrix} \begin{pmatrix} \,\href{Prelude.html#3404}{\htmlId{10521}{\htmlClass{Function}{\text{posPart}}}}\, \,\htmlId{10529}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Epoch.html#1034}{\htmlId{10530}{\htmlClass{InductiveConstructor}{\text{pos}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#10350}{\htmlId{10534}{\htmlClass{Bound}{\text{treasury}}}}\, \,\href{Class.HasAdd.Core.html#162}{\htmlId{10543}{\htmlClass{Field Operator}{\text{+}}}}\, \,\href{Ledger.Dijkstra.Specification.Rewards.html#6508}{\htmlId{10545}{\htmlClass{Function}{\text{Δt}}}}\, \,\href{Class.HasAdd.Core.html#162}{\htmlId{10548}{\htmlClass{Field Operator}{\text{+}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#1034}{\htmlId{10550}{\htmlClass{InductiveConstructor}{\text{pos}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#10895}{\htmlId{10554}{\htmlClass{Function}{\text{unregRU'}}}}\,\,\htmlId{10562}{\htmlClass{Symbol}{\text{)}}}\, \\ \,\href{Prelude.html#3404}{\htmlId{10566}{\htmlClass{Function}{\text{posPart}}}}\, \,\htmlId{10574}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Epoch.html#1034}{\htmlId{10575}{\htmlClass{InductiveConstructor}{\text{pos}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#10361}{\htmlId{10579}{\htmlClass{Bound}{\text{reserves}}}}\, \,\href{Class.HasAdd.Core.html#162}{\htmlId{10588}{\htmlClass{Field Operator}{\text{+}}}}\, \,\href{Ledger.Dijkstra.Specification.Rewards.html#6511}{\htmlId{10590}{\htmlClass{Function}{\text{Δr}}}}\,\,\htmlId{10592}{\htmlClass{Symbol}{\text{)}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10375}{\htmlId{10598}{\htmlClass{Bound}{\text{ss}}}}\, \\ \begin{pmatrix} \begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#10384}{\htmlId{10607}{\htmlClass{Bound}{\text{utxo}}}}\, \\ \,\href{Prelude.html#3404}{\htmlId{10614}{\htmlClass{Function}{\text{posPart}}}}\, \,\htmlId{10622}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Epoch.html#1034}{\htmlId{10623}{\htmlClass{InductiveConstructor}{\text{pos}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#10391}{\htmlId{10627}{\htmlClass{Bound}{\text{fees}}}}\, \,\href{Class.HasAdd.Core.html#162}{\htmlId{10632}{\htmlClass{Field Operator}{\text{+}}}}\, \,\href{Ledger.Dijkstra.Specification.Rewards.html#6514}{\htmlId{10634}{\htmlClass{Function}{\text{Δf}}}}\,\,\htmlId{10636}{\htmlClass{Symbol}{\text{)}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10398}{\htmlId{10640}{\htmlClass{Bound}{\text{donations}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10413}{\htmlId{10654}{\htmlClass{Bound}{\text{govSt}}}}\, \\ \begin{pmatrix} \begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#10425}{\htmlId{10666}{\htmlClass{Bound}{\text{voteDelegs}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10438}{\htmlId{10679}{\htmlClass{Bound}{\text{stakeDelegs}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10452}{\htmlId{10693}{\htmlClass{Bound}{\text{rewards}}}}\, \,\href{Axiom.Set.Map.Dec.html#2149}{\htmlId{10701}{\htmlClass{Function Operator}{\text{∪⁺}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#10831}{\htmlId{10704}{\htmlClass{Function}{\text{regRU}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10462}{\htmlId{10712}{\htmlClass{Bound}{\text{deposits}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10476}{\htmlId{10726}{\htmlClass{Bound}{\text{pState}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10485}{\htmlId{10735}{\htmlClass{Bound}{\text{gState}}}}\, \end{pmatrix} \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10501}{\htmlId{10752}{\htmlClass{Bound}{\text{es}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#10506}{\htmlId{10757}{\htmlClass{Bound}{\text{fut}}}}\, \end{pmatrix}$ where open RewardUpdate rewardUpdate using (Δt; Δr; Δf; rs) regRU = rs ∣ dom rewards unregRU = rs ∣ dom rewards ᶜ unregRU' = ∑[ x ← unregRU ] x
data _⊢_⇀⦇_,EPOCH⦈_ : ⊤ → EpochState → Epoch → EpochState → Type where EPOCH : let open LedgerState ls open RatifyState fut renaming (es to esW) es : EnactState es = record esW { withdrawals = ∅ } tmpGovSt = filter (λ x → ¿ proj₁ x ∉ mapˢ proj₁ removed ¿) govSt orphans : ℙ (GovActionID × GovActionState) orphans = fromList (getOrphans es tmpGovSt) removed' : ℙ (GovActionID × GovActionState) removed' = removed ∪ orphans govSt' = filter (λ x → ¿ proj₁ x ∉ mapˢ proj₁ removed' ¿) govSt removedGovActions : ℙ (RewardAddress × Coin) removedGovActions = mapPartial (λ (gaid , gaSt) → let ra = GovActionState.returnAddr gaSt cred = RewardAddress.stake ra in (ra ,_) <$> lookupᵐ? (DepositsOf (GStateOf ls)) cred) removed' govActionReturns : RewardAddress ⇀ Coin govActionReturns = aggregate₊ (mapˢ (λ (a , d) → a , d) removedGovActions ᶠˢ) trWithdrawals = WithdrawalsOf esW totWithdrawals = ∑[ x ← trWithdrawals ] x retired = (RetiringOf (PStateOf ls)) ⁻¹ e payout = govActionReturns ∪⁺ trWithdrawals refunds = pullbackMap payout toRewardAddress (dom (RewardsOf (DStateOf ls))) unclaimed = getCoin payout - getCoin refunds dState' : DState dState' = record (DStateOf ls) { rewards = (RewardsOf (DStateOf ls)) ∪⁺ refunds } pState' : PState pState' = let ps = PStateOf ls in $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Certs.html#3501}{\htmlId{15693}{\htmlClass{Field}{\text{PoolsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15663}{\htmlId{15701}{\htmlClass{Bound}{\text{ps}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15704}{\htmlClass{Function Operator}{\text{∣}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15271}{\htmlId{15706}{\htmlClass{Bound}{\text{retired}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15714}{\htmlClass{Function Operator}{\text{ᶜ}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Certs.html#2695}{\htmlId{15718}{\htmlClass{Field}{\text{PState.fPools}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15663}{\htmlId{15732}{\htmlClass{Bound}{\text{ps}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15735}{\htmlClass{Function Operator}{\text{∣}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15271}{\htmlId{15737}{\htmlClass{Bound}{\text{retired}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15745}{\htmlClass{Function Operator}{\text{ᶜ}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Certs.html#3608}{\htmlId{15749}{\htmlClass{Field}{\text{RetiringOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15663}{\htmlId{15760}{\htmlClass{Bound}{\text{ps}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15763}{\htmlClass{Function Operator}{\text{∣}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15271}{\htmlId{15765}{\htmlClass{Bound}{\text{retired}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15773}{\htmlClass{Function Operator}{\text{ᶜ}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Certs.html#3268}{\htmlId{15777}{\htmlClass{Field}{\text{DepositsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15663}{\htmlId{15788}{\htmlClass{Bound}{\text{ps}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15791}{\htmlClass{Function Operator}{\text{∣}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#15271}{\htmlId{15793}{\htmlClass{Bound}{\text{retired}}}}\, \,\href{Axiom.Set.Map.html#13606}{\htmlId{15801}{\htmlClass{Function Operator}{\text{ᶜ}}}}\, \end{pmatrix}$ gState' : GState gState' = $\begin{pmatrix} \,\htmlId{15847}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Class.ToBool.html#342}{\htmlId{15848}{\htmlClass{Function Operator}{\text{if}}}}\, \,\href{Data.List.Base.html#4681}{\htmlId{15851}{\htmlClass{Function}{\text{null}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14642}{\htmlId{15856}{\htmlClass{Bound}{\text{govSt'}}}}\, \,\href{Class.ToBool.html#342}{\htmlId{15863}{\htmlClass{Function Operator}{\text{then}}}}\, \,\href{Axiom.Set.Map.html#7108}{\htmlId{15868}{\htmlClass{Function}{\text{mapValues}}}}\, \,\htmlId{15878}{\htmlClass{Symbol}{\text{(}}}\,\,\htmlId{15879}{\htmlClass{Number}{\text{1}}}\, \,\href{Class.HasAdd.Core.html#162}{\htmlId{15881}{\htmlClass{Field Operator}{\text{+\_}}}}\,\,\htmlId{15883}{\htmlClass{Symbol}{\text{)}}}\, \,\htmlId{15885}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Gov.Actions.html#5421}{\htmlId{15886}{\htmlClass{Field}{\text{DRepsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14016}{\htmlId{15894}{\htmlClass{Generalizable}{\text{ls}}}}\,\,\htmlId{15896}{\htmlClass{Symbol}{\text{)}}}\, \,\href{Class.ToBool.html#342}{\htmlId{15898}{\htmlClass{Function Operator}{\text{else}}}}\, \,\htmlId{15903}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Gov.Actions.html#5421}{\htmlId{15904}{\htmlClass{Field}{\text{DRepsOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14016}{\htmlId{15912}{\htmlClass{Generalizable}{\text{ls}}}}\,\,\htmlId{15914}{\htmlClass{Symbol}{\text{))}}}\, , \,\href{Ledger.Dijkstra.Specification.Certs.html#3385}{\htmlId{15935}{\htmlClass{Field}{\text{CCHotKeysOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14016}{\htmlId{15947}{\htmlClass{Generalizable}{\text{ls}}}}\, \,\href{Axiom.Set.Map.html#13536}{\htmlId{15950}{\htmlClass{Function Operator}{\text{∣}}}}\, \,\href{Ledger.Dijkstra.Specification.Enact.html#1770}{\htmlId{15952}{\htmlClass{Function}{\text{ccCreds}}}}\, \,\htmlId{15960}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Enact.html#857}{\htmlId{15961}{\htmlClass{Field}{\text{EnactState.cc}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14318}{\htmlId{15975}{\htmlClass{Bound}{\text{es}}}}\,\,\htmlId{15977}{\htmlClass{Symbol}{\text{)}}}\, , \,\href{Ledger.Dijkstra.Specification.Certs.html#3268}{\htmlId{15997}{\htmlClass{Field}{\text{DepositsOf}}}}\, \,\htmlId{16008}{\htmlClass{Symbol}{\text{(}}}\,\,\href{Ledger.Dijkstra.Specification.Certs.html#4284}{\htmlId{16009}{\htmlClass{Field}{\text{GStateOf}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14016}{\htmlId{16018}{\htmlClass{Generalizable}{\text{ls}}}}\,\,\htmlId{16020}{\htmlClass{Symbol}{\text{)}}}\, \,\htmlId{16040}{\htmlClass{Comment}{\text{-- ∣ mapˢ (RewardAddress.stake ∘ GovActionState.returnAddr ∘ proj₂) removed' ᶜ}}}\, \end{pmatrix}$ certState' : CertState certState' = record { dState = dState' ; pState = pState' ; gState = gState' } -- utxoSt' = ⟦ utxoSt .utxo , utxoSt .fees , utxoSt .deposits ∣ mapˢ (proj₁ ∘ proj₂) removedGovActions ᶜ , 0 ⟧ utxoSt' = UTxOStateOf ls acnt' = record acnt { treasury = TreasuryOf acnt ∸ totWithdrawals + DonationsOf utxoSt + unclaimed } stakeDistrs : StakeDistrs stakeDistrs = mkStakeDistrs (Snapshots.mark ss') e utxoSt' govSt' (GStateOf ls) (DStateOf ls) ratifyΓ : RatifyEnv ratifyΓ = record { stakeDistrs = stakeDistrs ; currentEpoch = e ; dreps = DRepsOf ls ; ccHotKeys = CCHotKeysOf ls ; treasury = TreasuryOf acnt ; pools = PoolsOf ls ; delegatees = VoteDelegsOf ls } in ∙ ratifyΓ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#14318}{\htmlId{17069}{\htmlClass{Bound}{\text{es}}}}\, \\ \,\href{Class.HasEmptySet.html#287}{\htmlId{17074}{\htmlClass{Field}{\text{∅}}}}\, \\ \,\href{Agda.Builtin.Bool.html#192}{\htmlId{17078}{\htmlClass{InductiveConstructor}{\text{false}}}}\, \end{pmatrix}$ ⇀⦇ govSt' ,RATIFIES⦈ fut' ∙ ls ⊢ ss ⇀⦇ tt ,SNAP⦈ ss' ──────────────────────────────── _ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#14035}{\htmlId{17194}{\htmlClass{Generalizable}{\text{acnt}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14068}{\htmlId{17201}{\htmlClass{Generalizable}{\text{ss}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14016}{\htmlId{17206}{\htmlClass{Generalizable}{\text{ls}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14049}{\htmlId{17211}{\htmlClass{Generalizable}{\text{es₀}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13961}{\htmlId{17217}{\htmlClass{Generalizable}{\text{fut}}}}\, \end{pmatrix}$ ⇀⦇ e ,EPOCH⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#16408}{\htmlId{17238}{\htmlClass{Bound}{\text{acnt'}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14071}{\htmlId{17246}{\htmlClass{Generalizable}{\text{ss'}}}}\, \\ \begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#16376}{\htmlId{17254}{\htmlClass{Bound}{\text{utxoSt'}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14642}{\htmlId{17264}{\htmlClass{Bound}{\text{govSt'}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#16144}{\htmlId{17273}{\htmlClass{Bound}{\text{certState'}}}}\, \end{pmatrix} \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14318}{\htmlId{17288}{\htmlClass{Bound}{\text{es}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13965}{\htmlId{17293}{\htmlClass{Generalizable}{\text{fut'}}}}\, \end{pmatrix}$ data _⊢_⇀⦇_,NEWEPOCH⦈_ : ⊤ → NewEpochState → Epoch → NewEpochState → Type where NEWEPOCH-New : ∀ {bprev bcur : BlocksMade} {pd : PoolDelegatedStake} → let eps' = applyRUpd ru eps ss = EpochState.ss eps'' pd' = calculatePoolDelegatedStake (Snapshots.set ss) in ∙ e ≡ lastEpoch + 1 ∙ _ ⊢ eps' ⇀⦇ e ,EPOCH⦈ eps'' ──────────────────────────────── _ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#13941}{\htmlId{17718}{\htmlClass{Generalizable}{\text{lastEpoch}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17406}{\htmlId{17730}{\htmlClass{Bound}{\text{bprev}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17412}{\htmlId{17738}{\htmlClass{Bound}{\text{bcur}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13986}{\htmlId{17745}{\htmlClass{Generalizable}{\text{eps}}}}\, \\ \,\href{Agda.Builtin.Maybe.html#173}{\htmlId{17751}{\htmlClass{InductiveConstructor}{\text{just}}}}\, \,\href{Ledger.Dijkstra.Specification.Epoch.html#14089}{\htmlId{17756}{\htmlClass{Generalizable}{\text{ru}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17432}{\htmlId{17761}{\htmlClass{Bound}{\text{pd}}}}\, \end{pmatrix}$ ⇀⦇ e ,NEWEPOCH⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#13939}{\htmlId{17784}{\htmlClass{Generalizable}{\text{e}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17412}{\htmlId{17788}{\htmlClass{Bound}{\text{bcur}}}}\, \\ \,\href{Axiom.Set.Map.html#2671}{\htmlId{17795}{\htmlClass{Function}{\text{∅ᵐ}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13995}{\htmlId{17801}{\htmlClass{Generalizable}{\text{eps''}}}}\, \\ \,\href{Agda.Builtin.Maybe.html#194}{\htmlId{17809}{\htmlClass{InductiveConstructor}{\text{nothing}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17539}{\htmlId{17819}{\htmlClass{Bound}{\text{pd'}}}}\, \end{pmatrix}$ NEWEPOCH-Not-New : ∀ {bprev bcur : BlocksMade} {pd : PoolDelegatedStake} → ∙ e ≢ lastEpoch + 1 ──────────────────────────────── _ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#13941}{\htmlId{17978}{\htmlClass{Generalizable}{\text{lastEpoch}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17850}{\htmlId{17990}{\htmlClass{Bound}{\text{bprev}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17856}{\htmlId{17998}{\htmlClass{Bound}{\text{bcur}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13986}{\htmlId{18005}{\htmlClass{Generalizable}{\text{eps}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14109}{\htmlId{18011}{\htmlClass{Generalizable}{\text{mru}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17876}{\htmlId{18017}{\htmlClass{Bound}{\text{pd}}}}\, \end{pmatrix}$ ⇀⦇ e ,NEWEPOCH⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#13941}{\htmlId{18040}{\htmlClass{Generalizable}{\text{lastEpoch}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17850}{\htmlId{18052}{\htmlClass{Bound}{\text{bprev}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17856}{\htmlId{18060}{\htmlClass{Bound}{\text{bcur}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13986}{\htmlId{18067}{\htmlClass{Generalizable}{\text{eps}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#14109}{\htmlId{18073}{\htmlClass{Generalizable}{\text{mru}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#17876}{\htmlId{18079}{\htmlClass{Bound}{\text{pd}}}}\, \end{pmatrix}$ NEWEPOCH-No-Reward-Update : ∀ {bprev bcur : BlocksMade} {pd : PoolDelegatedStake} → let ss = EpochState.ss eps' pd' = calculatePoolDelegatedStake (Snapshots.set ss) in ∙ e ≡ lastEpoch + 1 ∙ _ ⊢ eps ⇀⦇ e ,EPOCH⦈ eps' ──────────────────────────────── _ ⊢ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#13941}{\htmlId{18391}{\htmlClass{Generalizable}{\text{lastEpoch}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#18122}{\htmlId{18403}{\htmlClass{Bound}{\text{bprev}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#18128}{\htmlId{18411}{\htmlClass{Bound}{\text{bcur}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13986}{\htmlId{18418}{\htmlClass{Generalizable}{\text{eps}}}}\, \\ \,\href{Agda.Builtin.Maybe.html#194}{\htmlId{18424}{\htmlClass{InductiveConstructor}{\text{nothing}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#18148}{\htmlId{18434}{\htmlClass{Bound}{\text{pd}}}}\, \end{pmatrix}$ ⇀⦇ e ,NEWEPOCH⦈ $\begin{pmatrix} \,\href{Ledger.Dijkstra.Specification.Epoch.html#13939}{\htmlId{18457}{\htmlClass{Generalizable}{\text{e}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#18128}{\htmlId{18461}{\htmlClass{Bound}{\text{bcur}}}}\, \\ \,\href{Axiom.Set.Map.html#2671}{\htmlId{18468}{\htmlClass{Function}{\text{∅ᵐ}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#13990}{\htmlId{18473}{\htmlClass{Generalizable}{\text{eps'}}}}\, \\ \,\href{Agda.Builtin.Maybe.html#194}{\htmlId{18480}{\htmlClass{InductiveConstructor}{\text{nothing}}}}\, \\ \,\href{Ledger.Dijkstra.Specification.Epoch.html#18220}{\htmlId{18490}{\htmlClass{Bound}{\text{pd'}}}}\, \end{pmatrix}$