diff --git a/.changes/20260910_200246_cardano-api_kolam_prepare_11_2.yml b/.changes/20260910_200246_cardano-api_kolam_prepare_11_2.yml new file mode 100644 index 0000000000..14f5928649 --- /dev/null +++ b/.changes/20260910_200246_cardano-api_kolam_prepare_11_2.yml @@ -0,0 +1,9 @@ +description: | + Compatibility updates for ouroboros-consensus 4.0, cardano-ledger, and plutus 1.68: + fix `SerialisedPoolState` to carry an era type parameter, add `individualPoolStakeBls` + field to `IndividualPoolStake`, update `History.Bound` to the new Peras API + (`PerasRoundNo`, `NoPerasEnabled`), and bump dependency bounds accordingly. +kind: +- release +pr: 1328 +project: cardano-api diff --git a/.changes/20260910_200246_cardano-rpc_kolam_prepare_11_2.yml b/.changes/20260910_200246_cardano-rpc_kolam_prepare_11_2.yml new file mode 100644 index 0000000000..e341f5c5d5 --- /dev/null +++ b/.changes/20260910_200246_cardano-rpc_kolam_prepare_11_2.yml @@ -0,0 +1,8 @@ +description: | + Compatibility updates for grapesy and cardano-ledger: replace `memory` with `ram`, + update `exceptionToClient` to the new `ExactException` handler signature, and adapt + `PoolCert`/`StakePoolParams` usages to their new era type parameter. +kind: +- release +pr: 1328 +project: cardano-rpc diff --git a/cabal.project b/cabal.project index 5088d490d3..628ede8ef2 100644 --- a/cabal.project +++ b/cabal.project @@ -13,7 +13,7 @@ repository cardano-haskell-packages -- See CONTRIBUTING for information about these, including some Nix commands -- you need to run if you change them index-state: - , hackage.haskell.org 2026-08-02T17:21:34Z + , hackage.haskell.org 2026-09-02T14:05:07Z , cardano-haskell-packages 2026-09-03T10:20:53Z packages: @@ -50,7 +50,7 @@ semaphore: True constraints: -- haskell.nix patch does not work for 1.6.8 - , any.crypton-x509-system < 1.6.8 + , any.crypton-x509-system (< 1.6.8 || >= 1.7) -- WASM compilation specific @@ -132,6 +132,8 @@ allow-newer: , microstache:aeson , monad-control:transformers , http-api-data:text-iso8601 + -- cardano-addresses-4.0.x bounds crypton < 1.1 but we have 1.1.4 + , cardano-addresses:crypton -- cabal-allow-newer begin if impl(ghc >=9.14) @@ -166,3 +168,70 @@ if impl(ghc >=9.14) , time-locale-compat:time , with-utf8:base -- cabal-allow-newer end + +source-repository-package + type: git + location: https://github.com/input-output-hk/kes-agent + tag: 4625f3cf543566517d08882e659c97932d106d86 + --sha256: sha256-CSHWndpeJFqCEFNT6ysfyN6x+O4vZ9TtYOOsZKcLnIA= + subdir: + kes-agent + kes-agent-crypto + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger + tag: fb723848a28256fe372ea9ba692eccded6a12a53 + --sha256: sha256-iL61RTn4OPRNzzPn/2YcVJNMJYolXghaQ9cDG/DOOWM= + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/babbage/impl + eras/byron/chain/executable-spec + eras/byron/crypto + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/conway/impl + eras/dijkstra/impl + eras/mary/impl + eras/shelley/impl + eras/shelley/test-suite + libs/cardano-data + libs/cardano-ledger-api + libs/cardano-ledger-binary + libs/cardano-ledger-core + libs/cardano-protocol + libs/cardano-protocol-tpraos + libs/non-integral + libs/small-steps + libs/vector-map + +source-repository-package + type: git + location: https://github.com/intersectmbo/cardano-base.git + --sha256: sha256-WUBluY6UqvBkS5cNsJnKMOaW+1dTfL3mg8iq/kVPV0o= + tag: d92e2e3841eaad354c5e1ef77b458b347f471271 + subdir: cardano-crypto-leios + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus + tag: 835d3747eb2fbd6b7d69e73245ec7c9703faec21 + --sha256: sha256-ZDAPypcfLn7xzUyxcI7ktHxnvUKtPEHcPR522+c04Ao= + subdir: + . + +source-repository-package + type: git + location: https://github.com/well-typed/grapesy + tag: bd6af64f69ff89e3a8fc02e2c81262e648f4715d + --sha256: sha256-4F+bUoytvrgOcQ8aIWbOY9uYsPoTZwQOlmh7ckgyK9M= + subdir: + grapesy + grpc-spec + +source-repository-package + type: git + location: https://github.com/input-output-hk/cardano-crypto + tag: ac2e12a471b735ad80949bcbf0f6f634e5dbef77 + --sha256: sha256-NvbMk41W2PQy2H91nkG0GtPyGDwia0y6DQNNf9RtoAc= diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index 48b34e6263..4af04b72fa 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -135,18 +135,18 @@ library cardano-base ^>=0.1, cardano-binary, cardano-crypto, - cardano-crypto-class ^>=2.5, - cardano-crypto-wrapper ^>=1.7, + cardano-crypto-class ^>=2.6, + cardano-crypto-wrapper ^>=1.8, cardano-data >=1.0, cardano-diffusion:{api, cardano-diffusion} ^>=1.1, cardano-ledger-allegra >=1.7, - cardano-ledger-alonzo >=1.15, - cardano-ledger-api ^>=1.14, + cardano-ledger-alonzo >=1.17, + cardano-ledger-api ^>=1.15, cardano-ledger-babbage >=1.11, cardano-ledger-binary >=1.6, cardano-ledger-byron >=1.2, cardano-ledger-conway >=1.19, - cardano-ledger-core >=1.20, + cardano-ledger-core:{cardano-ledger-core, testlib} >=1.20, cardano-ledger-dijkstra >=0.1, cardano-ledger-mary >=1.8, cardano-ledger-shelley >=1.16, @@ -178,22 +178,22 @@ library network-mux, nothunks, ordered-containers, - ouroboros-consensus:{cardano, diffusion, ouroboros-consensus, protocol} ^>=4.2.1.0, + ouroboros-consensus:{cardano, diffusion, ouroboros-consensus, protocol} ^>=4.0, ouroboros-network:{api, framework, ouroboros-network, protocols} ^>=1.2, parsec, - plutus-core ^>=1.65, - plutus-ledger-api ^>=1.65, + plutus-core ^>=1.68, + plutus-ledger-api ^>=1.68, pretty-simple, prettyprinter, prettyprinter-ansi-terminal, prettyprinter-configurable ^>=1.36, random, - resource-registry ^>=0.3, + resource-registry ^>=0.4, safe-exceptions, scientific, serialise, singletons, - small-steps ^>=1.1, + small-steps ^>=1.2, sop-core, sop-extras, stm, @@ -329,8 +329,8 @@ library gen bytestring, cardano-api, cardano-binary >=1.6 && <1.10, - cardano-crypto-class ^>=2.5, - cardano-crypto-wrapper:testlib ^>=1.7, + cardano-crypto-class ^>=2.6, + cardano-crypto-wrapper:testlib ^>=1.8, cardano-ledger-alonzo:{cardano-ledger-alonzo, testlib}, cardano-ledger-byron:testlib, cardano-ledger-conway:testlib, @@ -373,11 +373,11 @@ test-suite cardano-api-test cardano-api:gen, cardano-binary, cardano-crypto, - cardano-crypto-class:{cardano-crypto-class, testlib} ^>=2.5, + cardano-crypto-class:{cardano-crypto-class, testlib} ^>=2.6, cardano-crypto-wrapper:testlib, cardano-data >=1.0, cardano-ledger-alonzo, - cardano-ledger-api ^>=1.14, + cardano-ledger-api ^>=1.15, cardano-ledger-babbage, cardano-ledger-binary, cardano-ledger-conway, @@ -463,7 +463,7 @@ test-suite cardano-api-golden cardano-crypto-class, cardano-data >=1.0, cardano-ledger-alonzo, - cardano-ledger-api ^>=1.14, + cardano-ledger-api ^>=1.15, cardano-ledger-binary, cardano-ledger-core, cardano-ledger-shelley, @@ -475,8 +475,8 @@ test-suite cardano-api-golden hedgehog >=1.1, hedgehog-extras ^>=0.10, microlens, - plutus-core ^>=1.65, - plutus-ledger-api ^>=1.65, + plutus-core ^>=1.68, + plutus-ledger-api ^>=1.68, tasty, tasty-discover, tasty-hedgehog, diff --git a/cardano-api/src/Cardano/Api/Certificate/Internal.hs b/cardano-api/src/Cardano/Api/Certificate/Internal.hs index 54530aed14..bc645749c2 100644 --- a/cardano-api/src/Cardano/Api/Certificate/Internal.hs +++ b/cardano-api/src/Cardano/Api/Certificate/Internal.hs @@ -86,7 +86,7 @@ data StakePoolMetadataReference -- Internal conversion functions -- -toShelleyPoolParams :: StakePoolParameters -> Ledger.StakePoolParams +toShelleyPoolParams :: StakePoolParameters -> Ledger.StakePoolParams era toShelleyPoolParams StakePoolParameters { stakePoolId = StakePoolKeyHash poolkh @@ -104,6 +104,7 @@ toShelleyPoolParams Ledger.StakePoolParams { Ledger.sppId = poolkh , Ledger.sppVrf = Ledger.toVRFVerKeyHash vrfkh + , Ledger.sppBlsKey = Ledger.SNothing , Ledger.sppPledge = stakePoolPledge , Ledger.sppCost = stakePoolCost , Ledger.sppMargin = @@ -159,7 +160,7 @@ toShelleyPoolParams Ledger.textToUrl (Text.length url) url fromShelleyPoolParams - :: Ledger.StakePoolParams + :: Ledger.StakePoolParams era -> StakePoolParameters fromShelleyPoolParams Ledger.StakePoolParams diff --git a/cardano-api/src/Cardano/Api/Consensus/Internal/Protocol.hs b/cardano-api/src/Cardano/Api/Consensus/Internal/Protocol.hs index 09fc39577f..9f34800fa5 100644 --- a/cardano-api/src/Cardano/Api/Consensus/Internal/Protocol.hs +++ b/cardano-api/src/Cardano/Api/Consensus/Internal/Protocol.hs @@ -8,6 +8,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} +{-# LANGUAGE UndecidableSuperClasses #-} module Cardano.Api.Consensus.Internal.Protocol ( BlockType (..) diff --git a/cardano-api/src/Cardano/Api/Crypto/Ed25519Bip32.hs b/cardano-api/src/Cardano/Api/Crypto/Ed25519Bip32.hs index 4cf0685b01..617b52e9b4 100644 --- a/cardano-api/src/Cardano/Api/Crypto/Ed25519Bip32.hs +++ b/cardano-api/src/Cardano/Api/Crypto/Ed25519Bip32.hs @@ -26,7 +26,7 @@ import Cardano.Crypto.Util (SignableRepresentation (..)) import Cardano.Crypto.Wallet qualified as CC import Control.DeepSeq (NFData) -import Data.ByteArray as BA (ByteArrayAccess, ScrubbedBytes, convert) +import Data.ByteArray as BA (ByteArrayAccess, convert, length, withByteArray) import Data.ByteString (ByteString) import Data.ByteString qualified as BS import GHC.Generics (Generic) @@ -59,12 +59,12 @@ instance DSIGNAlgorithm Ed25519Bip32DSIGN where deriving NoThunks via InspectHeap CC.XPub newtype SignKeyDSIGN Ed25519Bip32DSIGN = SignKeyEd25519Bip32DSIGN CC.XPrv - deriving (Generic, ByteArrayAccess) + deriving Generic deriving newtype NFData deriving NoThunks via InspectHeap CC.XPrv newtype SigDSIGN Ed25519Bip32DSIGN = SigEd25519Bip32DSIGN CC.XSignature - deriving (Show, Eq, Generic, ByteArrayAccess) + deriving (Show, Eq, Generic) deriving NoThunks via InspectHeap CC.XSignature -- @@ -84,7 +84,7 @@ instance DSIGNAlgorithm Ed25519Bip32DSIGN where signDSIGN () a (SignKeyEd25519Bip32DSIGN sk) = SigEd25519Bip32DSIGN $ - CC.sign (mempty :: ScrubbedBytes) sk (getSignableRepresentation a) + CC.sign (mempty :: ByteString) sk (getSignableRepresentation a) verifyDSIGN () (VerKeyEd25519Bip32DSIGN vk) a (SigEd25519Bip32DSIGN sig) = if CC.verify vk (getSignableRepresentation a) sig @@ -99,8 +99,16 @@ instance DSIGNAlgorithm Ed25519Bip32DSIGN where SignKeyEd25519Bip32DSIGN $ CC.generateNew (getSeedBytes seed) - (mempty :: ScrubbedBytes) - (mempty :: ScrubbedBytes) + (mempty :: ByteString) + (mempty :: ByteString) + +instance ByteArrayAccess (SignKeyDSIGN Ed25519Bip32DSIGN) where + length (SignKeyEd25519Bip32DSIGN sk) = BA.length (CC.unXPrv sk) + withByteArray (SignKeyEd25519Bip32DSIGN sk) = BA.withByteArray (CC.unXPrv sk) + +instance ByteArrayAccess (SigDSIGN Ed25519Bip32DSIGN) where + length (SigEd25519Bip32DSIGN sig) = BA.length (CC.unXSignature sig) + withByteArray (SigEd25519Bip32DSIGN sig) = BA.withByteArray (CC.unXSignature sig) instance FixedSizeCodec (VerKeyDSIGN Ed25519Bip32DSIGN) where type FixedSize (VerKeyDSIGN Ed25519Bip32DSIGN) = 64 diff --git a/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate.hs b/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate.hs index 695063057c..189d626ca5 100644 --- a/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate.hs +++ b/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate.hs @@ -101,7 +101,7 @@ makeStakeAddressUnregistrationCertificate scred deposit = makeStakePoolRegistrationCertificate :: forall era . IsEra era - => Ledger.StakePoolParams + => Ledger.StakePoolParams (LedgerEra era) -> Certificate (LedgerEra era) makeStakePoolRegistrationCertificate poolParams = obtainCommonConstraints (useEra @era) $ diff --git a/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate/Compatible.hs b/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate/Compatible.hs index 99800f1432..0698cdf152 100644 --- a/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate/Compatible.hs +++ b/cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Certificate/Compatible.hs @@ -144,7 +144,7 @@ makeStakeAddressUnregistrationCertificate scred = makeStakePoolRegistrationCertificate :: forall era . IsShelleyBasedEra era - => Ledger.StakePoolParams + => Ledger.StakePoolParams (ShelleyLedgerEra era) -> Certificate (ShelleyLedgerEra era) makeStakePoolRegistrationCertificate poolParams = shelleyBasedEraConstraints (shelleyBasedEra @era) $ diff --git a/cardano-api/src/Cardano/Api/Genesis/Internal.hs b/cardano-api/src/Cardano/Api/Genesis/Internal.hs index bfd8b4c5a1..771e166796 100644 --- a/cardano-api/src/Cardano/Api/Genesis/Internal.hs +++ b/cardano-api/src/Cardano/Api/Genesis/Internal.hs @@ -3,6 +3,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralisedNewtypeDeriving #-} +{-# LANGUAGE NumericUnderscores #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeApplications #-} @@ -62,6 +63,7 @@ import Cardano.Ledger.Dijkstra.PParams (UpgradeDijkstraPParams (..)) import Cardano.Ledger.Plutus (Language (..)) import Cardano.Ledger.Plutus qualified as L import Cardano.Ledger.Plutus.CostModels (mkCostModelsLenient) +import Cardano.Ledger.Plutus.ExUnits (OrdExUnits (..)) import Cardano.Ledger.Shelley.Core import Cardano.Ledger.Shelley.Genesis ( NominalDiffTimeMicro @@ -94,6 +96,8 @@ import GHC.Exts (IsList (..)) import GHC.Stack (HasCallStack) import Lens.Micro +import Test.Cardano.Ledger.Plutus (testingCostModel) + import Barbies (bmap) import UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts @@ -179,7 +183,7 @@ shelleyGenesisDefaults = -- pot = tx_fees + ρ * remaining_reserves & ppRhoL .~ unsafeBR (1 % 10) -- How much of reserves goes into pot & ppTauL .~ unsafeBR (1 % 10) -- τ * remaining_reserves is sent to treasury every epoch - & ppKeyDepositL .~ L.Coin 400000 -- require a non-zero deposit when registering keys + & ppKeyDepositL .~ L.Coin 400_000 -- require a non-zero deposit when registering keys , -- genesis keys and initial funds sgGenDelegs = M.empty , sgStaking = emptyGenesisStaking @@ -203,6 +207,19 @@ dijkstraGenesisDefaults = , udppMaxRefScriptSizePerTx = 200 * 1024 -- 200KiB , udppRefScriptCostStride = knownNonZeroBounded @25600 -- 25 KiB , udppRefScriptCostMultiplier = fromJust $ boundRational 1.2 + , udppMaxPledgeLeverage = MaxPledgeLeverage SNothing + , udppMinPoolMargin = fromJust $ boundRational 0.015 + , udppPlutusV4CostModel = testingCostModel PlutusV4 + , -- Feasible values from CIP-164 Table 7 + udppLeiosAnnouncementPeriodLength = Milliseconds32 1_000 -- L_hdr + , udppLeiosVotePeriodLength = Milliseconds32 4_000 -- L_vote + , udppLeiosDiffusionPeriodLength = Milliseconds32 7_000 -- L_diff + , udppLeiosCommitteeSize = 900 -- N_c + , udppLeiosQuorumStakeThreshold = fromJust $ boundRational 0.75 -- tau + , udppMaxEndorserBlockReferencesSize = 512 * 1024 -- 512 KiB + , udppMaxEndorserBlockTxsSize = 12 * 1024 * 1024 -- 12 MiB + , udppMaxEndorserBlockExUnits = OrdExUnits $ ExUnits 7_000_000_000 2_000_000_000_000 + , udppMaxRefScriptSizePerEndorserBlock = 12 * 1024 * 1024 -- 12 MiB } } @@ -224,9 +241,9 @@ conwayGenesisDefaults = UpgradeConwayPParams { ucppPoolVotingThresholds = defaultPoolVotingThresholds , ucppGovActionLifetime = EpochInterval 1 - , ucppGovActionDeposit = Coin 1000000 + , ucppGovActionDeposit = Coin 1_000_000 , ucppDRepVotingThresholds = defaultDRepVotingThresholds - , ucppDRepDeposit = Coin 1000000 + , ucppDRepDeposit = Coin 1_000_000 , ucppDRepActivity = EpochInterval 100 , ucppCommitteeMinSize = 0 , ucppCommitteeMaxTermLength = EpochInterval 200 @@ -348,24 +365,24 @@ alonzoGenesisDefaults = AlonzoGenesis { agPrices = Prices - { prSteps = 721 %! 10000000 - , prMem = 577 %! 10000 + { prSteps = 721 %! 10_000_000 + , prMem = 577 %! 10_000 } , agMaxValSize = 5000 , agMaxTxExUnits = ExUnits - { exUnitsMem = 140000000 - , exUnitsSteps = 10000000000 + { exUnitsMem = 140_000_000 + , exUnitsSteps = 10_000_000_000 } , agMaxCollateralInputs = 3 , agMaxBlockExUnits = ExUnits - { exUnitsMem = 62000000 - , exUnitsSteps = 20000000000 + { exUnitsMem = 62_000_000 + , exUnitsSteps = 20_000_000_000 } , agPlutusV1CostModel = either (error . show) id (L.mkCostModel PlutusV1 defaultV1CostModelValues) , agCollateralPercentage = 150 - , agCoinsPerUTxOWord = CoinPerWord $ Coin 34482 + , agCoinsPerUTxOWord = CoinPerWord $ Coin 34_482 , agExtraConfig = SJust . AlonzoExtraConfig . Just $ errorFail apiCostModels } where @@ -376,7 +393,7 @@ alonzoGenesisDefaults = , (fromIntegral $ fromEnum PlutusV2, defaultV2CostModel) ] defaultV2CostModel = - [ 205665 + [ 205_665 , 812 , 1 , 1 @@ -385,171 +402,171 @@ alonzoGenesisDefaults = , 0 , 1 , 1000 - , 24177 + , 24_177 , 4 , 1 , 1000 , 32 - , 117366 - , 10475 + , 117_366 + , 10_475 , 4 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 , 100 , 100 - , 23000 + , 23_000 , 100 - , 19537 + , 19_537 , 32 - , 175354 + , 175_354 , 32 - , 46417 + , 46_417 , 4 - , 221973 + , 221_973 , 511 , 0 , 1 - , 89141 + , 89_141 , 32 - , 497525 - , 14068 + , 497_525 + , 14_068 , 4 , 2 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 , 1000 - , 28662 + , 28_662 , 4 , 2 - , 245000 - , 216773 + , 245_000 + , 216_773 , 62 , 1 - , 1060367 - , 12586 + , 1_060_367 + , 12_586 , 1 - , 208512 + , 208_512 , 421 , 1 - , 187000 + , 187_000 , 1000 - , 52998 + , 52_998 , 1 - , 80436 + , 80_436 , 32 - , 43249 + , 43_249 , 32 , 1000 , 32 - , 80556 + , 80_556 , 1 - , 57667 + , 57_667 , 4 , 1000 , 10 - , 197145 + , 197_145 , 156 , 1 - , 197145 + , 197_145 , 156 , 1 - , 204924 + , 204_924 , 473 , 1 - , 208896 + , 208_896 , 511 , 1 - , 52467 + , 52_467 , 32 - , 64832 + , 64_832 , 32 - , 65493 + , 65_493 , 32 - , 22558 + , 22_558 , 32 - , 16563 + , 16_563 , 32 - , 76511 + , 76_511 , 32 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 - , 69522 - , 11687 + , 69_522 + , 11_687 , 0 , 1 - , 60091 + , 60_091 , 32 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 - , 1159724 - , 392670 + , 1_159_724 + , 392_670 , 0 , 2 - , 806990 - , 30482 + , 806_990 + , 30_482 , 4 - , 1927926 - , 82523 + , 1_927_926 + , 82_523 , 4 - , 265318 + , 265_318 , 0 , 4 , 0 - , 85931 + , 85_931 , 32 - , 205665 + , 205_665 , 812 , 1 , 1 - , 41182 + , 41_182 , 32 - , 212342 + , 212_342 , 32 - , 31220 + , 31_220 , 32 - , 32696 + , 32_696 , 32 - , 43357 + , 43_357 , 32 - , 32247 + , 32_247 , 32 - , 38314 + , 38_314 , 32 - , 35892428 + , 35_892_428 , 10 - , 9462713 + , 9_462_713 , 1021 , 10 - , 38887044 - , 32947 + , 38_887_044 + , 32_947 , 10 ] @@ -559,7 +576,7 @@ defaultV1CostModel = defaultV1CostModelValues :: [Int64] defaultV1CostModelValues = - [ 205665 + [ 205_665 , 812 , 1 , 1 @@ -568,162 +585,162 @@ defaultV1CostModelValues = , 0 , 1 , 1000 - , 24177 + , 24_177 , 4 , 1 , 1000 , 32 - , 117366 - , 10475 + , 117_366 + , 10_475 , 4 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 - , 23000 + , 23_000 , 100 , 100 , 100 - , 23000 + , 23_000 , 100 - , 19537 + , 19_537 , 32 - , 175354 + , 175_354 , 32 - , 46417 + , 46_417 , 4 - , 221973 + , 221_973 , 511 , 0 , 1 - , 89141 + , 89_141 , 32 - , 497525 - , 14068 + , 497_525 + , 14_068 , 4 , 2 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 , 1000 - , 28662 + , 28_662 , 4 , 2 - , 245000 - , 216773 + , 245_000 + , 216_773 , 62 , 1 - , 1060367 - , 12586 + , 1_060_367 + , 12_586 , 1 - , 208512 + , 208_512 , 421 , 1 - , 187000 + , 187_000 , 1000 - , 52998 + , 52_998 , 1 - , 80436 + , 80_436 , 32 - , 43249 + , 43_249 , 32 , 1000 , 32 - , 80556 + , 80_556 , 1 - , 57667 + , 57_667 , 4 , 1000 , 10 - , 197145 + , 197_145 , 156 , 1 - , 197145 + , 197_145 , 156 , 1 - , 204924 + , 204_924 , 473 , 1 - , 208896 + , 208_896 , 511 , 1 - , 52467 + , 52_467 , 32 - , 64832 + , 64_832 , 32 - , 65493 + , 65_493 , 32 - , 22558 + , 22_558 , 32 - , 16563 + , 16_563 , 32 - , 76511 + , 76_511 , 32 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 - , 69522 - , 11687 + , 69_522 + , 11_687 , 0 , 1 - , 60091 + , 60_091 , 32 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 - , 196500 - , 453240 + , 196_500 + , 453_240 , 220 , 0 , 1 , 1 - , 806990 - , 30482 + , 806_990 + , 30_482 , 4 - , 1927926 - , 82523 + , 1_927_926 + , 82_523 , 4 - , 265318 + , 265_318 , 0 , 4 , 0 - , 85931 + , 85_931 , 32 - , 205665 + , 205_665 , 812 , 1 , 1 - , 41182 + , 41_182 , 32 - , 212342 + , 212_342 , 32 - , 31220 + , 31_220 , 32 - , 32696 + , 32_696 , 32 - , 43357 + , 43_357 , 32 - , 32247 + , 32_247 , 32 - , 38314 + , 38_314 , 32 - , 57996947 - , 18975 + , 57_996_947 + , 18_975 , 10 ] diff --git a/cardano-api/src/Cardano/Api/Internal/Orphans/Misc.hs b/cardano-api/src/Cardano/Api/Internal/Orphans/Misc.hs index 4f5154577e..26534a178a 100644 --- a/cardano-api/src/Cardano/Api/Internal/Orphans/Misc.hs +++ b/cardano-api/src/Cardano/Api/Internal/Orphans/Misc.hs @@ -316,6 +316,23 @@ instance Semigroup (Ledger.DijkstraPParams StrictMaybe era) where , Ledger.dppRefScriptCostStride = lastMappendWithTHKD Ledger.dppRefScriptCostStride p1 p2 , Ledger.dppRefScriptCostMultiplier = lastMappendWithTHKD Ledger.dppRefScriptCostMultiplier p1 p2 + , Ledger.dppMaxPledgeLeverage = + lastMappendWithTHKD Ledger.dppMaxPledgeLeverage p1 p2 + , Ledger.dppMinPoolMargin = + lastMappendWithTHKD Ledger.dppMinPoolMargin p1 p2 + , Ledger.dppLeiosAnnouncementPeriodLength = + lastMappendWithTHKD Ledger.dppLeiosAnnouncementPeriodLength p1 p2 + , Ledger.dppLeiosVotePeriodLength = lastMappendWithTHKD Ledger.dppLeiosVotePeriodLength p1 p2 + , Ledger.dppLeiosDiffusionPeriodLength = + lastMappendWithTHKD Ledger.dppLeiosDiffusionPeriodLength p1 p2 + , Ledger.dppLeiosCommitteeSize = lastMappendWithTHKD Ledger.dppLeiosCommitteeSize p1 p2 + , Ledger.dppLeiosQuorumStakeThreshold = lastMappendWithTHKD Ledger.dppLeiosQuorumStakeThreshold p1 p2 + , Ledger.dppMaxEndorserBlockReferencesSize = + lastMappendWithTHKD Ledger.dppMaxEndorserBlockReferencesSize p1 p2 + , Ledger.dppMaxEndorserBlockTxsSize = lastMappendWithTHKD Ledger.dppMaxEndorserBlockTxsSize p1 p2 + , Ledger.dppMaxEndorserBlockExUnits = lastMappendWithTHKD Ledger.dppMaxEndorserBlockExUnits p1 p2 + , Ledger.dppMaxRefScriptSizePerEndorserBlock = + lastMappendWithTHKD Ledger.dppMaxRefScriptSizePerEndorserBlock p1 p2 } lastMappendWithTHKD :: (a -> Ledger.THKD g StrictMaybe b) -> a -> a -> Ledger.THKD g StrictMaybe b diff --git a/cardano-api/src/Cardano/Api/Key/Internal/Mnemonic.hs b/cardano-api/src/Cardano/Api/Key/Internal/Mnemonic.hs index acab90c299..a68c290cd4 100644 --- a/cardano-api/src/Cardano/Api/Key/Internal/Mnemonic.hs +++ b/cardano-api/src/Cardano/Api/Key/Internal/Mnemonic.hs @@ -15,6 +15,7 @@ module Cardano.Api.Key.Internal.Mnemonic ) where +import Cardano.Api.Crypto.Ed25519Bip32 (xPrvFromBytes) import Cardano.Api.Error (Error (..)) import Cardano.Api.Key.Internal ( AsType @@ -35,6 +36,7 @@ import Cardano.Address.Derivation , XPrv , genMasterKeyFromMnemonic , indexFromWord32 + , xprvToBytes ) import Cardano.Address.Style.Shelley ( Role (..) @@ -44,6 +46,7 @@ import Cardano.Address.Style.Shelley , deriveDRepPrivateKey ) import Cardano.Crypto.Encoding.BIP39 (Dictionary (dictionaryIndexToWord)) +import Cardano.Crypto.Wallet qualified as CC import Cardano.Mnemonic ( MkSomeMnemonic (mkSomeMnemonic) , MkSomeMnemonicError (..) @@ -59,6 +62,7 @@ import Data.ByteString qualified as BS import Data.Either.Combinators (mapLeft, maybeToRight) import Data.Either.Extra (maybeToEither) import Data.Foldable (toList) +import Data.Maybe (fromMaybe) import Data.Text (Text) import Data.Text qualified as Text import Data.Text.Encoding (decodeUtf8, encodeUtf8) @@ -72,6 +76,9 @@ import Basement.Compat.IsList qualified as Basement import Basement.String qualified as Basement import Crypto.Encoding.BIP39.English (english) +caXPrvToCCXPrv :: XPrv -> CC.XPrv +caXPrvToCCXPrv = fromMaybe (error "caXPrvToCCXPrv: impossible") . xPrvFromBytes . xprvToBytes + -- | The size of a mnemonic sentence. -- The size is given in the number of words in the sentence. -- The allowed sizes are 12, 15, 18, 21, and 24. @@ -154,7 +161,11 @@ instance IndexedSigningKeyFromRootKey PaymentExtendedKey where -> Either Word32 (SigningKey PaymentExtendedKey) deriveSigningKeyFromAccountWithPaymentKeyIndex _ accK idx = do payKeyIx <- maybeToEither idx $ indexFromWord32 @(Index 'Soft 'PaymentK) idx - return $ PaymentExtendedSigningKey $ getKey $ deriveAddressPrivateKey accK UTxOExternal payKeyIx + return $ + PaymentExtendedSigningKey $ + caXPrvToCCXPrv $ + getKey $ + deriveAddressPrivateKey accK UTxOExternal payKeyIx instance IndexedSigningKeyFromRootKey StakeExtendedKey where deriveSigningKeyFromAccountWithPaymentKeyIndex @@ -164,7 +175,11 @@ instance IndexedSigningKeyFromRootKey StakeExtendedKey where -> Either Word32 (SigningKey StakeExtendedKey) deriveSigningKeyFromAccountWithPaymentKeyIndex _ accK idx = do payKeyIx <- maybeToEither idx $ indexFromWord32 @(Index 'Soft 'PaymentK) idx - return $ StakeExtendedSigningKey $ getKey $ deriveAddressPrivateKey accK Stake payKeyIx + return $ + StakeExtendedSigningKey $ + caXPrvToCCXPrv $ + getKey $ + deriveAddressPrivateKey accK Stake payKeyIx instance SigningKeyFromRootKey DRepExtendedKey where deriveSigningKeyFromAccount @@ -172,7 +187,7 @@ instance SigningKeyFromRootKey DRepExtendedKey where -> Shelley 'AccountK XPrv -> SigningKey DRepExtendedKey deriveSigningKeyFromAccount _ accK = - DRepExtendedSigningKey $ getKey $ deriveDRepPrivateKey accK + DRepExtendedSigningKey $ caXPrvToCCXPrv $ getKey $ deriveDRepPrivateKey accK instance SigningKeyFromRootKey CommitteeColdExtendedKey where deriveSigningKeyFromAccount @@ -180,7 +195,7 @@ instance SigningKeyFromRootKey CommitteeColdExtendedKey where -> Shelley 'AccountK XPrv -> SigningKey CommitteeColdExtendedKey deriveSigningKeyFromAccount _ accK = - CommitteeColdExtendedSigningKey $ getKey $ deriveCCColdPrivateKey accK + CommitteeColdExtendedSigningKey $ caXPrvToCCXPrv $ getKey $ deriveCCColdPrivateKey accK instance SigningKeyFromRootKey CommitteeHotExtendedKey where deriveSigningKeyFromAccount @@ -188,7 +203,7 @@ instance SigningKeyFromRootKey CommitteeHotExtendedKey where -> Shelley 'AccountK XPrv -> SigningKey CommitteeHotExtendedKey deriveSigningKeyFromAccount _ accK = - CommitteeHotExtendedSigningKey $ getKey $ deriveCCHotPrivateKey accK + CommitteeHotExtendedSigningKey $ caXPrvToCCXPrv $ getKey $ deriveCCHotPrivateKey accK -- | Generate a signing key from a mnemonic sentence given a function that -- derives a key from an account extended key. diff --git a/cardano-api/src/Cardano/Api/LedgerState.hs b/cardano-api/src/Cardano/Api/LedgerState.hs index 8007f148b1..825d0e6d16 100644 --- a/cardano-api/src/Cardano/Api/LedgerState.hs +++ b/cardano-api/src/Cardano/Api/LedgerState.hs @@ -154,10 +154,12 @@ import Cardano.Crypto.ProtocolMagic qualified import Cardano.Crypto.VRF qualified as Crypto import Cardano.Crypto.VRF.Class qualified as VRF import Cardano.Ledger.Alonzo.Genesis (AlonzoGenesis (..)) +import Cardano.Ledger.Api (Language (PlutusV4)) import Cardano.Ledger.Api.Era qualified as Ledger import Cardano.Ledger.Api.Transition qualified as Ledger import Cardano.Ledger.BaseTypes ( Globals (..) + , Milliseconds32 (Milliseconds32) , Nonce , ProtVer (..) , boundRational @@ -172,6 +174,7 @@ import Cardano.Ledger.Dijkstra.PParams qualified as Ledger import Cardano.Ledger.Dijkstra.Tx qualified as Ledger import Cardano.Ledger.Keys qualified as L import Cardano.Ledger.Keys qualified as SL +import Cardano.Ledger.Plutus (OrdExUnits (..)) import Cardano.Ledger.Shelley.API qualified as ShelleyAPI import Cardano.Ledger.Shelley.Core qualified as Core import Cardano.Ledger.Shelley.Genesis qualified as Ledger @@ -279,6 +282,8 @@ import Network.TypedProtocol.Core (Nat (..)) import System.FS.API (SomeHasFS (..)) import System.FilePath +import Test.Cardano.Ledger.Plutus (testingCostModel) + data InitialLedgerStateError = -- | Failed to read or parse the network config file. ILSEConfigFile Text @@ -1588,6 +1593,18 @@ exampleDijkstraGenesis = , Ledger.udppMaxRefScriptSizePerTx = 200 * 1024 -- 200KiB , Ledger.udppRefScriptCostStride = knownNonZeroBounded @25600 -- 25 KiB , Ledger.udppRefScriptCostMultiplier = fromJust $ boundRational 1.2 + , Ledger.udppMaxPledgeLeverage = Core.MaxPledgeLeverage ShelleyAPI.SNothing + , Ledger.udppMinPoolMargin = fromJust $ boundRational 0.015 + , Ledger.udppPlutusV4CostModel = testingCostModel PlutusV4 + , Ledger.udppLeiosAnnouncementPeriodLength = Milliseconds32 1000 -- L_hdr + , Ledger.udppLeiosVotePeriodLength = Milliseconds32 4000 -- L_vote + , Ledger.udppLeiosDiffusionPeriodLength = Milliseconds32 7000 -- L_diff + , Ledger.udppLeiosCommitteeSize = 900 -- N_c + , Ledger.udppLeiosQuorumStakeThreshold = fromJust $ boundRational 0.75 -- tau + , Ledger.udppMaxEndorserBlockReferencesSize = 512 * 1024 -- 512 KiB + , Ledger.udppMaxEndorserBlockTxsSize = 12 * 1024 * 1024 -- 12 MiB + , Ledger.udppMaxEndorserBlockExUnits = OrdExUnits $ Ledger.ExUnits 7000000000 2000000000000 + , Ledger.udppMaxRefScriptSizePerEndorserBlock = 12 * 1024 * 1024 -- 12 MiB } } diff --git a/cardano-api/src/Cardano/Api/Query/Internal/Expr.hs b/cardano-api/src/Cardano/Api/Query/Internal/Expr.hs index 53cdf55d44..f249171a00 100644 --- a/cardano-api/src/Cardano/Api/Query/Internal/Expr.hs +++ b/cardano-api/src/Cardano/Api/Query/Internal/Expr.hs @@ -209,7 +209,7 @@ queryPoolState QueryInMode r IO - (Either UnsupportedNtcVersionError (Either EraMismatch SerialisedPoolState)) + (Either UnsupportedNtcVersionError (Either EraMismatch (SerialisedPoolState era))) queryPoolState eon = querySbe eon . QueryPoolState queryProtocolParameters diff --git a/cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs b/cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs index c7c714b765..da52aecc45 100644 --- a/cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs +++ b/cardano-api/src/Cardano/Api/Query/Internal/Type/QueryInMode.hs @@ -293,7 +293,7 @@ data QueryInShelleyBasedEra era result where :: QueryInShelleyBasedEra era (SerialisedCurrentEpochState era) QueryPoolState :: Maybe (Set PoolId) - -> QueryInShelleyBasedEra era SerialisedPoolState + -> QueryInShelleyBasedEra era (SerialisedPoolState era) QueryPoolDistribution :: Maybe (Set PoolId) -> QueryInShelleyBasedEra era (Serialised (PoolDistribution era)) @@ -411,15 +411,15 @@ decodeCurrentEpochState decodeCurrentEpochState sbe (SerialisedCurrentEpochState (Serialised ls)) = shelleyBasedEraConstraints sbe $ CurrentEpochState <$> Plain.decodeFull ls -newtype SerialisedPoolState - = SerialisedPoolState (Serialised L.QueryPoolStateResult) +newtype SerialisedPoolState era + = SerialisedPoolState (Serialised (L.QueryPoolStateResult (ShelleyLedgerEra era))) -newtype PoolState era = PoolState L.QueryPoolStateResult +newtype PoolState era = PoolState (L.QueryPoolStateResult (ShelleyLedgerEra era)) decodePoolState :: forall era . ShelleyBasedEra era - -> SerialisedPoolState + -> SerialisedPoolState era -> Either DecoderError (PoolState era) decodePoolState sbe (SerialisedPoolState (Serialised ls)) = shelleyBasedEraConstraints sbe $ @@ -951,7 +951,7 @@ fromConsensusQueryResultShelleyBased sbe sbeQuery q' r' = QueryPoolState{} -> case q' of Consensus.GetCBOR Consensus.GetPoolState{} -> - SerialisedPoolState r' + SerialisedPoolState (Serialised (unSerialised r')) _ -> fromConsensusQueryResultMismatch QueryPoolDistribution{} -> case q' of diff --git a/cardano-api/test/cardano-api-test/Test/Cardano/Api/EpochLeadership.hs b/cardano-api/test/cardano-api-test/Test/Cardano/Api/EpochLeadership.hs index 2c0a66120a..daca287e3b 100644 --- a/cardano-api/test/cardano-api-test/Test/Cardano/Api/EpochLeadership.hs +++ b/cardano-api/test/cardano-api-test/Test/Cardano/Api/EpochLeadership.hs @@ -29,6 +29,7 @@ import Ouroboros.Consensus.Protocol.Abstract qualified as Consensus import Ouroboros.Consensus.Protocol.TPraos (TPraosState (..)) import Data.Map qualified as Map +import Data.Maybe.Strict (StrictMaybe (..)) import Data.Ratio ((%)) import Data.Time.Clock (secondsToNominalDiffTime) import GHC.Exts (IsList (..)) @@ -93,6 +94,7 @@ test_currentEpochEligibleLeadershipSlots = { L.individualPoolStake = 1 % 3 , L.individualTotalPoolStake = toCompactPartial 0 , L.individualPoolStakeVrf = hash1 + , L.individualPoolStakeBls = SNothing } ) , @@ -101,6 +103,7 @@ test_currentEpochEligibleLeadershipSlots = { L.individualPoolStake = 1 % 3 , L.individualTotalPoolStake = toCompactPartial 0 , L.individualPoolStakeVrf = hash2 + , L.individualPoolStakeBls = SNothing } ) , @@ -109,6 +112,7 @@ test_currentEpochEligibleLeadershipSlots = { L.individualPoolStake = 1 % 3 , L.individualTotalPoolStake = toCompactPartial 0 , L.individualPoolStakeVrf = hash3 + , L.individualPoolStakeBls = SNothing } ) ] diff --git a/cardano-rpc/cardano-rpc.cabal b/cardano-rpc/cardano-rpc.cabal index cb37193147..9a13aa658e 100644 --- a/cardano-rpc/cardano-rpc.cabal +++ b/cardano-rpc/cardano-rpc.cabal @@ -123,7 +123,6 @@ library grapesy, grpc-spec, iproute, - memory, mempack, microlens, network, @@ -131,6 +130,7 @@ library ouroboros-consensus:cardano, proto-lens >=0.7.1.7, proto-lens-protobuf-types, + ram, random, rio, sop-extras, @@ -195,11 +195,11 @@ test-suite cardano-rpc-test hedgehog, hedgehog-extras, hedgehog-quickcheck, - memory, mtl, ouroboros-consensus, ouroboros-consensus:cardano, proto-lens, + ram, rio, scientific, sop-extras, diff --git a/cardano-rpc/src/Cardano/Rpc/Server.hs b/cardano-rpc/src/Cardano/Rpc/Server.hs index 4fa6c51ef5..b028ab123f 100644 --- a/cardano-rpc/src/Cardano/Rpc/Server.hs +++ b/cardano-rpc/src/Cardano/Rpc/Server.hs @@ -48,6 +48,7 @@ import RIO import Control.Tracer import Network.GRPC.Common +import Network.GRPC.Common.Exception (ExactException, unwrapExactException) import Network.GRPC.Server import Network.GRPC.Server.Protobuf import Network.GRPC.Server.Run @@ -185,9 +186,11 @@ runRpcServer tracer rpcConfig networkMagic nodeKernelAccessRef = handleFatalExce -- Clients must never see internal error detail or call stacks; full detail is -- still traced server-side by 'topLevelHandler'. - exceptionToClient :: SomeException -> IO (Maybe Text) + exceptionToClient :: ExactException -> IO (Maybe Text) exceptionToClient e = - pure . Just $ maybe genericErrorMessage renderRpcExceptionForClient $ fromException e + pure . Just $ + maybe genericErrorMessage renderRpcExceptionForClient $ + fromException (unwrapExactException e) where genericErrorMessage = "Internal error while processing the request." diff --git a/cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/Certificate.hs b/cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/Certificate.hs index c8bef0ad6a..d4193c91c2 100644 --- a/cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/Certificate.hs +++ b/cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/Certificate.hs @@ -235,7 +235,7 @@ conwayGovCertToUtxoRpcCertificate = \case & U5c.maybe'anchor .~ fmap anchorToUtxoRpcAnchor (L.strictMaybeToMaybe anchor) ) -poolCertToUtxoRpcCertificate :: L.PoolCert -> Proto UtxoRpc.Certificate +poolCertToUtxoRpcCertificate :: L.PoolCert era -> Proto UtxoRpc.Certificate poolCertToUtxoRpcCertificate = \case L.RegPool poolParams -> defMessage & U5c.poolRegistration .~ stakePoolParamsToUtxoRpcPoolRegistration poolParams @@ -247,7 +247,8 @@ poolCertToUtxoRpcCertificate = \case & U5c.epoch .~ L.unEpochNo epochNo ) -stakePoolParamsToUtxoRpcPoolRegistration :: L.StakePoolParams -> Proto UtxoRpc.PoolRegistrationCert +stakePoolParamsToUtxoRpcPoolRegistration + :: L.StakePoolParams era -> Proto UtxoRpc.PoolRegistrationCert stakePoolParamsToUtxoRpcPoolRegistration poolParams = defMessage & U5c.operator .~ keyHashToBytes (L.sppId poolParams) diff --git a/cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/EraSummary.hs b/cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/EraSummary.hs index f2dc07af17..5b25d037fa 100644 --- a/cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/EraSummary.hs +++ b/cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/EraSummary.hs @@ -14,6 +14,7 @@ import Cardano.Slotting.Time (RelativeTime (..)) import Ouroboros.Consensus.BlockchainTime.WallClock.Types (slotLengthFromSec) import Ouroboros.Consensus.Cardano.Block (CardanoEras) import Ouroboros.Consensus.HardFork.History qualified as History +import Ouroboros.Consensus.Peras.Types (PerasRoundNo (PerasRoundNo)) import RIO @@ -30,14 +31,15 @@ dummyEraParams = History.defaultEraParams (Consensus.SecurityParam (knownNonZeroBounded @2160)) (slotLengthFromSec 1) + History.NoPerasEnabled -mkBound :: SlotNo -> EpochNo -> RelativeTime -> History.Bound -mkBound slot epoch time = +mkBound :: SlotNo -> EpochNo -> RelativeTime -> PerasRoundNo -> History.Bound +mkBound slot epoch time nextPerasRoundNo = History.Bound { History.boundTime = time , History.boundSlot = slot , History.boundEpoch = epoch - , History.boundPerasRound = History.NoPerasEnabled + , History.boundNextPerasRound = nextPerasRoundNo } mkEraSummary :: History.Bound -> History.EraEnd -> History.EraSummary @@ -57,12 +59,12 @@ hprop_era_summary_multi_era :: Property hprop_era_summary_multi_era = H.propertyOnce $ do let systemStart = SystemStart (posixSecondsToUTCTime 0) - byronStart = mkBound (SlotNo 0) (EpochNo 0) (RelativeTime 0) + byronStart = mkBound (SlotNo 0) (EpochNo 0) (RelativeTime 0) (PerasRoundNo 0) -- 172800.6789s proves the ms conversion is exact fixed-point via the -- shared 'utcTimeToMs' (nearest-ms rounding): .6789s -> 679ms. A -- Double-based path, or a floor instead of a round, would give 678. - transition = mkBound (SlotNo 21600) (EpochNo 1) (RelativeTime 172800.6789) - shelleyEnd = mkBound (SlotNo 43200) (EpochNo 2) (RelativeTime 259200) + transition = mkBound (SlotNo 21600) (EpochNo 1) (RelativeTime 172800.6789) (PerasRoundNo 1) + shelleyEnd = mkBound (SlotNo 43200) (EpochNo 2) (RelativeTime 259200) (PerasRoundNo 2) byronSummary = mkEraSummary byronStart (History.EraEnd transition) shelleySummary = mkEraSummary transition (History.EraEnd shelleyEnd) @@ -99,7 +101,7 @@ hprop_era_summary_multi_era = H.propertyOnce $ do hprop_era_summary_single_era_no_end :: Property hprop_era_summary_single_era_no_end = H.propertyOnce $ do let systemStart = SystemStart (posixSecondsToUTCTime 0) - byronStart = mkBound (SlotNo 0) (EpochNo 0) (RelativeTime 0) + byronStart = mkBound (SlotNo 0) (EpochNo 0) (RelativeTime 0) (PerasRoundNo 0) byronSummary = mkEraSummary byronStart History.EraUnbounded summary :: History.Summary (CardanoEras Consensus.StandardCrypto) diff --git a/flake.lock b/flake.lock index 1ca971dc76..c470a7959d 100644 --- a/flake.lock +++ b/flake.lock @@ -439,11 +439,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1785728842, - "narHash": "sha256-3R5qunuAddR7849eVthkALRrKcXLPMd2LeQVPH/+lRs=", + "lastModified": 1788358854, + "narHash": "sha256-NIF+y/9ctwQILbHsCZCOFN7dxuwWXKnFn5T0+ya49+Y=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "a69c841fe2cbb3571739018f9efb7f533279fb15", + "rev": "04149d44d879f7115282c442f8904b5eb5a78c4e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d47ec976d8..f8159498b2 100644 --- a/flake.nix +++ b/flake.nix @@ -152,6 +152,8 @@ # Packages in this repo p.cardano-api p.cardano-api-gen + p.cardano-wasm + p.cardano-rpc # Work around for issue created by our inability to register sublibs. # This package may need to be built and we need to make sure its dependencies # are included in `ghc-pkg list` (in particular `compact`)