diff --git a/cabal.project b/cabal.project index 30bffd7256..451ec37347 100644 --- a/cabal.project +++ b/cabal.project @@ -13,8 +13,8 @@ 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 2024-10-10T08:11:33Z - , cardano-haskell-packages 2024-10-14T23:19:53Z + , hackage.haskell.org 2024-11-20T00:00:00Z + , cardano-haskell-packages 2024-11-27T20:49:28Z packages: cardano-api @@ -51,4 +51,69 @@ write-ghc-environment-files: always constraints: Cabal < 3.14, - cardano-ledger-shelley ^>= 1.14.1 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-ledger.git + tag: 75c4006eba366b41831ddf11083c8368605254ae + --sha256: sha256-zPkntErLZaE8vfoTH9K4EhmWYEe8l5zExIEP2R0q7ZQ= + subdir: + eras/allegra/impl + eras/alonzo/impl + eras/alonzo/test-suite + eras/babbage/impl + eras/babbage/test-suite + eras/byron/chain/executable-spec + eras/byron/crypto + eras/byron/crypto/test + eras/byron/ledger/executable-spec + eras/byron/ledger/impl + eras/byron/ledger/impl/test + eras/conway/impl + eras/conway/test-suite + eras/mary/impl + eras/shelley/impl + eras/shelley-ma/test-suite + eras/shelley/test-suite + libs/cardano-data + libs/cardano-ledger-api + libs/cardano-ledger-binary + libs/cardano-ledger-core + libs/cardano-protocol-tpraos + libs/non-integral + libs/plutus-preprocessor + libs/set-algebra + libs/small-steps + libs/vector-map + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-network.git + tag: 7e8909f97d6ecc9fff320b3ac2b785aec74751c6 + --sha256: sha256-Evv2EwaXbr2tXlxnHVr/AAV+QB7B8EWJbQR6t4IvOQ4= + subdir: + cardano-client + cardano-ping + monoidal-synchronisation + network-mux + ntp-client + ouroboros-network + ouroboros-network-api + ouroboros-network-framework + ouroboros-network-mock + ouroboros-network-protocols + ouroboros-network-testing + quickcheck-monoids + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus.git + tag: 91ed216681757b02d24d4bc6e1bcc293dda03d7c + --sha256: sha256-RHRku+LQxT3H7IL4iu6LWD6GdmQXmYw3GlVgq0HuNGA= + subdir: + ouroboros-consensus + ouroboros-consensus-cardano + ouroboros-consensus-protocol + ouroboros-consensus-diffusion + sop-extras + strict-sop-core diff --git a/cardano-api-gen/cardano-api-gen.cabal b/cardano-api-gen/cardano-api-gen.cabal index 8621228972..9720e11f4e 100644 --- a/cardano-api-gen/cardano-api-gen.cabal +++ b/cardano-api-gen/cardano-api-gen.cabal @@ -17,7 +17,7 @@ license-files: NOTICE build-type: Simple -extra-source-files: +extra-doc-files: CHANGELOG.md README.md diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index a2d21fb328..2b9b134dfe 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -173,7 +173,7 @@ library internal cardano-data >=1.0, cardano-ledger-allegra >=1.6, cardano-ledger-alonzo >=1.10.2, - cardano-ledger-api ^>=1.9.3, + cardano-ledger-api >=1.9.3, cardano-ledger-babbage >=1.9, cardano-ledger-binary >=1.3, cardano-ledger-byron >=1.0.1, @@ -202,16 +202,17 @@ library internal microlens-aeson, mtl, network, + network-mux, ouroboros-consensus ^>=0.21, ouroboros-consensus-cardano ^>=0.20, ouroboros-consensus-diffusion ^>=0.18, ouroboros-consensus-protocol ^>=0.9.0.2, ouroboros-network, - ouroboros-network-api ^>=0.10, + ouroboros-network-api ^>=0.11, ouroboros-network-framework, ouroboros-network-protocols, parsec, - plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.36, + plutus-ledger-api:{plutus-ledger-api, plutus-ledger-api-testlib} ^>=1.37, prettyprinter, prettyprinter-ansi-terminal, prettyprinter-configurable ^>=1.36, @@ -226,7 +227,7 @@ library internal time, transformers, transformers-except ^>=0.1.3, - typed-protocols ^>=0.1.1, + typed-protocols ^>=0.3, vector, yaml, @@ -261,8 +262,9 @@ library deepseq, memory, nothunks, + ouroboros-network, ouroboros-network-protocols, - typed-protocols ^>=0.1.1, + typed-protocols, library gen import: project-config @@ -324,7 +326,7 @@ test-suite cardano-api-test cardano-crypto-test ^>=1.5, cardano-crypto-tests ^>=2.1, cardano-ledger-alonzo, - cardano-ledger-api ^>=1.9, + cardano-ledger-api >=1.9, cardano-ledger-binary, cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14, cardano-ledger-mary, @@ -395,7 +397,7 @@ test-suite cardano-api-golden cardano-crypto-class ^>=2.1.2, cardano-data >=1.0, cardano-ledger-alonzo, - cardano-ledger-api ^>=1.9, + cardano-ledger-api >=1.9, cardano-ledger-babbage >=1.9, cardano-ledger-binary, cardano-ledger-core:{cardano-ledger-core, testlib} >=1.14, @@ -409,7 +411,7 @@ test-suite cardano-api-golden hedgehog-extras ^>=0.6.1.0, microlens, parsec, - plutus-core ^>=1.36, + plutus-core ^>=1.37, plutus-ledger-api, tasty, tasty-hedgehog, diff --git a/cardano-api/internal/Cardano/Api/Block.hs b/cardano-api/internal/Cardano/Api/Block.hs index 7e3a0ae83f..cdc0ec9824 100644 --- a/cardano-api/internal/Cardano/Api/Block.hs +++ b/cardano-api/internal/Cardano/Api/Block.hs @@ -62,7 +62,7 @@ import qualified Cardano.Crypto.Hash.Class as Crypto import qualified Cardano.Crypto.Hashing import qualified Cardano.Ledger.Api as L import qualified Cardano.Ledger.Block as Ledger -import qualified Cardano.Ledger.Era as Ledger +import qualified Cardano.Ledger.Core as Ledger import Cardano.Slotting.Block (BlockNo) import Cardano.Slotting.Slot (EpochNo, SlotNo, WithOrigin (..)) import qualified Ouroboros.Consensus.Block as Consensus diff --git a/cardano-api/internal/Cardano/Api/Certificate.hs b/cardano-api/internal/Cardano/Api/Certificate.hs index b31ab11135..fba008b1ed 100644 --- a/cardano-api/internal/Cardano/Api/Certificate.hs +++ b/cardano-api/internal/Cardano/Api/Certificate.hs @@ -98,6 +98,7 @@ import Cardano.Api.StakePoolMetadata import Cardano.Api.Utils (noInlineMaybeToStrictMaybe) import Cardano.Api.Value +import qualified Cardano.Crypto.Hash as Hash import Cardano.Ledger.BaseTypes (strictMaybe) import qualified Cardano.Ledger.Coin as L import qualified Cardano.Ledger.Keys as Ledger @@ -362,7 +363,7 @@ makeStakePoolRetirementCertificate req = ConwayCertificate atMostBab $ Ledger.mkRetirePoolTxCert (unStakePoolKeyHash poolId) retirementEpoch -data GenesisKeyDelegationRequirements ere where +data GenesisKeyDelegationRequirements era where GenesisKeyDelegationRequirements :: ShelleyToBabbageEra era -> Hash GenesisKey @@ -381,7 +382,7 @@ makeGenesisKeyDelegationCertificate ShelleyRelatedCertificate atMostEra $ shelleyToBabbageEraConstraints atMostEra $ Ledger.ShelleyTxCertGenesisDeleg $ - Ledger.GenesisDelegCert hGenKey hGenDelegKey hVrfKey + Ledger.GenesisDelegCert hGenKey hGenDelegKey (Ledger.VRFVerKeyHash . Hash.castHash $ hVrfKey) data MirCertificateRequirements era where MirCertificateRequirements @@ -613,7 +614,7 @@ toShelleyPoolParams -- do simple client-side sanity checks, e.g. on the pool metadata url Ledger.PoolParams { Ledger.ppId = poolkh - , Ledger.ppVrf = vrfkh + , Ledger.ppVrf = Ledger.VRFVerKeyHash . Hash.castHash $ vrfkh , Ledger.ppPledge = stakePoolPledge , Ledger.ppCost = stakePoolCost , Ledger.ppMargin = @@ -685,7 +686,7 @@ fromShelleyPoolParams } = StakePoolParameters { stakePoolId = StakePoolKeyHash ppId - , stakePoolVRF = VrfKeyHash ppVrf + , stakePoolVRF = VrfKeyHash (Hash.castHash . Ledger.unVRFVerKeyHash $ ppVrf) , stakePoolCost = ppCost , stakePoolMargin = Ledger.unboundRational ppMargin , stakePoolRewardAccount = fromShelleyStakeAddr ppRewardAccount diff --git a/cardano-api/internal/Cardano/Api/IPC.hs b/cardano-api/internal/Cardano/Api/IPC.hs index c277fc35a5..bfba54487b 100644 --- a/cardano-api/internal/Cardano/Api/IPC.hs +++ b/cardano-api/internal/Cardano/Api/IPC.hs @@ -122,6 +122,7 @@ import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Client as Net.Tx import Control.Concurrent.STM (TMVar, atomically, newEmptyTMVarIO, putTMVar, takeTMVar, tryPutTMVar) +import Control.Exception (throwIO) import Control.Monad (void) import Control.Monad.IO.Class import Control.Tracer (nullTracer) @@ -129,6 +130,7 @@ import Data.Aeson (ToJSON, object, toJSON, (.=)) import qualified Data.ByteString.Lazy as LBS import Data.Void (Void) import GHC.Exts (IsList (..)) +import qualified Network.Mux as Net -- ---------------------------------------------------------------------------- -- The types for the client side of the node-to-client IPC protocols @@ -202,15 +204,19 @@ connectToLocalNodeWithVersion , localConsensusModeParams } clients = - liftIO $ Net.withIOManager $ \iomgr -> - Net.connectTo - (Net.localSnocket iomgr) - Net.NetworkConnectTracers - { Net.nctMuxTracer = nullTracer - , Net.nctHandshakeTracer = nullTracer - } - versionedProtocls - (unFile localNodeSocketPath) + liftIO $ Net.withIOManager $ \iomgr -> do + r <- + Net.connectTo + (Net.localSnocket iomgr) + Net.NetworkConnectTracers + { Net.nctMuxTracer = nullTracer + , Net.nctHandshakeTracer = nullTracer + } + versionedProtocls + (unFile localNodeSocketPath) + case r of + Left e -> throwIO e + Right _ -> pure () where versionedProtocls = -- First convert from the mode-parametrised view of things to the @@ -302,10 +308,11 @@ mkVersionedProtocols networkid ptcl unversionedClients = ) , localStateQueryProtocol = Net.InitiatorProtocolOnly $ - Net.mkMiniProtocolCbFromPeer $ + Net.mkMiniProtocolCbFromPeerSt $ const ( nullTracer , cStateQueryCodec + , Net.Query.StateIdle , maybe Net.localStateQueryPeerNull Net.Query.localStateQueryClientPeer diff --git a/cardano-api/internal/Cardano/Api/Keys/Praos.hs b/cardano-api/internal/Cardano/Api/Keys/Praos.hs index ad83c77b94..cca7caa20e 100644 --- a/cardano-api/internal/Cardano/Api/Keys/Praos.hs +++ b/cardano-api/internal/Cardano/Api/Keys/Praos.hs @@ -200,7 +200,7 @@ instance Key VrfKey where verificationKeyHash :: VerificationKey VrfKey -> Hash VrfKey verificationKeyHash (VrfVerificationKey vkey) = - VrfKeyHash (Shelley.hashVerKeyVRF vkey) + VrfKeyHash (Crypto.hashVerKeyVRF vkey) instance SerialiseAsRawBytes (VerificationKey VrfKey) where serialiseToRawBytes (VrfVerificationKey vk) = diff --git a/cardano-api/internal/Cardano/Api/LedgerEvents/ConvertLedgerEvent.hs b/cardano-api/internal/Cardano/Api/LedgerEvents/ConvertLedgerEvent.hs index f8ab2b4ad9..0399ffc5df 100644 --- a/cardano-api/internal/Cardano/Api/LedgerEvents/ConvertLedgerEvent.hs +++ b/cardano-api/internal/Cardano/Api/LedgerEvents/ConvertLedgerEvent.hs @@ -170,6 +170,8 @@ toLedgerEventConway evt = case govEvent of Conway.GovNewProposals txid props -> Just $ NewGovernanceProposals txid (AnyProposals props) + Conway.GovRemovedVotes txid replacedVotes unregisteredDReps -> + Just $ RemovedGovernanceVotes txid replacedVotes unregisteredDReps instance ConvertLedgerEvent (HardForkBlock (Consensus.CardanoEras StandardCrypto)) where toLedgerEvent wrappedLedgerEvent = diff --git a/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs b/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs index 04569fe33a..4c593243aa 100644 --- a/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs +++ b/cardano-api/internal/Cardano/Api/LedgerEvents/LedgerEvent.hs @@ -67,6 +67,13 @@ data LedgerEvent -- | Newly submittted governance proposals in a single transaction. NewGovernanceProposals (Ledger.TxId StandardCrypto) AnyProposals + | -- | Governance votes that were invalidated. + RemovedGovernanceVotes + (Ledger.TxId StandardCrypto) + (Set (Ledger.Voter StandardCrypto, Ledger.GovActionId StandardCrypto)) + -- ^ Votes that were replaced in this tx. + (Set (Ledger.Credential 'Ledger.DRepRole StandardCrypto)) + -- ^ Any votes from these DReps in this or in previous txs are removed | -- | The current state of governance matters at the epoch boundary. -- I.E the current constitution, committee, protocol parameters, etc. EpochBoundaryRatificationState AnyRatificationState diff --git a/cardano-api/internal/Cardano/Api/LedgerState.hs b/cardano-api/internal/Cardano/Api/LedgerState.hs index a960aaaf72..016b815fb5 100644 --- a/cardano-api/internal/Cardano/Api/LedgerState.hs +++ b/cardano-api/internal/Cardano/Api/LedgerState.hs @@ -125,6 +125,7 @@ import qualified Cardano.Binary as CBOR import qualified Cardano.Chain.Genesis import qualified Cardano.Chain.Update import Cardano.Crypto (ProtocolMagicId (unProtocolMagicId), RequiresNetworkMagic (..)) +import qualified Cardano.Crypto.Hash as Hash import qualified Cardano.Crypto.Hash.Blake2b import qualified Cardano.Crypto.Hash.Class import qualified Cardano.Crypto.Hashing @@ -176,7 +177,6 @@ import Ouroboros.Consensus.Storage.Serialisation import Ouroboros.Consensus.TypeFamilyWrappers (WrapLedgerEvent (WrapLedgerEvent)) import Ouroboros.Network.Block (blockNo) import qualified Ouroboros.Network.Block -import Ouroboros.Network.Mux (MuxError) import qualified Ouroboros.Network.Protocol.ChainSync.Client as CS import qualified Ouroboros.Network.Protocol.ChainSync.ClientPipelined as CSP import Ouroboros.Network.Protocol.ChainSync.PipelineDecision @@ -220,7 +220,8 @@ import qualified Data.Yaml as Yaml import Formatting.Buildable (build) import GHC.Exts (IsList (..)) import Lens.Micro -import Network.TypedProtocol.Pipelined (Nat (..)) +import qualified Network.Mux as Mux +import Network.TypedProtocol.Core (Nat (..)) import System.FilePath data InitialLedgerStateError @@ -374,7 +375,7 @@ data FoldBlocksError = FoldBlocksInitialLedgerStateError !InitialLedgerStateError | FoldBlocksApplyBlockError !LedgerStateError | FoldBlocksIOException !IOException - | FoldBlocksMuxError !MuxError + | FoldBlocksMuxError !Mux.Error deriving Show instance Error FoldBlocksError where @@ -1097,45 +1098,45 @@ instance FromJSON NodeConfig where <*> parseBabbageHardForkEpoch o <*> parseConwayHardForkEpoch o - parseShelleyHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseShelleyHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseShelleyHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestShelleyHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 2 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestShelleyHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseAllegraHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseAllegraHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseAllegraHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestAllegraHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 3 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestAllegraHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseMaryHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseMaryHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseMaryHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestMaryHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 4 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestMaryHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseAlonzoHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseAlonzoHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseAlonzoHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestAlonzoHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 5 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestAlonzoHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseBabbageHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseBabbageHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseBabbageHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestBabbageHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 7 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestBabbageHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] - parseConwayHardForkEpoch :: Object -> Parser Consensus.TriggerHardFork + parseConwayHardForkEpoch :: Object -> Parser (Consensus.CardanoHardForkTrigger blk) parseConwayHardForkEpoch o = asum - [ Consensus.TriggerHardForkAtEpoch <$> o .: "TestConwayHardForkAtEpoch" - , pure $ Consensus.TriggerHardForkAtVersion 9 -- Mainnet default + [ Consensus.CardanoTriggerHardForkAtEpoch <$> o .: "TestConwayHardForkAtEpoch" + , pure Consensus.CardanoTriggerHardForkAtDefaultVersion ] ---------------------------------------------------------------------- @@ -2291,6 +2292,6 @@ toLedgerIndividualPoolStake :: Consensus.IndividualPoolStake c -> SL.IndividualP toLedgerIndividualPoolStake ips = SL.IndividualPoolStake { SL.individualPoolStake = Consensus.individualPoolStake ips - , SL.individualPoolStakeVrf = Consensus.individualPoolStakeVrf ips + , SL.individualPoolStakeVrf = SL.VRFVerKeyHash . Hash.castHash $ Consensus.individualPoolStakeVrf ips , SL.individualTotalPoolStake = SL.CompactCoin 0 } diff --git a/cardano-api/internal/Cardano/Api/Orphans.hs b/cardano-api/internal/Cardano/Api/Orphans.hs index a52f6840d0..fe85b5c174 100644 --- a/cardano-api/internal/Cardano/Api/Orphans.hs +++ b/cardano-api/internal/Cardano/Api/Orphans.hs @@ -73,7 +73,6 @@ import qualified Ouroboros.Consensus.Shelley.Eras as Consensus import Ouroboros.Consensus.Shelley.Ledger.Block (ShelleyHash (..)) import qualified Ouroboros.Consensus.Shelley.Ledger.Query as Consensus import Ouroboros.Network.Block (HeaderHash, Tip (..)) -import Ouroboros.Network.Mux (MuxError) import qualified PlutusLedgerApi.Common as P import qualified PlutusLedgerApi.V2 as V2 @@ -98,6 +97,7 @@ import GHC.Generics import GHC.Stack (HasCallStack) import GHC.TypeLits import Lens.Micro +import qualified Network.Mux as Mux deriving instance Generic (L.ApplyTxError era) @@ -558,7 +558,7 @@ instance Semigroup (Ledger.ConwayPParams StrictMaybe era) where lastMappendWithTHKD :: (a -> Ledger.THKD g StrictMaybe b) -> a -> a -> Ledger.THKD g StrictMaybe b lastMappendWithTHKD f a b = Ledger.THKD $ lastMappendWith (Ledger.unTHKD . f) a b -instance Pretty MuxError where +instance Pretty Mux.Error where pretty err = "Mux layer error:" <+> prettyException err instance A.FromJSON V2.ParamName where diff --git a/cardano-api/internal/Cardano/Api/Query.hs b/cardano-api/internal/Cardano/Api/Query.hs index cf71e03976..445804e7dc 100644 --- a/cardano-api/internal/Cardano/Api/Query.hs +++ b/cardano-api/internal/Cardano/Api/Query.hs @@ -155,12 +155,12 @@ data QueryInMode result where instance NodeToClientVersionOf (QueryInMode result) where nodeToClientVersionOf = \case - QueryCurrentEra -> NodeToClientV_9 + QueryCurrentEra -> NodeToClientV_16 QueryInEra q -> nodeToClientVersionOf q - QueryEraHistory -> NodeToClientV_9 - QuerySystemStart -> NodeToClientV_9 - QueryChainBlockNo -> NodeToClientV_10 - QueryChainPoint -> NodeToClientV_10 + QueryEraHistory -> NodeToClientV_16 + QuerySystemStart -> NodeToClientV_16 + QueryChainBlockNo -> NodeToClientV_16 + QueryChainPoint -> NodeToClientV_16 data EraHistory where EraHistory @@ -219,7 +219,7 @@ data QueryInEra era result where -> QueryInEra era result instance NodeToClientVersionOf (QueryInEra era result) where - nodeToClientVersionOf QueryByronUpdateState = NodeToClientV_9 + nodeToClientVersionOf QueryByronUpdateState = NodeToClientV_16 nodeToClientVersionOf (QueryInShelleyBasedEra _ q) = nodeToClientVersionOf q deriving instance Show (QueryInEra era result) @@ -302,23 +302,23 @@ data QueryInShelleyBasedEra era result where -- * https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/Ouroboros-Network-NodeToClient.html#t:NodeToClientVersion -- * https://ouroboros-consensus.cardano.intersectmbo.org/docs/for-developers/QueryVersioning/#implementation instance NodeToClientVersionOf (QueryInShelleyBasedEra era result) where - nodeToClientVersionOf QueryEpoch = NodeToClientV_9 - nodeToClientVersionOf QueryGenesisParameters = NodeToClientV_9 - nodeToClientVersionOf QueryProtocolParameters = NodeToClientV_9 - nodeToClientVersionOf QueryProtocolParametersUpdate = NodeToClientV_9 - nodeToClientVersionOf QueryStakeDistribution = NodeToClientV_9 + nodeToClientVersionOf QueryEpoch = NodeToClientV_16 + nodeToClientVersionOf QueryGenesisParameters = NodeToClientV_16 + nodeToClientVersionOf QueryProtocolParameters = NodeToClientV_16 + nodeToClientVersionOf QueryProtocolParametersUpdate = NodeToClientV_16 + nodeToClientVersionOf QueryStakeDistribution = NodeToClientV_16 nodeToClientVersionOf (QueryUTxO f) = nodeToClientVersionOf f - nodeToClientVersionOf (QueryStakeAddresses _ _) = NodeToClientV_9 - nodeToClientVersionOf QueryStakePools = NodeToClientV_9 - nodeToClientVersionOf (QueryStakePoolParameters _) = NodeToClientV_9 - nodeToClientVersionOf QueryDebugLedgerState = NodeToClientV_9 - nodeToClientVersionOf QueryProtocolState = NodeToClientV_9 - nodeToClientVersionOf QueryCurrentEpochState = NodeToClientV_9 + nodeToClientVersionOf (QueryStakeAddresses _ _) = NodeToClientV_16 + nodeToClientVersionOf QueryStakePools = NodeToClientV_16 + nodeToClientVersionOf (QueryStakePoolParameters _) = NodeToClientV_16 + nodeToClientVersionOf QueryDebugLedgerState = NodeToClientV_16 + nodeToClientVersionOf QueryProtocolState = NodeToClientV_16 + nodeToClientVersionOf QueryCurrentEpochState = NodeToClientV_16 -- Babbage >= v13 - nodeToClientVersionOf (QueryPoolState _) = NodeToClientV_14 - nodeToClientVersionOf (QueryPoolDistribution _) = NodeToClientV_14 - nodeToClientVersionOf (QueryStakeSnapshot _) = NodeToClientV_14 - nodeToClientVersionOf (QueryStakeDelegDeposits _) = NodeToClientV_15 + nodeToClientVersionOf (QueryPoolState _) = NodeToClientV_16 + nodeToClientVersionOf (QueryPoolDistribution _) = NodeToClientV_16 + nodeToClientVersionOf (QueryStakeSnapshot _) = NodeToClientV_16 + nodeToClientVersionOf (QueryStakeDelegDeposits _) = NodeToClientV_16 -- Conway >= v16 nodeToClientVersionOf QueryAccountState = NodeToClientV_16 nodeToClientVersionOf QueryConstitution = NodeToClientV_16 @@ -351,9 +351,9 @@ data QueryUTxOFilter deriving (Eq, Show) instance NodeToClientVersionOf QueryUTxOFilter where - nodeToClientVersionOf QueryUTxOWhole = NodeToClientV_9 - nodeToClientVersionOf (QueryUTxOByAddress _) = NodeToClientV_9 - nodeToClientVersionOf (QueryUTxOByTxIn _) = NodeToClientV_9 + nodeToClientVersionOf QueryUTxOWhole = NodeToClientV_16 + nodeToClientVersionOf (QueryUTxOByAddress _) = NodeToClientV_16 + nodeToClientVersionOf (QueryUTxOByTxIn _) = NodeToClientV_16 newtype ByronUpdateState = ByronUpdateState Byron.Update.State deriving Show diff --git a/cardano-api/src/Cardano/Api/ChainSync/Client.hs b/cardano-api/src/Cardano/Api/ChainSync/Client.hs index 39c5c56da4..30fca163db 100644 --- a/cardano-api/src/Cardano/Api/ChainSync/Client.hs +++ b/cardano-api/src/Cardano/Api/ChainSync/Client.hs @@ -8,11 +8,12 @@ module Cardano.Api.ChainSync.Client , ClientStIntersect (..) -- * Null chain sync client - , chainSyncClientNull + , chainSyncPeerNull -- * Utilities , mapChainSyncClient ) where +import Ouroboros.Network.NodeToClient import Ouroboros.Network.Protocol.ChainSync.Client diff --git a/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs b/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs index 0ff1ba8e89..e794708a29 100644 --- a/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs +++ b/cardano-api/src/Cardano/Api/ChainSync/ClientPipelined.hs @@ -34,4 +34,4 @@ where import Ouroboros.Network.Protocol.ChainSync.ClientPipelined import Ouroboros.Network.Protocol.ChainSync.PipelineDecision -import Network.TypedProtocol.Pipelined (N (..), Nat (..), natToInt) +import Network.TypedProtocol.Core (N (..), Nat (..), natToInt) diff --git a/cardano-api/test/cardano-api-golden/Test/Golden/Cardano/Api/Genesis.hs b/cardano-api/test/cardano-api-golden/Test/Golden/Cardano/Api/Genesis.hs index a6d84e1243..55df6d01e3 100644 --- a/cardano-api/test/cardano-api-golden/Test/Golden/Cardano/Api/Genesis.hs +++ b/cardano-api/test/cardano-api-golden/Test/Golden/Cardano/Api/Genesis.hs @@ -9,6 +9,7 @@ where import Cardano.Api.Shelley (ShelleyGenesis (..)) +import qualified Cardano.Crypto.Hash as Hash import Cardano.Ledger.Address (Addr (..)) import Cardano.Ledger.BaseTypes (Network (..)) import Cardano.Ledger.Coin (Coin (..)) @@ -17,7 +18,7 @@ import Cardano.Ledger.Credential (Credential (..), PaymentCredential, StakeReference (..)) import Cardano.Ledger.Crypto (StandardCrypto) import Cardano.Ledger.Keys (GenDelegPair (..), Hash, KeyHash (..), KeyRole (..), - VerKeyVRF) + VRFVerKeyHash (..), VerKeyVRF) import Cardano.Ledger.Shelley.Genesis (emptyGenesisStaking) import Cardano.Slotting.Slot (EpochSize (..)) @@ -51,7 +52,7 @@ exampleShelleyGenesis = fromList [ ( genesisVerKeyHash - , GenDelegPair delegVerKeyHash delegVrfKeyHash + , GenDelegPair delegVerKeyHash (VRFVerKeyHash . Hash.castHash $ delegVrfKeyHash) ) ] , sgInitialFunds = ListMap [(initialFundedAddress, initialFunds)] diff --git a/flake.lock b/flake.lock index 785b5bc9f9..032b8bd35f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1728953092, - "narHash": "sha256-DBqT9uexf/yoZjtEP3263ltnhP/o7iBl8IZdJRfPjJs=", + "lastModified": 1732742574, + "narHash": "sha256-XUhDWQeChjNPcYluz8sCbs5vW+3jEYysxEhpKdFXbt0=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "fd5e5cf056090977ecbd661ad07f602eb7e2614d", + "rev": "375a4694472aa362b7abba0e8b7f3de787e90c91", "type": "github" }, "original": { @@ -205,11 +205,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1728952051, - "narHash": "sha256-nCNldd8iA8/T3qUKbSFzBmiHu4oFjmgwz0DFrZaUJhU=", + "lastModified": 1732062550, + "narHash": "sha256-7WEgL74nWqnuue00ZgFCRdmB9ZFMCdN94pMS8OJUUZE=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "1762ac2d3054cb53246ff77e8a6786f6d7357b4f", + "rev": "ad8f3fa0751f7e50ca7c1a6b49410ea92ccf003e", "type": "github" }, "original": { @@ -258,11 +258,11 @@ "stackage": "stackage" }, "locked": { - "lastModified": 1723683036, - "narHash": "sha256-pT74TrE+bCaeXhYLYJrZVocwopwwua4qOwN7waUdUpU=", + "lastModified": 1732063900, + "narHash": "sha256-uuaN+jFurAw5h1vntx4Jcqy1vGJaReXJSbTuR1q5rf0=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "88aeace47b5e43cb4df5f96e754179293c06f47c", + "rev": "3cca9b78a23dcb2146b4fe0aef12b9d2e8e6213c", "type": "github" }, "original": { @@ -427,16 +427,16 @@ "hls-2.9": { "flake": false, "locked": { - "lastModified": 1718469202, - "narHash": "sha256-THXSz+iwB1yQQsr/PY151+2GvtoJnTIB2pIQ4OzfjD4=", + "lastModified": 1720003792, + "narHash": "sha256-qnDx8Pk0UxtoPr7BimEsAZh9g2WuTuMB/kGqnmdryKs=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "40891bccb235ebacce020b598b083eab9dda80f1", + "rev": "0c1817cb2babef0765e4e72dd297c013e8e3d12b", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.9.0.0", + "ref": "2.9.0.1", "repo": "haskell-language-server", "type": "github" } @@ -685,11 +685,11 @@ }, "nixpkgs-2405": { "locked": { - "lastModified": 1720122915, - "narHash": "sha256-Nby8WWxj0elBu1xuRaUcRjPi/rU3xVbkAt2kj4QwX2U=", + "lastModified": 1729242558, + "narHash": "sha256-VgcLDu4igNT0eYua6OAl9pWCI0cYXhDbR+pWP44tte0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "835cf2d3f37989c5db6585a28de967a667a75fb1", + "rev": "4a3f2d3195b60d07530574988df92e049372c10e", "type": "github" }, "original": { @@ -717,11 +717,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1720181791, - "narHash": "sha256-i4vJL12/AdyuQuviMMd1Hk2tsGt02hDNhA0Zj1m16N8=", + "lastModified": 1729980323, + "narHash": "sha256-eWPRZAlhf446bKSmzw6x7RWEE4IuZgAp8NW3eXZwRAY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4284c2b73c8bce4b46a6adf23e16d9e2ec8da4bb", + "rev": "86e78d3d2084ff87688da662cf78c2af085d8e73", "type": "github" }, "original": { @@ -815,11 +815,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1723594352, - "narHash": "sha256-cQVhF1M1et3/XNE1sclwH39prxIDMUojTdnW61t3YrM=", + "lastModified": 1732061500, + "narHash": "sha256-exwtyDeUn6BwKd5gWseAT8SVn+na/YGw/VIwuBkeUd0=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "c077da02c56031a78adc4bf0cf2b182effc895ed", + "rev": "000b2806cef5408df133a22bc5460ec91b25606b", "type": "github" }, "original": { diff --git a/scripts/ci/check-cabal-files.sh b/scripts/ci/check-cabal-files.sh index 5771c266d5..7efa2def26 100755 --- a/scripts/ci/check-cabal-files.sh +++ b/scripts/ci/check-cabal-files.sh @@ -6,6 +6,6 @@ for cabal_file in $(git ls-files "*.cabal") do cd "$(dirname "$cabal_file")" || { echo "Cannot cd"; exit 1; } echo "$(pwd)> cabal-check" - cabal check + cabal check --ignore=missing-upper-bounds cd - || { echo "Cannot cd back"; exit 1; } done