diff --git a/.github/workflows/check-mainnet-config.yml b/.github/workflows/check-mainnet-config.yml index a9549738c2f..ee3059ea722 100644 --- a/.github/workflows/check-mainnet-config.yml +++ b/.github/workflows/check-mainnet-config.yml @@ -56,4 +56,3 @@ jobs: exit 1 fi done - diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 2629c2f65e7..53563dcc5cb 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -38,7 +38,7 @@ jobs: env: # Modify this value to "invalidate" the cabal cache. - CABAL_CACHE_VERSION: "2024-01-24" + CABAL_CACHE_VERSION: "2024-02-07" concurrency: group: > diff --git a/bench/locli/locli.cabal b/bench/locli/locli.cabal index 8415871c54d..6e7c64909a5 100644 --- a/bench/locli/locli.cabal +++ b/bench/locli/locli.cabal @@ -121,7 +121,7 @@ library , optparse-generic , ouroboros-consensus -- for Data.SOP.Strict: - , ouroboros-network ^>= 0.10 + , ouroboros-network ^>= 0.11 , ouroboros-network-api , process , quiet @@ -175,7 +175,7 @@ test-suite test-locli build-depends: cardano-prelude , containers , hedgehog - , hedgehog-extras ^>= 0.6.0.1 + , hedgehog-extras ^>= 0.6.0 , locli , text diff --git a/bench/plutus-scripts-bench/plutus-scripts-bench.cabal b/bench/plutus-scripts-bench/plutus-scripts-bench.cabal index 2a4efdcbc3e..5e6991476c6 100644 --- a/bench/plutus-scripts-bench/plutus-scripts-bench.cabal +++ b/bench/plutus-scripts-bench/plutus-scripts-bench.cabal @@ -27,7 +27,7 @@ common project-config if os(windows) buildable: False - if impl(ghc < 9) + if impl(ghc < 9.6) buildable: False @@ -73,7 +73,7 @@ library -- IOG dependencies -------------------------- build-depends: - , cardano-api ^>= 8.37.1.0 + , cardano-api ^>= 8.38 , plutus-ledger-api >=1.0.0 , plutus-tx >=1.0.0 , plutus-tx-plugin >=1.0.0 diff --git a/bench/plutus-scripts-bench/src/Cardano/Benchmarking/PlutusScripts/CustomCallTypes.hs b/bench/plutus-scripts-bench/src/Cardano/Benchmarking/PlutusScripts/CustomCallTypes.hs index 601ee01491f..a2c33988391 100644 --- a/bench/plutus-scripts-bench/src/Cardano/Benchmarking/PlutusScripts/CustomCallTypes.hs +++ b/bench/plutus-scripts-bench/src/Cardano/Benchmarking/PlutusScripts/CustomCallTypes.hs @@ -4,6 +4,7 @@ {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE ViewPatterns #-} module Cardano.Benchmarking.PlutusScripts.CustomCallTypes where diff --git a/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs b/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs index 76ef6ee3d8f..78b7ca6cdc7 100644 --- a/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs +++ b/bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs @@ -73,6 +73,7 @@ import Cardano.Benchmarking.Script.Env hiding (Error (TxGenError)) import qualified Cardano.Benchmarking.Script.Env as Env (Error (TxGenError)) import Cardano.Benchmarking.Script.Types import Cardano.Benchmarking.Version as Version +import Ouroboros.Network.Protocol.LocalStateQuery.Type (Target (..)) liftCoreWithEra :: AnyCardanoEra -> (forall era. IsShelleyBasedEra era => AsType era -> ExceptT TxGenError IO x) -> ActionM (Either TxGenError x) liftCoreWithEra era coreCall = withEra era ( liftIO . runExceptT . coreCall) @@ -167,7 +168,7 @@ queryEra :: ActionM AnyCardanoEra queryEra = do localNodeConnectInfo <- getLocalConnectInfo chainTip <- liftIO $ getLocalChainTip localNodeConnectInfo - ret <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) QueryCurrentEra + ret <- liftIO $ queryNodeLocalState localNodeConnectInfo (SpecificPoint $ chainTipToChainPoint chainTip) QueryCurrentEra case ret of Right era -> return era Left err -> liftTxGenError $ TxGenError $ show err @@ -182,7 +183,7 @@ queryRemoteProtocolParameters = do QueryInEra era (Ledger.PParams (ShelleyLedgerEra era)) -> ActionM ProtocolParameters callQuery query@(QueryInShelleyBasedEra shelleyEra _) = do - res <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) (QueryInEra query) + res <- liftIO $ queryNodeLocalState localNodeConnectInfo (SpecificPoint $ chainTipToChainPoint chainTip) (QueryInEra query) case res of Right (Right pp) -> do let pp' = fromLedgerPParams shelleyEra pp diff --git a/bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs b/bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs index cfd21e6b4d9..3f445fc4f16 100644 --- a/bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs +++ b/bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs @@ -27,7 +27,7 @@ import Cardano.CLI.Read (readFileScriptInAnyLang) import Cardano.Api import Cardano.Api.Shelley (PlutusScript (..), ProtocolParameters (..), fromAlonzoExUnits, protocolParamCostModels, toPlutusData) -import Cardano.Ledger.Alonzo.Plutus.TxInfo (exBudgetToExUnits) +import Cardano.Ledger.Plutus.TxInfo (exBudgetToExUnits) import qualified PlutusLedgerApi.V1 as PlutusV1 import qualified PlutusLedgerApi.V2 as PlutusV2 @@ -252,7 +252,7 @@ preExecutePlutusV3 (major, _minor) (PlutusScript _ (PlutusScriptSerialised (scri dummyTxInfo = PlutusV3.TxInfo { PlutusV3.txInfoInputs = [] , PlutusV3.txInfoOutputs = [] - , PlutusV3.txInfoFee = mempty + , PlutusV3.txInfoFee = 0 , PlutusV3.txInfoMint = mempty , PlutusV3.txInfoTxCerts = [] , PlutusV3.txInfoWdrl = PlutusV3.fromList [] diff --git a/bench/tx-generator/tx-generator.cabal b/bench/tx-generator/tx-generator.cabal index 249951fecaa..d801f5ec65b 100644 --- a/bench/tx-generator/tx-generator.cabal +++ b/bench/tx-generator/tx-generator.cabal @@ -26,7 +26,7 @@ common project-config buildable: False common with-library - if impl(ghc >= 9) + if impl(ghc >= 9.6) build-depends: plutus-scripts-bench cpp-options: -DWITH_LIBRARY @@ -98,9 +98,9 @@ library , attoparsec-aeson , base16-bytestring , bytestring - , cardano-api ^>= 8.37.1.0 + , cardano-api ^>= 8.38 , cardano-binary - , cardano-cli ^>= 8.19.0.0 + , cardano-cli ^>= 8.20.0.0 , cardano-crypto-class , cardano-crypto-wrapper , cardano-data diff --git a/cabal.project b/cabal.project index 0ee2bcaff0b..37386cc5442 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-01-24T13:20:47Z - , cardano-haskell-packages 2024-01-23T08:57:44Z + , hackage.haskell.org 2024-02-06T15:14:59Z + , cardano-haskell-packages 2024-02-07T07:51:35Z packages: cardano-git-rev diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index 23b71dd5be5..842d5e5c3c9 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -44,7 +44,7 @@ executable cardano-node-chairman build-depends: cardano-api , cardano-crypto-class , cardano-git-rev - , cardano-node ^>= 8.7 + , cardano-node ^>= 8.8 , cardano-prelude , containers , contra-tracer @@ -73,7 +73,7 @@ test-suite chairman-tests , cardano-crypto-class ^>= 2.1.2 , filepath , hedgehog - , hedgehog-extras ^>= 0.6.0.1 + , hedgehog-extras ^>= 0.6.0 , network , process , random @@ -89,5 +89,5 @@ test-suite chairman-tests ghc-options: -threaded -rtsopts -with-rtsopts=-N -with-rtsopts=-T build-tool-depends: cardano-node:cardano-node - , cardano-cli:cardano-cli ^>= 8.19.0.0 + , cardano-cli:cardano-cli ^>= 8.20 , cardano-node-chairman:cardano-node-chairman diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 5142527ef0d..652994602ab 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -1,7 +1,7 @@ cabal-version: 3.0 name: cardano-node -version: 8.7.2 +version: 8.8.0 synopsis: The cardano full node description: The cardano full node. category: Cardano, @@ -144,7 +144,7 @@ library , async , base16-bytestring , bytestring - , cardano-api ^>= 8.37.1.0 + , cardano-api ^>= 8.38 , cardano-crypto-class , cardano-crypto-wrapper , cardano-git-rev @@ -183,14 +183,14 @@ library , network-mux >= 0.4 , nothunks , optparse-applicative-fork >= 0.18.1 - , ouroboros-consensus ^>= 0.14 - , ouroboros-consensus-cardano ^>= 0.12 - , ouroboros-consensus-diffusion ^>= 0.9 + , ouroboros-consensus ^>= 0.15 + , ouroboros-consensus-cardano ^>= 0.13 + , ouroboros-consensus-diffusion ^>= 0.10 , ouroboros-consensus-protocol , ouroboros-network-api - , ouroboros-network ^>= 0.10 + , ouroboros-network ^>= 0.11 , ouroboros-network-framework - , ouroboros-network-protocols ^>= 0.6 + , ouroboros-network-protocols ^>= 0.7 , prettyprinter , prettyprinter-ansi-terminal , psqueues @@ -245,7 +245,7 @@ test-suite cardano-node-test , bytestring , cardano-crypto-class , cardano-crypto-wrapper - , cardano-api + , cardano-api:{cardano-api, internal} , cardano-ledger-core , cardano-node , cardano-slotting diff --git a/cardano-node/src/Cardano/Node/Orphans.hs b/cardano-node/src/Cardano/Node/Orphans.hs index d0a311ed329..b7f64412347 100644 --- a/cardano-node/src/Cardano/Node/Orphans.hs +++ b/cardano-node/src/Cardano/Node/Orphans.hs @@ -1,6 +1,5 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE StandaloneDeriving #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -9,27 +8,12 @@ module Cardano.Node.Orphans () where import Cardano.Api () import Data.Aeson.Types -import qualified Data.Text as Text -import Cardano.BM.Data.Tracer (TracingVerbosity (..)) import Ouroboros.Network.NodeToNode (AcceptedConnectionsLimit (..)) import Ouroboros.Network.SizeInBytes (SizeInBytes (..)) import Text.Printf (PrintfArg (..)) - -instance FromJSON TracingVerbosity where - parseJSON (String str) = case str of - "MinimalVerbosity" -> pure MinimalVerbosity - "MaximalVerbosity" -> pure MaximalVerbosity - "NormalVerbosity" -> pure NormalVerbosity - err -> fail $ "Parsing of TracingVerbosity failed, " - <> Text.unpack err <> " is not a valid TracingVerbosity" - parseJSON invalid = fail $ "Parsing of TracingVerbosity failed due to type mismatch. " - <> "Encountered: " <> show invalid - -deriving instance Show TracingVerbosity - instance PrintfArg SizeInBytes where formatArg (SizeInBytes s) = formatArg s diff --git a/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs b/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs index 2b3638e88c1..d0a574148c0 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs @@ -25,7 +25,7 @@ import qualified Cardano.Crypto.VRF.Class as Crypto import Cardano.Ledger.Allegra.Rules (AllegraUtxoPredFailure) import qualified Cardano.Ledger.Allegra.Rules as Allegra import qualified Cardano.Ledger.Allegra.Scripts as Allegra -import qualified Cardano.Ledger.Alonzo.PlutusScriptApi as Alonzo +import qualified Cardano.Ledger.Alonzo.Plutus.Evaluate as Alonzo import Cardano.Ledger.Alonzo.Rules (AlonzoBbodyPredFailure, AlonzoUtxoPredFailure, AlonzoUtxosPredFailure, AlonzoUtxowPredFailure (..)) import qualified Cardano.Ledger.Alonzo.Rules as Alonzo @@ -72,7 +72,7 @@ import Ouroboros.Network.Point (WithOrigin, withOriginToMaybe) import Data.Aeson (ToJSON (..), Value (..), (.=)) import qualified Data.ByteString.Base16 as B16 -import qualified Data.Map.Strict as Map +import qualified Data.List.NonEmpty as NonEmpty import Data.Set (Set) import qualified Data.Set as Set import Data.Text (Text) @@ -341,16 +341,18 @@ instance DelegsFailure f -> forMachine dtal f instance - ( Consensus.ShelleyBasedEra era - , Ledger.EraCrypto era ~ StandardCrypto - , LogFormatting (PPUPPredFailure era) - , LogFormatting (PredicateFailure (Ledger.EraRule "UTXO" era)) - ) => LogFormatting (AlonzoUtxowPredFailure era) where + ( Api.ShelleyLedgerEra era ~ ledgerera + , Api.IsShelleyBasedEra era + , Consensus.ShelleyBasedEra ledgerera + , Ledger.EraCrypto ledgerera ~ StandardCrypto + , LogFormatting (PPUPPredFailure ledgerera) + , LogFormatting (PredicateFailure (Ledger.EraRule "UTXO" ledgerera)) + ) => LogFormatting (AlonzoUtxowPredFailure ledgerera) where forMachine dtal (ShelleyInAlonzoUtxowPredFailure utxoPredFail) = forMachine dtal utxoPredFail forMachine _ (MissingRedeemers scripts) = mconcat [ "kind" .= String "MissingRedeemers" - , "scripts" .= renderMissingRedeemers scripts + , "scripts" .= renderMissingRedeemers Api.shelleyBasedEra scripts ] forMachine _ (MissingRequiredDatums required received) = mconcat [ "kind" .= String "MissingRequiredDatums" @@ -378,10 +380,15 @@ instance , "acceptable" .= Set.toList acceptable ] forMachine _ (ExtraRedeemers rdmrs) = - mconcat - [ "kind" .= String "ExtraRedeemers" - , "rdmrs" .= map Api.fromAlonzoRdmrPtr rdmrs - ] + Api.caseShelleyToMaryOrAlonzoEraOnwards + (const mempty) + (\alonzoOnwards -> + mconcat + [ "kind" .= String "ExtraRedeemers" + , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) rdmrs + ] + ) + (Api.shelleyBasedEra :: Api.ShelleyBasedEra era) instance ( Consensus.ShelleyBasedEra era @@ -1054,13 +1061,15 @@ instance ] instance - ( Ledger.Era era - , Ledger.EraCrypto era ~ StandardCrypto - , ShelleyBasedEra era - , LogFormatting (PPUPPredFailure era) - , LogFormatting (ShelleyUtxowPredFailure era) - , LogFormatting (PredicateFailure (Ledger.EraRule "UTXO" era)) - ) => LogFormatting (BabbageUtxowPredFailure era) where + ( Api.ShelleyLedgerEra era ~ ledgerera + , Api.IsShelleyBasedEra era + , Ledger.Era ledgerera + , Ledger.EraCrypto ledgerera ~ StandardCrypto + , ShelleyBasedEra ledgerera + , LogFormatting (PPUPPredFailure ledgerera) + , LogFormatting (ShelleyUtxowPredFailure ledgerera) + , LogFormatting (PredicateFailure (Ledger.EraRule "UTXO" ledgerera)) + ) => LogFormatting (BabbageUtxowPredFailure ledgerera) where forMachine v err = case err of Babbage.AlonzoInBabbageUtxowPredFailure alonzoFail -> @@ -1102,7 +1111,7 @@ instance ) => LogFormatting (Conway.ConwayGovPredFailure era) where forMachine _ (Conway.GovActionsDoNotExist govActionIds) = mconcat [ "kind" .= String "GovActionsDoNotExist" - , "govActionId" .= map govActionIdToText (Set.toList govActionIds) + , "govActionId" .= map govActionIdToText (NonEmpty.toList govActionIds) ] forMachine _ (Conway.MalformedProposal govAction) = mconcat [ "kind" .= String "MalformedProposal" @@ -1125,7 +1134,7 @@ instance ] forMachine _ (Conway.DisallowedVoters govActionIdToVoter) = mconcat [ "kind" .= String "DisallowedVoters" - , "govActionIdToVoter" .= Map.toList govActionIdToVoter + , "govActionIdToVoter" .= NonEmpty.toList govActionIdToVoter ] forMachine _ (Conway.ConflictingCommitteeUpdate creds) = mconcat [ "kind" .= String "ConflictingCommitteeUpdate" @@ -1135,14 +1144,25 @@ instance mconcat [ "kind" .= String "ExpirationEpochTooSmall" , "credentialsToEpoch" .= credsToEpoch ] - forMachine _ (Conway.InvalidPrevGovActionIdsInProposals proposals) = - mconcat [ "kind" .= String "InvalidPrevGovActionIdsInProposals" - , "proposals" .= proposals + forMachine _ (Conway.InvalidPrevGovActionId proposalProcedure) = + mconcat [ "kind" .= String "InvalidPrevGovActionId" + , "proposalProcedure" .= proposalProcedure ] forMachine _ (Conway.VotingOnExpiredGovAction actions) = mconcat [ "kind" .= String "VotingOnExpiredGovAction" , "action" .= actions ] + forMachine _ (Conway.ProposalCantFollow prevGovActionId protVer prevProtVer) = + mconcat [ "kind" .= String "ProposalCantFollow" + , "prevGovActionId" .= prevGovActionId + , "protVer" .= protVer + , "prevProtVer" .= prevProtVer + ] + forMachine _ (Conway.InvalidPolicyHash actualPolicyHash expectedPolicyHash) = + mconcat [ "kind" .= String "InvalidPolicyHash" + , "actualPolicyHash" .= actualPolicyHash + , "expectedPolicyHash" .= expectedPolicyHash + ] instance ( Consensus.ShelleyBasedEra era diff --git a/cardano-node/src/Cardano/Node/Tracing/Render.hs b/cardano-node/src/Cardano/Node/Tracing/Render.hs index a2b89b63fad..86db2e80bd0 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Render.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Render.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -38,7 +39,10 @@ import Data.Text (Text) import qualified Data.Text as Text import qualified Data.Text.Encoding as Text +import Cardano.Ledger.Alonzo.Scripts (AlonzoPlutusPurpose (..), AsItem (..), + PlutusPurpose) import qualified Cardano.Ledger.Alonzo.Tx as Alonzo +import Cardano.Ledger.Conway.Scripts (ConwayPlutusPurpose (..)) import qualified Cardano.Ledger.Core as Ledger import Cardano.Ledger.Crypto (StandardCrypto) import qualified Cardano.Ledger.SafeHash as SafeHash @@ -179,34 +183,62 @@ renderScriptIntegrityHash (Just witPPDataHash) = renderScriptIntegrityHash Nothing = Aeson.Null -renderMissingRedeemers :: () - => Ledger.EraCrypto ledgerera ~ StandardCrypto - => [(Alonzo.ScriptPurpose ledgerera, Ledger.ScriptHash StandardCrypto)] +renderMissingRedeemers :: forall era. () + => Api.ShelleyBasedEra era + -> [(PlutusPurpose AsItem (Api.ShelleyLedgerEra era), Ledger.ScriptHash StandardCrypto)] -> Aeson.Value -renderMissingRedeemers scripts = Aeson.object $ map renderTuple scripts +renderMissingRedeemers sbe scripts = Aeson.object $ map renderTuple scripts where renderTuple :: () - => Ledger.EraCrypto ledgerera ~ StandardCrypto - => (Alonzo.ScriptPurpose ledgerera, Ledger.ScriptHash StandardCrypto) + => (PlutusPurpose AsItem (Api.ShelleyLedgerEra era), Ledger.ScriptHash StandardCrypto) -> Aeson.Pair renderTuple (scriptPurpose, sHash) = - Aeson.fromText (renderScriptHash sHash) .= renderScriptPurpose scriptPurpose + Aeson.fromText (renderScriptHash sHash) .= renderScriptPurpose sbe scriptPurpose renderScriptHash :: Ledger.ScriptHash StandardCrypto -> Text renderScriptHash = Api.serialiseToRawBytesHexText . Api.fromShelleyScriptHash renderScriptPurpose :: () - => Ledger.EraCrypto ledgerera ~ StandardCrypto - => Alonzo.ScriptPurpose ledgerera + => Api.ShelleyBasedEra era + -> PlutusPurpose AsItem (Api.ShelleyLedgerEra era) -> Aeson.Value -renderScriptPurpose = \case - Alonzo.Minting pid -> - Aeson.object [ "minting" .= Aeson.toJSON pid] - Alonzo.Spending txin -> - Aeson.object [ "spending" .= Api.fromShelleyTxIn txin] - Alonzo.Rewarding rwdAcct -> - Aeson.object [ "rewarding" .= Aeson.String (Api.serialiseAddress $ Api.fromShelleyStakeAddr rwdAcct)] - Alonzo.Certifying _cert -> - Aeson.object - [ "certifying" .= Aeson.toJSON @String "TODO CIP-1694 unimplemented" -- toJSON (Api.textEnvelopeDefaultDescr $ Api.fromShelleyCertificate sbe cert) - ] +renderScriptPurpose = + Api.caseShelleyToMaryOrAlonzoEraOnwards + (const (const Aeson.Null)) + (\case + Api.AlonzoEraOnwardsAlonzo -> renderAlonzoPlutusPurpose + Api.AlonzoEraOnwardsBabbage -> renderAlonzoPlutusPurpose + Api.AlonzoEraOnwardsConway -> renderConwayPlutusPurpose + ) + +renderAlonzoPlutusPurpose :: () + => (Ledger.EraCrypto era ~ StandardCrypto, Aeson.ToJSON (Ledger.TxCert era)) + => AlonzoPlutusPurpose AsItem era + -> Aeson.Value +renderAlonzoPlutusPurpose = \case + AlonzoSpending (AsItem txin) -> + Aeson.object ["spending" .= Api.fromShelleyTxIn txin] + AlonzoMinting pid -> + Aeson.object ["minting" .= Aeson.toJSON pid] + AlonzoRewarding (AsItem rwdAcct) -> + Aeson.object ["rewarding" .= Aeson.String (Api.serialiseAddress $ Api.fromShelleyStakeAddr rwdAcct)] + AlonzoCertifying cert -> + Aeson.object ["certifying" .= Aeson.toJSON cert] + +renderConwayPlutusPurpose :: () + => (Ledger.EraCrypto era ~ StandardCrypto, Ledger.EraPParams era, Aeson.ToJSON (Ledger.TxCert era)) + => ConwayPlutusPurpose AsItem era + -> Aeson.Value +renderConwayPlutusPurpose = \case + ConwaySpending (AsItem txin) -> + Aeson.object ["spending" .= Api.fromShelleyTxIn txin] + ConwayMinting pid -> + Aeson.object ["minting" .= Aeson.toJSON pid] + ConwayRewarding (AsItem rwdAcct) -> + Aeson.object ["rewarding" .= Aeson.String (Api.serialiseAddress $ Api.fromShelleyStakeAddr rwdAcct)] + ConwayCertifying cert -> + Aeson.object ["certifying" .= Aeson.toJSON cert] + ConwayVoting voter -> + Aeson.object ["voting" .= Aeson.toJSON voter] + ConwayProposing proposal -> + Aeson.object ["proposing" .= Aeson.toJSON proposal] diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index 2c97ba2545e..54bfac90a04 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -867,7 +867,15 @@ instance forMachine dtal (TraceMempoolRemoveTxs txs mpSz) = mconcat [ "kind" .= String "TraceMempoolRemoveTxs" - , "txs" .= map (forMachine dtal . txForgetValidated) txs + , "txs" + .= map + ( \(tx, err) -> + Aeson.object + [ "tx" .= forMachine dtal (txForgetValidated tx) + , "reason" .= forMachine dtal err + ] + ) + txs , "mempoolSize" .= forMachine dtal mpSz ] forMachine dtal (TraceMempoolManuallyRemovedTxs txs0 txs1 mpSz) = @@ -1726,6 +1734,3 @@ instance MetaTrace (TraceKeepAliveClient remotePeer) where documentFor _ = Just "" allNamespaces = [Namespace [] ["KeepAliveClient"]] - - - diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Peer.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Peer.hs index e31fc51422b..a6a309ed8c2 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Peer.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Peer.hs @@ -29,6 +29,7 @@ import qualified Data.Text as Text import Text.Printf (printf) import Ouroboros.Consensus.Block (Header) +import Ouroboros.Consensus.Util.NormalForm.StrictTVar (StrictTVar, readTVar) import Ouroboros.Consensus.Util.Orphans () import Ouroboros.Network.ConnectionId (remoteAddress) @@ -105,9 +106,9 @@ getCurrentPeers nkd = mapNodeKernelDataIO extractPeers nkd tuple3pop (a, b, _) = (a, b) getCandidates - :: STM.StrictTVar IO (Map peer (STM.StrictTVar IO (Net.AnchoredFragment (Header blk)))) + :: StrictTVar IO (Map peer (StrictTVar IO (Net.AnchoredFragment (Header blk)))) -> STM.STM IO (Map peer (Net.AnchoredFragment (Header blk))) - getCandidates var = STM.readTVar var >>= traverse STM.readTVar + getCandidates var = readTVar var >>= traverse readTVar extractPeers :: NodeKernel IO RemoteAddress LocalConnectionId blk -> IO [PeerT blk] diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Common.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Common.hs index 05ee4bafb5d..97ebff17c63 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Common.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Common.hs @@ -3,7 +3,6 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-orphans #-} @@ -41,7 +40,6 @@ module Cardano.Tracing.OrphanInstances.Common import Data.Aeson hiding (Value) import Data.Scientific (coefficient) import Data.Text (Text) -import qualified Data.Text as Text import Data.Void (Void) import Network.Socket (PortNumber) import Text.Read (readMaybe) @@ -62,18 +60,6 @@ import Cardano.Node.Handlers.Shutdown () instance ToObject Void where toObject _verb x = case x of {} -deriving instance Show TracingVerbosity - -instance FromJSON TracingVerbosity where - parseJSON (String str) = case str of - "MinimalVerbosity" -> pure MinimalVerbosity - "MaximalVerbosity" -> pure MaximalVerbosity - "NormalVerbosity" -> pure NormalVerbosity - invalid -> fail $ "Parsing of TracingVerbosity failed, " - <> Text.unpack invalid <> " is not a valid TracingVerbosity" - parseJSON invalid = fail $ "Parsing of TracingVerbosity failed due to type mismatch. " - <> "Encountered: " <> show invalid - instance FromJSON PortNumber where parseJSON (Number portNum) = case readMaybe . show $ coefficient portNum of Just port -> pure port diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs index 17d0a93b04d..763229c67e5 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs @@ -1335,7 +1335,15 @@ instance ( ToObject (ApplyTxErr blk), ToObject (GenTx blk), toObject verb (TraceMempoolRemoveTxs txs mpSz) = mconcat [ "kind" .= String "TraceMempoolRemoveTxs" - , "txs" .= map (toObject verb . txForgetValidated) txs + , "txs" + .= map + ( \(tx, err) -> + Aeson.object + [ "tx" .= toObject verb (txForgetValidated tx) + , "reason" .= toObject verb err + ] + ) + txs , "mempoolSize" .= toObject verb mpSz ] toObject verb (TraceMempoolManuallyRemovedTxs txs0 txs1 mpSz) = diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs index 085675810c8..70b58781cf4 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/HardFork.hs @@ -41,9 +41,9 @@ import Ouroboros.Consensus.HardFork.Combinator.AcrossEras (EraMismatch OneEraValidationErr (..), mkEraMismatch) import Ouroboros.Consensus.HardFork.Combinator.Condense () import Ouroboros.Consensus.HardFork.Combinator.Serialisation.Common - (EraNodeToClientVersion (..), EraNodeToNodeVersion (..), - HardForkNodeToClientVersion (..), HardForkNodeToNodeVersion (..), - HardForkSpecificNodeToClientVersion (..), HardForkSpecificNodeToNodeVersion (..)) + (EraNodeToClientVersion (..), HardForkNodeToClientVersion (..), + HardForkNodeToNodeVersion (..), HardForkSpecificNodeToClientVersion (..), + HardForkSpecificNodeToNodeVersion (..)) import Ouroboros.Consensus.HardFork.History.EraParams (EraParams (..), SafeZone) import Ouroboros.Consensus.HeaderValidation (OtherHeaderEnvelopeError) import Ouroboros.Consensus.Ledger.Abstract (LedgerError) @@ -406,7 +406,7 @@ instance (ToJSON (BlockNodeToClientVersion blk)) => ToJSON (EraNodeToClientVersi -- Instances for HardForkNodeToNodeVersion -- instance ( ToJSON (BlockNodeToNodeVersion x) - , All (ToJSON `Compose` EraNodeToNodeVersion) (x ': xs) + , All (ToJSON `Compose` WrapNodeToNodeVersion) (x ': xs) ) => ToJSON (HardForkNodeToNodeVersion (x ': xs)) where toJSON (HardForkNodeToNodeDisabled blockNodeToNodeVersion) = object [ "tag" .= String "HardForkNodeToNodeDisabled" @@ -419,16 +419,15 @@ instance ( ToJSON (BlockNodeToNodeVersion x) ] where eraNodeToNodeVersionsAsJSON :: NP (K Value) (x ': xs) - eraNodeToNodeVersionsAsJSON = hcmap (Proxy @(ToJSON `Compose` EraNodeToNodeVersion)) + eraNodeToNodeVersionsAsJSON = hcmap (Proxy @(ToJSON `Compose` WrapNodeToNodeVersion)) (K . toJSON) eraNodeToNodeVersions instance ToJSON HardForkSpecificNodeToNodeVersion where toJSON HardForkSpecificNodeToNodeVersion1 = "HardForkSpecificNodeToNodeVersion1" -instance (ToJSON (BlockNodeToNodeVersion blk)) => ToJSON (EraNodeToNodeVersion blk) where - toJSON EraNodeToNodeDisabled = String "EraNodeToNodeDisabled" - toJSON (EraNodeToNodeEnabled blockNodeToNodeVersion) = toJSON blockNodeToNodeVersion +instance (ToJSON (BlockNodeToNodeVersion blk)) => ToJSON (WrapNodeToNodeVersion blk) where + toJSON (WrapNodeToNodeVersion blockNodeToNodeVersion) = toJSON blockNodeToNodeVersion -- -- instances for HardForkSelectView diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs index 3937c252f93..87fdd277213 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @@ -66,7 +66,7 @@ import Ouroboros.Network.ConnectionManager.Types (AbstractState (..), import qualified Ouroboros.Network.ConnectionManager.Types as ConnMgr import Ouroboros.Network.DeltaQ (GSV (..), PeerGSV (..)) import Ouroboros.Network.Driver.Limits (ProtocolLimitFailure (..)) -import Ouroboros.Network.ExitPolicy (ReconnectDelay (..)) +import Ouroboros.Network.ExitPolicy (RepromoteDelay (..)) import Ouroboros.Network.InboundGovernor (InboundGovernorTrace (..), RemoteSt (..)) import qualified Ouroboros.Network.InboundGovernor as InboundGovernor import Ouroboros.Network.InboundGovernor.State (InboundGovernorCounters (..)) @@ -1553,8 +1553,8 @@ instance ToJSON PeerSelectionTargets where , "targetActiveBigLedgerPeers" .= nActiveBigLedgerPeers ] -instance ToJSON ReconnectDelay where - toJSON = toJSON . reconnectDelay +instance ToJSON RepromoteDelay where + toJSON = toJSON . repromoteDelay instance ToJSON addr => ToJSON (PeerSharingResult addr) where toJSON (PeerSharingResult addrs) = Aeson.toJSONList addrs diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs index 7a2ef35bb68..50155b3107b 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs @@ -10,6 +10,7 @@ {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuantifiedConstraints #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} @@ -28,8 +29,7 @@ import qualified Cardano.Crypto.VRF.Class as Crypto import Cardano.Ledger.Allegra.Rules (AllegraUtxoPredFailure) import qualified Cardano.Ledger.Allegra.Rules as Allegra import qualified Cardano.Ledger.Allegra.Scripts as Allegra -import qualified Cardano.Ledger.Alonzo.Plutus.TxInfo as Alonzo -import qualified Cardano.Ledger.Alonzo.PlutusScriptApi as Alonzo +import qualified Cardano.Ledger.Alonzo.Plutus.Evaluate as Alonzo import Cardano.Ledger.Alonzo.Rules (AlonzoBbodyPredFailure (..), AlonzoUtxoPredFailure, AlonzoUtxosPredFailure, AlonzoUtxowPredFailure (..)) import qualified Cardano.Ledger.Alonzo.Rules as Alonzo @@ -77,11 +77,11 @@ import Ouroboros.Network.Block (SlotNo (..), blockHash, blockNo, block import Ouroboros.Network.Point (WithOrigin, withOriginToMaybe) import Cardano.Node.Tracing.Render (renderMissingRedeemers, renderScriptHash, - renderScriptIntegrityHash, renderScriptPurpose) + renderScriptIntegrityHash) import Data.Aeson (Value (..), object) import qualified Data.Aeson as Aeson import qualified Data.ByteString.Base16 as B16 -import qualified Data.Map.Strict as Map +import qualified Data.List.NonEmpty as NonEmpty import Data.Set (Set) import qualified Data.Set as Set import Data.Text (Text) @@ -343,7 +343,7 @@ instance instance Ledger.EraPParams era => ToObject (Conway.ConwayGovPredFailure era) where toObject _ (Conway.GovActionsDoNotExist govActionIds) = mconcat [ "kind" .= String "GovActionsDoNotExist" - , "govActionIds" .= map govActionIdToText (Set.toList govActionIds) + , "govActionIds" .= map govActionIdToText (NonEmpty.toList govActionIds) ] toObject _ (Conway.MalformedProposal govAction) = mconcat [ "kind" .= String "MalformedProposal" @@ -366,7 +366,7 @@ instance Ledger.EraPParams era => ToObject (Conway.ConwayGovPredFailure era) whe ] toObject _ (Conway.DisallowedVoters govActionIdToVoter) = mconcat [ "kind" .= String "DisallowedVoters" - , "govActionIdToVoter" .= Map.toList govActionIdToVoter + , "govActionIdToVoter" .= NonEmpty.toList govActionIdToVoter ] toObject _ (Conway.ConflictingCommitteeUpdate creds) = mconcat [ "kind" .= String "ConflictingCommitteeUpdate" @@ -376,14 +376,25 @@ instance Ledger.EraPParams era => ToObject (Conway.ConwayGovPredFailure era) whe mconcat [ "kind" .= String "ExpirationEpochTooSmall" , "credentialsToEpoch" .= credsToEpoch ] - toObject _ (Conway.InvalidPrevGovActionIdsInProposals proposals) = - mconcat [ "kind" .= String "InvalidPrevGovActionIdsInProposals" - , "proposals" .= proposals + toObject _ (Conway.InvalidPrevGovActionId proposalProcedure) = + mconcat [ "kind" .= String "InvalidPrevGovActionId" + , "proposalProcedure" .= proposalProcedure ] toObject _ (Conway.VotingOnExpiredGovAction actions) = mconcat [ "kind" .= String "VotingOnExpiredGovAction" , "action" .= actions ] + toObject _ (Conway.ProposalCantFollow prevGovActionId protVer prevProtVer) = + mconcat [ "kind" .= String "ProposalCantFollow" + , "prevGovActionId" .= prevGovActionId + , "protVer" .= protVer + , "prevProtVer" .= prevProtVer + ] + toObject _ (Conway.InvalidPolicyHash actualPolicyHash expectedPolicyHash) = + mconcat [ "kind" .= String "InvalidPolicyHash" + , "actualPolicyHash" .= actualPolicyHash + , "expectedPolicyHash" .= expectedPolicyHash + ] instance ( Core.Crypto (Consensus.EraCrypto era) @@ -398,7 +409,9 @@ instance instance - ( ToObject (PPUPPredFailure ledgerera) + ( Api.ShelleyLedgerEra era ~ ledgerera + , Api.IsShelleyBasedEra era + , ToObject (PPUPPredFailure ledgerera) , ToObject (PredicateFailure (Ledger.EraRule "UTXO" ledgerera)) , Ledger.EraCrypto ledgerera ~ StandardCrypto , Show (Ledger.Value ledgerera) @@ -409,7 +422,7 @@ instance toObject v utxoPredFail toObject _ (MissingRedeemers scripts) = mconcat [ "kind" .= String "MissingRedeemers" - , "scripts" .= renderMissingRedeemers scripts + , "scripts" .= renderMissingRedeemers Api.shelleyBasedEra scripts ] toObject _ (MissingRequiredDatums required received) = mconcat [ "kind" .= String "MissingRequiredDatums" @@ -437,11 +450,15 @@ instance , "acceptable" .= Set.toList acceptable ] toObject _ (ExtraRedeemers rdmrs) = - mconcat - [ "kind" .= String "ExtraRedeemers" - , "rdmrs" .= map Api.fromAlonzoRdmrPtr rdmrs - ] - + Api.caseShelleyToMaryOrAlonzoEraOnwards + (const mempty) + (\alonzoOnwards -> + mconcat + [ "kind" .= String "ExtraRedeemers" + , "rdmrs" .= map (Api.toScriptIndex alonzoOnwards) rdmrs + ] + ) + (Api.shelleyBasedEra :: Api.ShelleyBasedEra era) instance ( ToObject (PredicateFailure (ShelleyUTXO ledgerera)) @@ -1133,58 +1150,6 @@ instance deriving newtype instance ToJSON Alonzo.IsValid -instance - ( Core.Crypto (Ledger.EraCrypto ledgerera) - , Ledger.EraCrypto ledgerera ~ StandardCrypto - ) => ToJSON (Alonzo.CollectError ledgerera) where - toJSON cError = - case cError of - Alonzo.NoRedeemer sPurpose -> - object - [ "kind" .= String "CollectError" - , "error" .= String "NoRedeemer" - , "scriptpurpose" .= renderScriptPurpose sPurpose - ] - Alonzo.NoWitness sHash -> - object - [ "kind" .= String "CollectError" - , "error" .= String "NoWitness" - , "scripthash" .= renderScriptHash sHash - ] - Alonzo.NoCostModel lang -> - object - [ "kind" .= String "CollectError" - , "error" .= String "NoCostModel" - , "language" .= toJSON lang - ] - Alonzo.BadTranslation err -> - object - [ "kind" .= String "PlutusTranslationError" - , "error" .= case err of - Alonzo.ByronTxOutInContext txOutSource -> - String $ - "Cannot construct a Plutus ScriptContext from this transaction " - <> "due to a Byron UTxO being created or spent: " - <> textShow txOutSource - Alonzo.TranslationLogicMissingInput txin -> - String $ "Transaction input does not exist in the UTxO: " <> textShow txin - Alonzo.RdmrPtrPointsToNothing ptr -> - object - [ "kind" .= String "RedeemerPointerPointsToNothing" - , "ptr" .= Api.fromAlonzoRdmrPtr ptr - ] - Alonzo.LanguageNotSupported lang -> - String $ "Language not supported: " <> textShow lang - Alonzo.InlineDatumsNotSupported txOutSource -> - String $ "Inline datums not supported, output source: " <> textShow txOutSource - Alonzo.ReferenceScriptsNotSupported txOutSource -> - String $ "Reference scripts not supported, output source: " <> textShow txOutSource - Alonzo.ReferenceInputsNotSupported txins -> - String $ "Reference inputs not supported: " <> textShow txins - Alonzo.TimeTranslationPastHorizon msg -> - String $ "Time translation requested past the horizon: " <> textShow msg - ] - instance ToJSON Alonzo.TagMismatchDescription where toJSON tmd = case tmd of Alonzo.PassedUnexpectedly -> @@ -1246,7 +1211,9 @@ instance ] instance - ( Ledger.Era ledgerera + ( Api.ShelleyLedgerEra era ~ ledgerera + , Api.IsShelleyBasedEra era + , Ledger.Era ledgerera , Ledger.EraCrypto ledgerera ~ StandardCrypto , Show (Ledger.Value ledgerera) , ToObject (PPUPPredFailure ledgerera) diff --git a/cardano-node/src/Cardano/Tracing/Peer.hs b/cardano-node/src/Cardano/Tracing/Peer.hs index feff0469095..81e143eed8f 100644 --- a/cardano-node/src/Cardano/Tracing/Peer.hs +++ b/cardano-node/src/Cardano/Tracing/Peer.hs @@ -32,6 +32,7 @@ import Cardano.BM.Trace (traceNamedObject) import Cardano.BM.Tracing import Ouroboros.Consensus.Block (Header) +import Ouroboros.Consensus.Util.NormalForm.StrictTVar (StrictTVar, readTVar) import Ouroboros.Consensus.Util.Orphans () import Ouroboros.Network.ConnectionId (remoteAddress) @@ -97,9 +98,9 @@ getCurrentPeers nkd = mapNodeKernelDataIO extractPeers nkd tuple3pop (a, b, _) = (a, b) getCandidates - :: STM.StrictTVar IO (Map peer (STM.StrictTVar IO (Net.AnchoredFragment (Header blk)))) + :: StrictTVar IO (Map peer (StrictTVar IO (Net.AnchoredFragment (Header blk)))) -> STM.STM IO (Map peer (Net.AnchoredFragment (Header blk))) - getCandidates var = STM.readTVar var >>= traverse STM.readTVar + getCandidates var = readTVar var >>= traverse readTVar extractPeers :: NodeKernel IO RemoteAddress LocalConnectionId blk -> IO [Peer blk] diff --git a/cardano-node/test/Test/Cardano/Config/Mainnet.hs b/cardano-node/test/Test/Cardano/Config/Mainnet.hs index d352d825464..a191aece86e 100644 --- a/cardano-node/test/Test/Cardano/Config/Mainnet.hs +++ b/cardano-node/test/Test/Cardano/Config/Mainnet.hs @@ -6,13 +6,13 @@ module Test.Cardano.Config.Mainnet ( tests ) where -import Cardano.Api (File (..), initialLedgerState, renderInitialLedgerStateError) +import Cardano.Api (File (..), initialLedgerState) +import Cardano.Api.Error (displayError) import Control.Monad.Trans.Except import Hedgehog (Property, (===)) import System.FilePath (()) import qualified Data.Aeson as J -import qualified Data.Text as T import qualified Data.Yaml as Y import qualified GHC.Stack as GHC import qualified Hedgehog as H @@ -26,7 +26,7 @@ hprop_configMainnetHash = H.propertyOnce $ do result <- H.evalIO $ runExceptT $ initialLedgerState $ File $ base "configuration/cardano/mainnet-config.json" case result of Right (_, _) -> return () - Left e -> H.failWithCustom GHC.callStack Nothing (T.unpack (renderInitialLedgerStateError e)) + Left e -> H.failWithCustom GHC.callStack Nothing (displayError e) hprop_configMainnetYaml :: Property hprop_configMainnetYaml = H.propertyOnce $ do diff --git a/cardano-submit-api/cardano-submit-api.cabal b/cardano-submit-api/cardano-submit-api.cabal index 1730dde0937..d23b152e8ad 100644 --- a/cardano-submit-api/cardano-submit-api.cabal +++ b/cardano-submit-api/cardano-submit-api.cabal @@ -39,9 +39,9 @@ library , aeson , async , bytestring - , cardano-api ^>= 8.37.1.0 + , cardano-api ^>= 8.38 , cardano-binary - , cardano-cli ^>= 8.19.0.0 + , cardano-cli ^>= 8.20.0.0 , cardano-crypto-class ^>= 2.1.2 , http-media , iohk-monitoring @@ -49,7 +49,7 @@ library , network , optparse-applicative-fork , ouroboros-consensus-cardano - , ouroboros-network ^>= 0.10 + , ouroboros-network ^>= 0.11 , ouroboros-network-protocols , prometheus >= 2.2.4 , servant diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index f48abfe2cb3..b904f2addb1 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -1,7 +1,7 @@ cabal-version: 3.0 name: cardano-testnet -version: 8.7.2 +version: 8.8.0 synopsis: The cardano full node description: The cardano full node. copyright: 2021-2023 Input Output Global Inc (IOG). @@ -34,8 +34,8 @@ library build-depends: aeson , ansi-terminal , bytestring - , cardano-api ^>= 8.37.1.0 - , cardano-cli ^>= 8.19.0.0 + , cardano-api ^>= 8.38 + , cardano-cli ^>= 8.20.0.0 , cardano-crypto-class , cardano-crypto-wrapper , cardano-ledger-alonzo @@ -55,14 +55,14 @@ library , exceptions , filepath , hedgehog - , hedgehog-extras ^>= 0.6.0.1 + , hedgehog-extras ^>= 0.6.0 , microlens , lens-aeson , mtl , network , network-mux , optparse-applicative-fork - , ouroboros-network ^>= 0.10 + , ouroboros-network ^>= 0.11 , ouroboros-network-api , prettyprinter , process @@ -190,7 +190,7 @@ test-suite cardano-testnet-test , async , base16-bytestring , bytestring - , cardano-api + , cardano-api:{cardano-api, internal} , cardano-cli , cardano-crypto-class , cardano-ledger-conway diff --git a/cardano-testnet/files/data/conway/genesis.conway.spec.json b/cardano-testnet/files/data/conway/genesis.conway.spec.json index 078d33b1814..6141e96d004 100644 --- a/cardano-testnet/files/data/conway/genesis.conway.spec.json +++ b/cardano-testnet/files/data/conway/genesis.conway.spec.json @@ -1,28 +1,29 @@ { "poolVotingThresholds": { - "pvtCommitteeNormal": 0.51, - "pvtCommitteeNoConfidence": 0.51, - "pvtHardForkInitiation": 0.51, - "pvtMotionNoConfidence": 0.51 + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 }, "dRepVotingThresholds": { - "dvtMotionNoConfidence": 0.51, - "dvtCommitteeNormal": 0.51, - "dvtCommitteeNoConfidence": 0.51, - "dvtUpdateToConstitution": 0.51, - "dvtHardForkInitiation": 0.51, - "dvtPPNetworkGroup": 0.51, - "dvtPPEconomicGroup": 0.51, - "dvtPPTechnicalGroup": 0.51, - "dvtPPGovGroup": 0.51, - "dvtTreasuryWithdrawal": 0.51 + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 }, "committeeMinSize": 0, - "committeeMaxTermLength": 60, - "govActionLifetime": 14, - "govActionDeposit": 0, - "dRepDeposit": 0, - "dRepActivity": 0, + "committeeMaxTermLength": 200, + "govActionLifetime": 10, + "govActionDeposit": 1000000000, + "dRepDeposit": 2000000, + "dRepActivity": 20, "constitution": { "anchor": { "url": "", @@ -30,8 +31,7 @@ } }, "committee": { - "members": { - }, + "members": {}, "quorum": 0 } } diff --git a/cardano-testnet/src/Testnet/Components/Configuration.hs b/cardano-testnet/src/Testnet/Components/Configuration.hs index a6a4aa2fab3..44dcd933d0f 100644 --- a/cardano-testnet/src/Testnet/Components/Configuration.hs +++ b/cardano-testnet/src/Testnet/Components/Configuration.hs @@ -1,5 +1,6 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE NumericUnderscores #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE TypeApplications #-} @@ -116,11 +117,11 @@ createSPOGenesisAndFiles (NumPools numPoolNodes) era shelleyGenesis (TmpAbsolute -- 50 second epochs -- Epoch length should be "10 * k / f" where "k = securityParam, f = activeSlotsCoeff" H.rewriteJsonFile genesisShelleyFpAbs $ \o -> o + & L.key "protocolParams" . L.key "rho" . L._Number .~ 0.1 + & L.key "protocolParams" . L.key "tau" . L._Number .~ 0.1 + & L.key "protocolParams" . L.key "protocolVersion" . L.key "major" . L._Integer .~ 8 & L.key "securityParam" . L._Integer .~ 5 - & L.key "rho" . L._Double .~ 0.1 - & L.key "tau" . L._Double .~ 0.1 & L.key "updateQuorum" . L._Integer .~ 2 - & L.key "protocolParams" . L.key "protocolVersion" . L.key "major" . L._Integer .~ 8 -- TODO: create-testnet-data should have arguments for -- Alonzo and Conway genesis that are optional and if not @@ -134,8 +135,8 @@ createSPOGenesisAndFiles (NumPools numPoolNodes) era shelleyGenesis (TmpAbsolute , "--spec-shelley", genesisShelleyFpAbs , "--testnet-magic", show @Word32 testnetMagic , "--pools", show @Int numPoolNodes - , "--supply", "1000000000000" - , "--supply-delegated", "1000000000000" + , "--total-supply", show @Int 2_000_000_000_000 + , "--delegated-supply", show @Int 1_000_000_000_000 , "--stake-delegators", show @Int numStakeDelegators , "--utxo-keys", show numSeededUTxOKeys , "--drep-keys", "3" diff --git a/cardano-testnet/src/Testnet/Runtime.hs b/cardano-testnet/src/Testnet/Runtime.hs index 86307ede86f..f1664ddadc5 100644 --- a/cardano-testnet/src/Testnet/Runtime.hs +++ b/cardano-testnet/src/Testnet/Runtime.hs @@ -59,7 +59,6 @@ import qualified GHC.IO.Handle as IO import GHC.Stack import qualified GHC.Stack as GHC import Prelude -import Prettyprinter ((<+>)) import qualified System.Directory as IO import System.FilePath import qualified System.IO as IO @@ -321,4 +320,3 @@ startLedgerStateLogging testnetRuntime tmpWorkspace = do -- The argument forces IO monad to prevent leaking of `MonadResource` to the child thread runInBackground :: IO a -> m () runInBackground act = void $ allocate (H.async act) H.cancel - diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs index c910523a106..96545b1b511 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs @@ -6,6 +6,7 @@ module Cardano.Testnet.Test.FoldBlocks where import Cardano.Api hiding (cardanoEra) import qualified Cardano.Api as Api +import Cardano.Api.Error (displayError) import qualified Cardano.Api.Shelley as Api import Cardano.Testnet as TN @@ -17,7 +18,6 @@ import Control.Concurrent.Async (async, link) import Control.Exception (Exception, throw) import Control.Monad (forever) import Control.Monad.Trans.Except (runExceptT) -import qualified Data.Text as TS import qualified System.Directory as IO import System.FilePath (()) @@ -32,7 +32,7 @@ import Testnet.Runtime newtype FoldBlocksException = FoldBlocksException Api.FoldBlocksError instance Exception FoldBlocksException instance Show FoldBlocksException where - show (FoldBlocksException a) = TS.unpack $ Api.renderFoldBlocksError a + show (FoldBlocksException a) = displayError a -- | This test starts a testnet with wery short timing, then starts -- `foldBlocks` in another thread to listen for ledger state, ledger diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs index cd62b91ddb0..d87736b8014 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs @@ -12,6 +12,7 @@ module Cardano.Testnet.Test.LedgerEvents.Gov.InfoAction ) where import Cardano.Api +import Cardano.Api.Error (displayError) import Cardano.Api.Shelley import Cardano.Ledger.Conway.Governance (RatifyState (..)) import qualified Cardano.Ledger.Conway.Governance as L @@ -210,7 +211,7 @@ hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \t newProposalEvents <- case propSubmittedResult of Left e -> H.failMessage callStack - $ "foldBlocksCheckProposalWasSubmitted failed with: " <> Text.unpack (renderFoldBlocksError e) + $ "foldBlocksCheckProposalWasSubmitted failed with: " <> displayError e Right events -> return events governanceActionIndex <- retrieveGovernanceActionIndex newProposalEvents @@ -267,7 +268,7 @@ hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \t -- We check that info action was succcessfully ratified !meInfoRatified - <- H.timeout 40_000_000 $ runExceptT $ foldBlocks + <- H.timeout 140_000_000 $ runExceptT $ foldBlocks (File $ configurationFile testnetRuntime) (File socketPath) FullValidation @@ -278,7 +279,7 @@ hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \t case eInfoRatified of Left e -> H.failMessage callStack - $ "foldBlocksCheckInfoAction failed with: " <> Text.unpack (renderFoldBlocksError e) + $ "foldBlocksCheckInfoAction failed with: " <> displayError e Right _events -> success foldBlocksCheckProposalWasSubmitted @@ -306,7 +307,7 @@ retrieveGovernanceActionIndex mEvent = do Just (NewGovernanceProposals _ (AnyProposals props)) -> do -- In this test there will only be one let govActionStates = [i - | L.GovActionIx i <- map L.gaidGovActionIx . Map.keys $ L.proposalsGovActionStates props + | L.GovActionIx i <- map L.gaidGovActionIx . Map.keys $ L.proposalsActionsMap props ] H.headM govActionStates Just unexpectedEvent -> @@ -346,9 +347,9 @@ foldBlocksCheckInfoAction df govActionIdx _ ls allEvents _ acc = do where checkRatification :: InfoActionState -> LedgerEvent -> InfoActionState checkRatification !ias = \case - EpochBoundaryRatificationState (AnyRatificationState (RatifyState{rsRemoved})) -> do + EpochBoundaryRatificationState (AnyRatificationState RatifyState{rsExpired}) -> do -- find out if the action was removed - let w32indices = [i | L.GovActionIx i <- L.gaidGovActionIx <$> toList rsRemoved ] + let w32indices = [i | L.GovActionIx i <- L.gaidGovActionIx <$> toList rsExpired ] ias{isRemoved = isRemoved ias || govActionIdx `elem` w32indices} NewGovernanceProposals _ (AnyProposals proposals) -> do -- find out if the action was voted for 3 times @@ -359,10 +360,9 @@ foldBlocksCheckInfoAction df govActionIdx _ ls allEvents _ acc = do let (L.GovActionIx i) = L.gaidGovActionIx gai i )) - $ Map.assocs $ L.proposalsGovActionStates proposals + $ Map.assocs $ L.proposalsActionsMap proposals case actions of [L.GovActionState{L.gasDRepVotes=votes}] | length votes == 3 -> ias{hasReceivedVotes = True} _ -> ias _ -> ias - diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs index af502fd8513..2e4e9d2a609 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs @@ -10,6 +10,7 @@ module Cardano.Testnet.Test.LedgerEvents.Gov.ProposeNewConstitution ) where import Cardano.Api +import Cardano.Api.Error (displayError) import Cardano.Api.Shelley import qualified Cardano.Ledger.Conway.Governance as Ledger import Cardano.Testnet @@ -222,7 +223,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n $ "foldBlocksCheckProposalWasSubmitted failed with: " <> show e Right (Left e) -> H.failMessage callStack - $ "foldBlocksCheckProposalWasSubmitted failed with: " <> Text.unpack (renderFoldBlocksError e) + $ "foldBlocksCheckProposalWasSubmitted failed with: " <> displayError e Right (Right events) -> return events governanceActionIndex <- retrieveGovernanceActionIndex newProposalEvents @@ -295,7 +296,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n $ "foldBlocksCheckConstitutionWasRatified failed with: " <> show e Right (Left e) -> H.failMessage callStack - $ "foldBlocksCheckConstitutionWasRatified failed with: " <> Text.unpack (renderFoldBlocksError e) + $ "foldBlocksCheckConstitutionWasRatified failed with: " <> displayError e Right (Right _events) -> success foldBlocksCheckProposalWasSubmitted @@ -322,7 +323,7 @@ retrieveGovernanceActionIndex mEvent = do Just (NewGovernanceProposals _ (AnyProposals props)) -> -- In this test there will only be one let govActionStates = [i - | Ledger.GovActionIx i <- map Ledger.gaidGovActionIx . Map.keys $ Ledger.proposalsGovActionStates props + | Ledger.GovActionIx i <- map Ledger.gaidGovActionIx . Map.keys $ Ledger.proposalsActionsMap props ] in return $ head govActionStates Just unexpectedEvent -> @@ -334,7 +335,7 @@ retrieveGovernanceActionIndex mEvent = do filterNewGovProposals :: TxId -> LedgerEvent -> Bool filterNewGovProposals txid (NewGovernanceProposals eventTxId (AnyProposals props)) = - let _govActionStates = Ledger.proposalsGovActionStates props + let _govActionStates = Ledger.proposalsActionsMap props in fromShelleyTxId eventTxId == txid filterNewGovProposals _ _ = False diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs index 298feafac76..8fb2ab7f76f 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs @@ -9,6 +9,7 @@ module Cardano.Testnet.Test.LedgerEvents.SanityCheck ) where import Cardano.Api +import Cardano.Api.Error import Cardano.Api.Shelley import Cardano.Testnet @@ -17,7 +18,6 @@ import Prelude import Control.Monad.Trans.Except import Control.Monad.Trans.Except.Extra -import qualified Data.Text as Text import GHC.IO.Exception (IOException) import GHC.Stack (callStack) import System.FilePath (()) @@ -75,7 +75,7 @@ hprop_ledger_events_sanity_check = H.integrationWorkspace "ledger-events-sanity- Left (IOE e) -> H.failMessage callStack $ "foldBlocks failed with: " <> show e Right (Left e) -> - H.failMessage callStack $ "foldBlocks failed with: " <> Text.unpack (renderFoldBlocksError e) + H.failMessage callStack $ "foldBlocks failed with: " <> displayError e Right (Right _v) -> success @@ -95,5 +95,3 @@ foldBlocksAccumulator _ _ allEvents _ _ = filterPoolReap :: LedgerEvent -> Bool filterPoolReap (PoolReap _) = True filterPoolReap _ = False - - diff --git a/cardano-tracer/cardano-tracer.cabal b/cardano-tracer/cardano-tracer.cabal index f523074db3e..bc6ca55bae1 100644 --- a/cardano-tracer/cardano-tracer.cabal +++ b/cardano-tracer/cardano-tracer.cabal @@ -152,7 +152,7 @@ library , filepath , mime-mail , optparse-applicative - , ouroboros-network ^>= 0.10 + , ouroboros-network ^>= 0.11 , ouroboros-network-api , ouroboros-network-framework , signal diff --git a/configuration/cardano/mainnet-config-new-tracing.json b/configuration/cardano/mainnet-config-new-tracing.json index bb07acc3bfb..ded1956de71 100644 --- a/configuration/cardano/mainnet-config-new-tracing.json +++ b/configuration/cardano/mainnet-config-new-tracing.json @@ -4,7 +4,7 @@ "ByronGenesisFile": "mainnet-byron-genesis.json", "ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", "ConwayGenesisFile": "mainnet-conway-genesis.json", - "ConwayGenesisHash": "f7d46bdd3b3c8caf38351c4eef3346a89241707270be0d6106e8a407db294cc6", + "ConwayGenesisHash": "de609b281cb3d8ae91a9d63a00c87092975612d603aa54c0f1c6a781e33d6e1e", "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, "LastKnownBlockVersion-Minor": 0, @@ -18,5 +18,5 @@ "TraceOptionPeerFrequency": 3000, "TraceOptionResourceFrequency": 4000, "TurnOnLogMetrics": true, - "TraceOptions": {} + "TraceOptions": {} } diff --git a/configuration/cardano/mainnet-config.json b/configuration/cardano/mainnet-config.json index bf80907c673..66ea0712376 100644 --- a/configuration/cardano/mainnet-config.json +++ b/configuration/cardano/mainnet-config.json @@ -4,7 +4,8 @@ "ByronGenesisFile": "mainnet-byron-genesis.json", "ByronGenesisHash": "5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb", "ConwayGenesisFile": "mainnet-conway-genesis.json", - "ConwayGenesisHash": "f7d46bdd3b3c8caf38351c4eef3346a89241707270be0d6106e8a407db294cc6", + "ConwayGenesisHash": "de609b281cb3d8ae91a9d63a00c87092975612d603aa54c0f1c6a781e33d6e1e", + "EnableP2P": true, "LastKnownBlockVersion-Alt": 0, "LastKnownBlockVersion-Major": 3, "LastKnownBlockVersion-Minor": 0, @@ -13,6 +14,10 @@ "RequiresNetworkMagic": "RequiresNoMagic", "ShelleyGenesisFile": "mainnet-shelley-genesis.json", "ShelleyGenesisHash": "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81", + "TargetNumberOfActivePeers": 20, + "TargetNumberOfEstablishedPeers": 50, + "TargetNumberOfKnownPeers": 100, + "TargetNumberOfRootPeers": 100, "TraceAcceptPolicy": true, "TraceBlockFetchClient": false, "TraceBlockFetchDecisions": false, @@ -41,7 +46,7 @@ "TraceLocalRootPeers": true, "TraceLocalTxSubmissionProtocol": false, "TraceLocalTxSubmissionServer": false, - "TraceMempool": true, + "TraceMempool": false, "TraceMux": false, "TracePeerSelection": true, "TracePeerSelectionActions": true, diff --git a/configuration/cardano/mainnet-config.yaml b/configuration/cardano/mainnet-config.yaml index b1a93569e99..00aab68e15d 100644 --- a/configuration/cardano/mainnet-config.yaml +++ b/configuration/cardano/mainnet-config.yaml @@ -8,10 +8,12 @@ AlonzoGenesisHash: 7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed ByronGenesisFile: mainnet-byron-genesis.json ByronGenesisHash: 5f20df933584822601f9e3f8c024eb5eb252fe8cefb24d1317dc3d432e940ebb ConwayGenesisFile: mainnet-conway-genesis.json -ConwayGenesisHash: f7d46bdd3b3c8caf38351c4eef3346a89241707270be0d6106e8a407db294cc6 +ConwayGenesisHash: de609b281cb3d8ae91a9d63a00c87092975612d603aa54c0f1c6a781e33d6e1e ShelleyGenesisFile: mainnet-shelley-genesis.json ShelleyGenesisHash: 1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81 +EnableP2P: true + ##### Core protocol parameters ##### Protocol: Cardano @@ -216,7 +218,7 @@ TraceLocalTxSubmissionProtocol: False TraceLocalTxSubmissionServer: False # Trace mempool. -TraceMempool: True +TraceMempool: False # Trace Mux Events. TraceMux: False @@ -231,6 +233,11 @@ TraceTxOutbound: False TraceTxSubmissionProtocol: False +TargetNumberOfActivePeers: 20 +TargetNumberOfEstablishedPeers: 50 +TargetNumberOfKnownPeers: 100 +TargetNumberOfRootPeers: 100 + ##### Fine grained logging control ##### # It is also possible to have more fine grained control over filtering of diff --git a/configuration/cardano/mainnet-conway-genesis.json b/configuration/cardano/mainnet-conway-genesis.json index 078d33b1814..5f1de84e6eb 100644 --- a/configuration/cardano/mainnet-conway-genesis.json +++ b/configuration/cardano/mainnet-conway-genesis.json @@ -1,28 +1,29 @@ { "poolVotingThresholds": { - "pvtCommitteeNormal": 0.51, - "pvtCommitteeNoConfidence": 0.51, - "pvtHardForkInitiation": 0.51, - "pvtMotionNoConfidence": 0.51 + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 }, "dRepVotingThresholds": { - "dvtMotionNoConfidence": 0.51, - "dvtCommitteeNormal": 0.51, - "dvtCommitteeNoConfidence": 0.51, - "dvtUpdateToConstitution": 0.51, - "dvtHardForkInitiation": 0.51, - "dvtPPNetworkGroup": 0.51, - "dvtPPEconomicGroup": 0.51, - "dvtPPTechnicalGroup": 0.51, - "dvtPPGovGroup": 0.51, - "dvtTreasuryWithdrawal": 0.51 + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 }, "committeeMinSize": 0, - "committeeMaxTermLength": 60, - "govActionLifetime": 14, - "govActionDeposit": 0, - "dRepDeposit": 0, - "dRepActivity": 0, + "committeeMaxTermLength": 200, + "govActionLifetime": 10, + "govActionDeposit": 1000000000, + "dRepDeposit": 2000000, + "dRepActivity": 20, "constitution": { "anchor": { "url": "", diff --git a/configuration/cardano/mainnet-topology.json b/configuration/cardano/mainnet-topology.json index 1d90ef26c09..902d14376c5 100644 --- a/configuration/cardano/mainnet-topology.json +++ b/configuration/cardano/mainnet-topology.json @@ -1,9 +1,29 @@ { - "Producers": [ + "localRoots": [ { - "addr": "relays-new.cardano-mainnet.iohk.io", - "port": 3001, - "valency": 2 + "accessPoints": [], + "advertise": false, + "valency": 1 } - ] + ], + "publicRoots": [ + { + "accessPoints": [ + { + "address": "backbone.cardano-mainnet.iohk.io", + "port": 3001 + }, + { + "address": "backbone.cardano.iog.io", + "port": 3001 + }, + { + "address": "backbone.mainnet.emurgornd.com", + "port": 3001 + } + ], + "advertise": false + } + ], + "useLedgerAfterSlot": 110332824 } diff --git a/configuration/cardano/shelley_qa-conway-genesis.json b/configuration/cardano/shelley_qa-conway-genesis.json index 078d33b1814..5f1de84e6eb 100644 --- a/configuration/cardano/shelley_qa-conway-genesis.json +++ b/configuration/cardano/shelley_qa-conway-genesis.json @@ -1,28 +1,29 @@ { "poolVotingThresholds": { - "pvtCommitteeNormal": 0.51, - "pvtCommitteeNoConfidence": 0.51, - "pvtHardForkInitiation": 0.51, - "pvtMotionNoConfidence": 0.51 + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 }, "dRepVotingThresholds": { - "dvtMotionNoConfidence": 0.51, - "dvtCommitteeNormal": 0.51, - "dvtCommitteeNoConfidence": 0.51, - "dvtUpdateToConstitution": 0.51, - "dvtHardForkInitiation": 0.51, - "dvtPPNetworkGroup": 0.51, - "dvtPPEconomicGroup": 0.51, - "dvtPPTechnicalGroup": 0.51, - "dvtPPGovGroup": 0.51, - "dvtTreasuryWithdrawal": 0.51 + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 }, "committeeMinSize": 0, - "committeeMaxTermLength": 60, - "govActionLifetime": 14, - "govActionDeposit": 0, - "dRepDeposit": 0, - "dRepActivity": 0, + "committeeMaxTermLength": 200, + "govActionLifetime": 10, + "govActionDeposit": 1000000000, + "dRepDeposit": 2000000, + "dRepActivity": 20, "constitution": { "anchor": { "url": "", diff --git a/configuration/cardano/update-config-files.sh b/configuration/cardano/update-config-files.sh index c89cebe16f3..2abb8b920a9 100755 --- a/configuration/cardano/update-config-files.sh +++ b/configuration/cardano/update-config-files.sh @@ -1,10 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash set -e OUT=$(dirname $(realpath $0)) ROOT=$(realpath ${OUT}/../..) -nix build "${ROOT}"#cardano-deployment +nix build "${ROOT}"#hydraJobs.cardano-deployment SRC="${ROOT}/result" copyFile() { diff --git a/flake.lock b/flake.lock index 30c466759ad..08c484fc402 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1706004183, - "narHash": "sha256-WKfiLsitgXL9wxHr8LA+lyIhHXog4/HOOdQwIUdSW04=", + "lastModified": 1707293988, + "narHash": "sha256-UAa4nL8qhPyI133IJOPMBgLECa91CPPwwhypFXKm7Fw=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "44cf7d3dcee77eb6ee8e4462bf63616351dfbb1d", + "rev": "501510e79f9cf76012cba0e86f88fa0b8b053fbd", "type": "github" }, "original": { @@ -587,11 +587,11 @@ "ghc99": { "flake": false, "locked": { - "lastModified": 1697054644, - "narHash": "sha256-kKarOuXUaAH3QWv7ASx+gGFMHaHKe0pK5Zu37ky2AL4=", + "lastModified": 1701580282, + "narHash": "sha256-drA01r3JrXnkKyzI+owMZGxX0JameMzjK0W5jJE/+V4=", "ref": "refs/heads/master", - "rev": "f383a242c76f90bcca8a4d7ee001dcb49c172a9a", - "revCount": 62040, + "rev": "f5eb0f2982e9cf27515e892c4bdf634bcfb28459", + "revCount": 62197, "submodules": true, "type": "git", "url": "https://gitlab.haskell.org/ghc/ghc" @@ -624,11 +624,11 @@ "hackageNix": { "flake": false, "locked": { - "lastModified": 1706055829, - "narHash": "sha256-4bIOyE4CSPij2j+bo/kLlnHojkfFqQMVpN3xnQ5reiA=", + "lastModified": 1707178947, + "narHash": "sha256-zK4s98xucxwefNtf7Ewc42lQkb5ZXNzFV4sOliif8Rg=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "c9889ce77afa9fd20d6845808c83da11efbe8e48", + "rev": "ef22972dd06ed3359945489b582849fdf680c583", "type": "github" }, "original": { @@ -656,9 +656,12 @@ "hls-2.2": "hls-2.2", "hls-2.3": "hls-2.3", "hls-2.4": "hls-2.4", + "hls-2.5": "hls-2.5", + "hls-2.6": "hls-2.6", "hpc-coveralls": "hpc-coveralls", "hydra": "hydra", "iserv-proxy": "iserv-proxy", + "nix-tools-static": "nix-tools-static", "nixpkgs": [ "nixpkgs" ], @@ -668,16 +671,17 @@ "nixpkgs-2205": "nixpkgs-2205", "nixpkgs-2211": "nixpkgs-2211", "nixpkgs-2305": "nixpkgs-2305", + "nixpkgs-2311": "nixpkgs-2311", "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": "old-ghc-nix", "stackage": "stackage" }, "locked": { - "lastModified": 1700441391, - "narHash": "sha256-oJqP1AUskUvr3GNUH97eKwaIUHdYgENS2kQ7GI9RI+c=", + "lastModified": 1707180591, + "narHash": "sha256-MR/sPRfbtab9AEgvTb70VU94MDqEXFNM3RnMfb10gT8=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "3b6056f3866f88d1d16eaeb2e810d3ac0df0e7cd", + "rev": "0a4c42df4321e510f38affa11a2109e84a5399e4", "type": "github" }, "original": { @@ -776,16 +780,50 @@ "hls-2.4": { "flake": false, "locked": { - "lastModified": 1696939266, - "narHash": "sha256-VOMf5+kyOeOmfXTHlv4LNFJuDGa7G3pDnOxtzYR40IU=", + "lastModified": 1699862708, + "narHash": "sha256-YHXSkdz53zd0fYGIYOgLt6HrA0eaRJi9mXVqDgmvrjk=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "362fdd1293efb4b82410b676ab1273479f6d17ee", + "rev": "54507ef7e85fa8e9d0eb9a669832a3287ffccd57", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.4.0.0", + "ref": "2.4.0.1", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.5": { + "flake": false, + "locked": { + "lastModified": 1701080174, + "narHash": "sha256-fyiR9TaHGJIIR0UmcCb73Xv9TJq3ht2ioxQ2mT7kVdc=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "27f8c3d3892e38edaef5bea3870161815c4d014c", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.5.0.0", + "repo": "haskell-language-server", + "type": "github" + } + }, + "hls-2.6": { + "flake": false, + "locked": { + "lastModified": 1705325287, + "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", + "owner": "haskell", + "repo": "haskell-language-server", + "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", + "type": "github" + }, + "original": { + "owner": "haskell", + "ref": "2.6.0.0", "repo": "haskell-language-server", "type": "github" } @@ -884,11 +922,11 @@ "sodium": "sodium" }, "locked": { - "lastModified": 1698746924, - "narHash": "sha256-8og+vqQPEoB2KLUtN5esGMDymT+2bT/rCHZt1NAe7y0=", + "lastModified": 1707337252, + "narHash": "sha256-sliOZlzvx3sG+YqkgcXqK7Va0OyYFD+VPWiEK+qeoNI=", "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "af551ca93d969d9715fa9bf86691d9a0a19e89d9", + "rev": "3358489541bdc1228afaa678c2adf4bb891f560e", "type": "github" }, "original": { @@ -1040,6 +1078,23 @@ "type": "github" } }, + "nix-tools-static": { + "flake": false, + "locked": { + "lastModified": 1706266250, + "narHash": "sha256-9t+GRk3eO9muCtKdNAwBtNBZ5dH1xHcnS17WaQyftwA=", + "owner": "input-output-hk", + "repo": "haskell-nix-example", + "rev": "580cb6db546a7777dad3b9c0fa487a366c045c4e", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "nix", + "repo": "haskell-nix-example", + "type": "github" + } + }, "nix2container": { "inputs": { "flake-utils": "flake-utils_2", @@ -1240,11 +1295,11 @@ }, "nixpkgs-2305": { "locked": { - "lastModified": 1695416179, - "narHash": "sha256-610o1+pwbSu+QuF3GE0NU5xQdTHM3t9wyYhB9l94Cd8=", + "lastModified": 1701362232, + "narHash": "sha256-GVdzxL0lhEadqs3hfRLuj+L1OJFGiL/L7gCcelgBlsw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "715d72e967ec1dd5ecc71290ee072bcaf5181ed6", + "rev": "d2332963662edffacfddfad59ff4f709dde80ffe", "type": "github" }, "original": { @@ -1254,6 +1309,22 @@ "type": "github" } }, + "nixpkgs-2311": { + "locked": { + "lastModified": 1701386440, + "narHash": "sha256-xI0uQ9E7JbmEy/v8kR9ZQan6389rHug+zOtZeZFiDJk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "293822e55ec1872f715a66d0eda9e592dc14419f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-23.11-darwin", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-regression": { "locked": { "lastModified": 1643052045, @@ -1272,17 +1343,17 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1694822471, + "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", "repo": "nixpkgs", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" } }, @@ -1739,11 +1810,11 @@ "stackage": { "flake": false, "locked": { - "lastModified": 1700438989, - "narHash": "sha256-x+7Qtboko7ds8CU8pq2sIZiD45DauYoX9LxBfwQr/hs=", + "lastModified": 1707178218, + "narHash": "sha256-3JatI3pDGahu+k5povDpQWBnMbngfL/8aKPLU4PsAxM=", "owner": "input-output-hk", "repo": "stackage.nix", - "rev": "9c2015334cc77837b8454b3b10ef4f711a256f6f", + "rev": "43eb3859170423a3c1f048815070ed10099f7e5c", "type": "github" }, "original": { diff --git a/nix/haskell.nix b/nix/haskell.nix index ab144a6aa62..d927bfa485d 100644 --- a/nix/haskell.nix +++ b/nix/haskell.nix @@ -22,7 +22,7 @@ let name = "cardano-node"; compiler-nix-name = lib.mkDefault "ghc8107"; # extra-compilers - flake.variants = lib.genAttrs ["ghc928" "ghc963"] (x: {compiler-nix-name = x;}); + flake.variants = lib.genAttrs ["ghc963"] (x: {compiler-nix-name = x;}); cabalProjectLocal = '' repository cardano-haskell-packages-local url: file:${CHaP} @@ -113,9 +113,12 @@ let packages.plutus-tx-plugin.components.library.platforms = with lib.platforms; [ linux darwin ]; packages.tx-generator.package.buildable = with pkgs.stdenv.hostPlatform; !isMusl; + packages.cardano-ledger-allegra.components.library.doHaddock = false; packages.cardano-ledger-alonzo.components.library.doHaddock = false; + packages.cardano-ledger-api.components.library.doHaddock = false; packages.cardano-ledger-babbage.components.library.doHaddock = false; packages.cardano-ledger-conway.components.library.doHaddock = false; + packages.cardano-ledger-shelley.components.library.doHaddock = false; packages.cardano-protocol-tpraos.components.library.doHaddock = false; }) ({ lib, pkgs, ...}: lib.mkIf (pkgs.stdenv.hostPlatform.isWindows) { diff --git a/nix/nixos/tests/cardano-node-edge.nix b/nix/nixos/tests/cardano-node-edge.nix index 3ac3d5a2cfe..8202dad1c99 100644 --- a/nix/nixos/tests/cardano-node-edge.nix +++ b/nix/nixos/tests/cardano-node-edge.nix @@ -10,13 +10,16 @@ with pkgs; ]; services.cardano-node = { enable = true; - systemdSocketActivation = true; port = 3001; hostAddr = "127.0.0.1"; environment = "mainnet"; - topology = commonLib.mkEdgeTopology { - port = 3001; - edgeNodes = [ "127.0.0.1" ]; + topology = commonLib.mkEdgeTopologyP2P { + edgeNodes = [ + { + addr = "127.0.0.1"; + port = 3001; + } + ]; }; nodeConfig = config.services.cardano-node.environments.${config.services.cardano-node.environment}.nodeConfig // { hasPrometheus = [ config.services.cardano-node.hostAddr 12798 ]; @@ -47,8 +50,7 @@ with pkgs; testScript = '' start_all() machine.wait_for_unit("cardano-node.service") - machine.succeed("stat /run/cardano-node") - machine.succeed("stat /run/cardano-node/node.socket") + machine.wait_for_file("/run/cardano-node/node.socket") machine.wait_for_open_port(12798) machine.wait_for_open_port(3001) machine.succeed("systemctl status cardano-node") diff --git a/nix/workbench/profile/presets/mainnet/genesis/genesis.conway.json b/nix/workbench/profile/presets/mainnet/genesis/genesis.conway.json index 96a4c4ca08e..6141e96d004 100644 --- a/nix/workbench/profile/presets/mainnet/genesis/genesis.conway.json +++ b/nix/workbench/profile/presets/mainnet/genesis/genesis.conway.json @@ -1,28 +1,29 @@ { "poolVotingThresholds": { - "pvtCommitteeNormal": 0.51, - "pvtCommitteeNoConfidence": 0.51, - "pvtHardForkInitiation": 0.51, - "pvtMotionNoConfidence": 0.51 + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 }, "dRepVotingThresholds": { - "dvtMotionNoConfidence": 0.51, - "dvtCommitteeNormal": 0.51, - "dvtCommitteeNoConfidence": 0.51, - "dvtUpdateToConstitution": 0.51, - "dvtHardForkInitiation": 0.51, - "dvtPPNetworkGroup": 0.51, - "dvtPPEconomicGroup": 0.51, - "dvtPPTechnicalGroup": 0.51, - "dvtPPGovGroup": 0.51, - "dvtTreasuryWithdrawal": 0.51 + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 }, "committeeMinSize": 0, - "committeeMaxTermLength": 60, - "govActionLifetime": 14, - "govActionDeposit": 0, - "dRepDeposit": 0, - "dRepActivity": 0, + "committeeMaxTermLength": 200, + "govActionLifetime": 10, + "govActionDeposit": 1000000000, + "dRepDeposit": 2000000, + "dRepActivity": 20, "constitution": { "anchor": { "url": "", diff --git a/scripts/babbage/conway-babbage-test-genesis.json b/scripts/babbage/conway-babbage-test-genesis.json index 078d33b1814..6141e96d004 100644 --- a/scripts/babbage/conway-babbage-test-genesis.json +++ b/scripts/babbage/conway-babbage-test-genesis.json @@ -1,28 +1,29 @@ { "poolVotingThresholds": { - "pvtCommitteeNormal": 0.51, - "pvtCommitteeNoConfidence": 0.51, - "pvtHardForkInitiation": 0.51, - "pvtMotionNoConfidence": 0.51 + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "hardForkInitiation": 0.51, + "motionNoConfidence": 0.51, + "ppSecurityGroup": 0.51 }, "dRepVotingThresholds": { - "dvtMotionNoConfidence": 0.51, - "dvtCommitteeNormal": 0.51, - "dvtCommitteeNoConfidence": 0.51, - "dvtUpdateToConstitution": 0.51, - "dvtHardForkInitiation": 0.51, - "dvtPPNetworkGroup": 0.51, - "dvtPPEconomicGroup": 0.51, - "dvtPPTechnicalGroup": 0.51, - "dvtPPGovGroup": 0.51, - "dvtTreasuryWithdrawal": 0.51 + "motionNoConfidence": 0.51, + "committeeNormal": 0.51, + "committeeNoConfidence": 0.51, + "updateToConstitution": 0.51, + "hardForkInitiation": 0.51, + "ppNetworkGroup": 0.51, + "ppEconomicGroup": 0.51, + "ppTechnicalGroup": 0.51, + "ppGovGroup": 0.51, + "treasuryWithdrawal": 0.51 }, "committeeMinSize": 0, - "committeeMaxTermLength": 60, - "govActionLifetime": 14, - "govActionDeposit": 0, - "dRepDeposit": 0, - "dRepActivity": 0, + "committeeMaxTermLength": 200, + "govActionLifetime": 10, + "govActionDeposit": 1000000000, + "dRepDeposit": 2000000, + "dRepActivity": 20, "constitution": { "anchor": { "url": "", @@ -30,8 +31,7 @@ } }, "committee": { - "members": { - }, + "members": {}, "quorum": 0 } } diff --git a/scripts/babbage/mkfiles.sh b/scripts/babbage/mkfiles.sh index dce3cd1705f..6ed8d78fb43 100755 --- a/scripts/babbage/mkfiles.sh +++ b/scripts/babbage/mkfiles.sh @@ -109,8 +109,8 @@ $SED -i "${ROOT}/configuration.yaml" \ $CARDANO_CLI genesis create-staked --genesis-dir "${ROOT}" \ --testnet-magic "${NETWORK_MAGIC}" \ --gen-pools 3 \ - --supply 2000000000000 \ - --supply-delegated 240000000002 \ + --supply 2000000000000 \ + --supply-delegated 240000000002 \ --gen-stake-delegs 3 \ --gen-utxo-keys 3 diff --git a/trace-dispatcher/trace-dispatcher.cabal b/trace-dispatcher/trace-dispatcher.cabal index 83b15c412cb..efbce11c7ed 100644 --- a/trace-dispatcher/trace-dispatcher.cabal +++ b/trace-dispatcher/trace-dispatcher.cabal @@ -60,7 +60,7 @@ library , hostname , network , optparse-applicative-fork - , ouroboros-network ^>= 0.10 + , ouroboros-network ^>= 0.11 , ouroboros-network-api , ouroboros-network-framework , serialise diff --git a/trace-forward/trace-forward.cabal b/trace-forward/trace-forward.cabal index ea2b42b9c9c..b176b94ebd1 100644 --- a/trace-forward/trace-forward.cabal +++ b/trace-forward/trace-forward.cabal @@ -65,7 +65,7 @@ library , extra , io-classes , ouroboros-network-api ^>= 0.6 - , ouroboros-network-framework >= 0.9 && < 0.11 + , ouroboros-network-framework >= 0.9 && < 0.12 , serialise , stm , text