Skip to content

Commit

Permalink
Merge pull request #5648 from IntersectMBO/zliu41/880pre
Browse files Browse the repository at this point in the history
8.8.0-pre
  • Loading branch information
disassembler authored Feb 8, 2024
2 parents 32a7687 + 0ba03ab commit 4bb2048
Show file tree
Hide file tree
Showing 48 changed files with 493 additions and 380 deletions.
1 change: 0 additions & 1 deletion .github/workflows/check-mainnet-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,3 @@ jobs:
exit 1
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: >
Expand Down
4 changes: 2 additions & 2 deletions bench/locli/locli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions bench/plutus-scripts-bench/plutus-scripts-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ common project-config
if os(windows)
buildable: False

if impl(ghc < 9)
if impl(ghc < 9.6)
buildable: False


Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}

module Cardano.Benchmarking.PlutusScripts.CustomCallTypes
where
Expand Down
5 changes: 3 additions & 2 deletions bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 []
Expand Down
6 changes: 3 additions & 3 deletions bench/tx-generator/tx-generator.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions cardano-node-chairman/cardano-node-chairman.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
16 changes: 8 additions & 8 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions cardano-node/src/Cardano/Node/Orphans.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE StandaloneDeriving #-}

{-# OPTIONS_GHC -Wno-orphans #-}

Expand All @@ -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

Expand Down
68 changes: 44 additions & 24 deletions cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ->
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand Down
Loading

0 comments on commit 4bb2048

Please sign in to comment.