Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PParamsUpdate enactment fix #3836

Merged
merged 5 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion eras/alonzo/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Version history for `cardano-ledger-alonzo`

## 1.5.1.0
## 1.6.0.0

* Swap the order of arguments for `updateCostModels`

### `testlib`

Expand Down
2 changes: 1 addition & 1 deletion eras/alonzo/impl/cardano-ledger-alonzo.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: cardano-ledger-alonzo
version: 1.5.1.0
version: 1.6.0.0
license: Apache-2.0
maintainer: operations@iohk.io
author: IOHK
Expand Down
8 changes: 4 additions & 4 deletions eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,13 @@ data CostModels = CostModels
emptyCostModels :: CostModels
emptyCostModels = CostModels mempty mempty mempty

-- | Updates the first @CostModels@ with the second one so that only the
-- cost models that are present in the second one get updated while all the
-- | Updates the second @CostModels@ with the first one so that only the
-- cost models that are present in the first one get updated while all the
-- others stay unchanged
updateCostModels :: CostModels -> CostModels -> CostModels
updateCostModels
(CostModels oldValid oldErrors oldUnk)
(CostModels newValid newErrors newUnk) =
(CostModels newValid newErrors newUnk)
(CostModels oldValid oldErrors oldUnk) =
CostModels
(Map.union newValid oldValid)
(Map.union newErrors oldErrors)
Expand Down
7 changes: 6 additions & 1 deletion eras/conway/impl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Version history for `cardano-ledger-conway`

## 1.10.1.0
## 1.11.0.0

* Switch to using `OMap` for `ProposalsSnapshot` #3791
* Add `VotingOnExpiredGovAction` predicate failure in `GOV` #3825
* Rename `modifiedGroups` -> `modifiedPPGroups` and move into `ConwayEraPParams`
* Expose `pparamsUpdateThreshold`
* Fix [#3835](https://github.com/input-output-hk/cardano-ledger/issues/3835)
* Rename `PParamGroup` to `PPGroup` and `GovernanceGroup` to `GovGroup`
* Introduce `THKD` and use it for `ConwayPParams`

### `testlib`

Expand Down
2 changes: 1 addition & 1 deletion eras/conway/impl/cardano-ledger-conway.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ library
cardano-data >=1.1.2.0,
cardano-ledger-binary >=1.2,
cardano-ledger-allegra >=1.1,
cardano-ledger-alonzo ^>=1.5,
cardano-ledger-alonzo ^>=1.6,
cardano-ledger-babbage >=1.4.1,
cardano-ledger-core ^>=1.8,
cardano-ledger-mary >=1.1,
Expand Down
12 changes: 7 additions & 5 deletions eras/conway/impl/src/Cardano/Ledger/Conway/Governance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ module Cardano.Ledger.Conway.Governance (
psDRepDistrL,
psDRepStateL,
RunConwayRatify (..),

-- * Exported for testing
pparamsUpdateThreshold,
) where

import Cardano.Ledger.BaseTypes (
Expand Down Expand Up @@ -186,11 +189,10 @@ import Cardano.Ledger.Conway.Governance.Snapshots (
snapshotRemoveIds,
)
import Cardano.Ledger.Conway.PParams (
ConwayEraPParams,
ConwayEraPParams (..),
DRepVotingThresholds (..),
PParamGroup (..),
PPGroup (..),
PoolVotingThresholds (..),
modifiedGroups,
ppCommitteeMinSizeL,
ppDRepVotingThresholdsL,
ppPoolVotingThresholdsL,
Expand Down Expand Up @@ -688,14 +690,14 @@ pparamsUpdateThreshold ::
pparamsUpdateThreshold pp ppu =
let thresholdLens = \case
NetworkGroup -> dvtPPNetworkGroupL
GovernanceGroup -> dvtPPGovGroupL
GovGroup -> dvtPPGovGroupL
TechnicalGroup -> dvtPPTechnicalGroupL
EconomicGroup -> dvtPPEconomicGroupL
lookupGroupThreshold grp =
pp ^. ppDRepVotingThresholdsL . thresholdLens grp
in Set.foldr' max minBound $
Set.map lookupGroupThreshold $
modifiedGroups @era ppu
modifiedPPGroups @era ppu

data VotingThreshold
= -- | This is the actual threshold. It is lazy, because upon proposal we only care if
Expand Down
Loading