Skip to content

Commit

Permalink
Merge pull request #5533 from input-output-hk/jasagredo/node-8.7.0
Browse files Browse the repository at this point in the history
Release for node 8.7.0
  • Loading branch information
disassembler authored Nov 22, 2023
2 parents 3e476dd + 8a79c6e commit 34d89af
Show file tree
Hide file tree
Showing 77 changed files with 470 additions and 381 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cabal.project.local.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package HsOpenSSL
flags: +use-pkg-config
5 changes: 0 additions & 5 deletions .github/workflows/cabal.project.local.ci.Darwin

This file was deleted.

5 changes: 0 additions & 5 deletions .github/workflows/cabal.project.local.ci.Linux

This file was deleted.

This file was deleted.

9 changes: 2 additions & 7 deletions .github/workflows/check-cabal-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Workaround runner image issue
if: runner.os == 'Linux'
# https://github.com/actions/runner-images/issues/7061
run: sudo chown -R $USER /usr/local/.ghcup

- name: Install Haskell
uses: input-output-hk/setup-haskell@v1
uses: input-output-hk/actions/haskell@latest
id: setup-haskell
with:
cabal-version: "3.10.1.0"
cabal-version: "3.10.2.0"

- uses: actions/checkout@v3

Expand Down
21 changes: 4 additions & 17 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,13 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["9.2.7", "9.6.2"]
cabal: ["3.10.1.0"]
ghc: ["9.2.8", "9.6.3"]
cabal: ["3.10.2.0"]
os: [macos-latest, windows-latest, ubuntu-latest]

env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2023-10-04"

# Modify this value to "invalidate" the secp cache.
SECP_CACHE_VERSION: "2022-12-30"

# current ref from: 27.02.2022
SECP256K1_REF: ac83be33d0956faf6b7f61a60ab524ef7d6a473a
CABAL_CACHE_VERSION: "2023-11-20-3"

concurrency:
group: >
Expand Down Expand Up @@ -82,7 +76,7 @@ jobs:
- name: Configure build
shell: bash
run: |
cp ".github/workflows/cabal.project.local.ci.$(uname -s)" cabal.project.local
cp .github/workflows/cabal.project.local.ci cabal.project.local
echo "# cabal.project.local"
cat cabal.project.local
Expand Down Expand Up @@ -178,13 +172,6 @@ jobs:
fi
done
- name: Save Artifact
if: matrix.ghc == '8.10.7'
uses: actions/upload-artifact@v1
with:
name: artifacts-${{ matrix.os }}
path: ./artifacts

- name: Delete socket files in chairman tests in preparation for uploading artifacts
if: ${{ always() }}
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stylish-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2023-07-28"
CABAL_CACHE_VERSION: "2023-11-20-3"

STYLISH_HASKELL_VERSION: "0.14.4.0"

Expand Down
4 changes: 2 additions & 2 deletions bench/locli/locli.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: locli
version: 1.33
version: 1.34
synopsis: Cardano log analysis CLI
description: Cardano log analysis CLI.
category: Cardano,
Expand Down Expand Up @@ -121,7 +121,7 @@ library
, optparse-generic
, ouroboros-consensus
-- for Data.SOP.Strict:
, ouroboros-network ^>= 0.9.1
, ouroboros-network ^>= 0.10
, ouroboros-network-api
, process
, quiet
Expand Down
3 changes: 0 additions & 3 deletions bench/locli/src/Cardano/Render.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import Data.List (dropWhileEnd)
import Data.Map.Strict qualified as Map
import Data.Text qualified as T
import Data.Text.Lazy qualified as LT
#if __GLASGOW_HASKELL__ >= 906
import Data.Type.Equality (type (~))
#endif
import Options.Applicative qualified as Opt

import Data.CDF
Expand Down
1 change: 1 addition & 0 deletions bench/locli/src/Cardano/Unlog/LogObject.hs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ readLogObjectStream f okDErr loAnyLimit =
. Text.fromText
. LText.pack)
id)
. filter (not . LBS.null)
. LBS.split (fromIntegral $ fromEnum '\n')
where
isDecodeError x = \case
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
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: plutus-scripts-bench
version: 1.0.0.5
version: 1.0.0.6
synopsis: Plutus scripts used for benchmarking
description: Plutus scripts used for benchmarking.
category: Cardano,
Expand Down Expand Up @@ -72,7 +72,7 @@ library
-- IOG dependencies
--------------------------
build-depends:
, cardano-api ^>= 8.29
, cardano-api ^>= 8.33
, 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
@@ -1,5 +1,5 @@
{-# LANGUAGE GADTs #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
Expand All @@ -20,8 +20,8 @@ import "contra-tracer" Control.Tracer (Tracer (..))
import Codec.Serialise (DeserialiseFailure)
import Control.Concurrent.Class.MonadSTM.Strict (newTVarIO)
import Control.Monad.Class.MonadTimer (MonadTimer, threadDelay)
import Data.Foldable (fold)
import Data.ByteString.Lazy (ByteString)
import Data.Foldable (fold)
import qualified Data.Map.Strict as Map
import Data.Proxy (Proxy (..))
import Data.Void (Void)
Expand All @@ -37,26 +37,28 @@ import Ouroboros.Consensus.Node.NetworkProtocolVersion
import Ouroboros.Consensus.Node.Run (RunNode)
import Ouroboros.Consensus.Shelley.Eras (StandardCrypto)

import Ouroboros.Network.Context
import Ouroboros.Network.Channel (Channel (..))
import Ouroboros.Network.Context
import Ouroboros.Network.ControlMessage (continueForever)
import Ouroboros.Network.DeltaQ (defaultGSV)
import Ouroboros.Network.Driver (runPeer, runPeerWithLimits)
import Ouroboros.Network.KeepAlive
import Ouroboros.Network.Magic
import Ouroboros.Network.Mux (MiniProtocolCb (..), OuroborosApplication (..), OuroborosBundle,
RunMiniProtocol (..), MuxMode (..))
import Ouroboros.Network.Mux (MiniProtocolCb (..), MuxMode (..),
OuroborosApplication (..), OuroborosBundle, RunMiniProtocol (..))
import Ouroboros.Network.NodeToClient (IOManager, chainSyncPeerNull)
import Ouroboros.Network.NodeToNode (NetworkConnectTracers (..))
import qualified Ouroboros.Network.NodeToNode as NtN
import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..))
import Ouroboros.Network.PeerSelection.PeerSharing.Codec (decodeRemoteAddress,
encodeRemoteAddress)
import Ouroboros.Network.Protocol.BlockFetch.Client (BlockFetchClient (..),
blockFetchClientPeer)
import Ouroboros.Network.Protocol.Handshake.Version (simpleSingletonVersions)
import Ouroboros.Network.Protocol.KeepAlive.Client hiding (SendMsgDone)
import Ouroboros.Network.Protocol.KeepAlive.Codec
import Ouroboros.Network.Protocol.TxSubmission2.Client (TxSubmissionClient,
txSubmissionClientPeer)
import Ouroboros.Network.PeerSelection.PeerSharing (PeerSharing (..), encodeRemoteAddress, decodeRemoteAddress)
import Ouroboros.Network.Protocol.PeerSharing.Client (PeerSharingClient (..),
peerSharingClientPeer)

Expand Down Expand Up @@ -91,7 +93,7 @@ benchmarkConnectTxSubmit ioManager handshakeTracer submissionTracer codecConfig
(addrAddress <$> Nothing)
(addrAddress remoteAddr)
where
ownPeerSharing = NoPeerSharing
ownPeerSharing = PeerSharingDisabled
mkApp :: OuroborosBundle mode initiatorCtx responderCtx bs m a b
-> OuroborosApplication mode initiatorCtx responderCtx bs m a b
mkApp bundle =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ import qualified Data.List as L
import qualified Data.List.Extra as L
import qualified Data.List.NonEmpty as NE
import qualified Data.Text as T
#if __GLASGOW_HASKELL__ >= 906
import Data.Type.Equality (type (~))
#endif

import Cardano.Tracing.OrphanInstances.Byron ()
import Cardano.Tracing.OrphanInstances.Common ()
Expand Down Expand Up @@ -191,12 +188,12 @@ txSubmissionClient tr bmtr initialTxSource endOfProtocolCallback =

toGenTx :: tx -> GenTx CardanoBlock
toGenTx tx = case shelleyBasedEra @era of
ShelleyBasedEraShelley -> toConsensusGenTx $ TxInMode tx ShelleyEraInCardanoMode
ShelleyBasedEraAllegra -> toConsensusGenTx $ TxInMode tx AllegraEraInCardanoMode
ShelleyBasedEraMary -> toConsensusGenTx $ TxInMode tx MaryEraInCardanoMode
ShelleyBasedEraAlonzo -> toConsensusGenTx $ TxInMode tx AlonzoEraInCardanoMode
ShelleyBasedEraBabbage -> toConsensusGenTx $ TxInMode tx BabbageEraInCardanoMode
ShelleyBasedEraConway -> toConsensusGenTx $ TxInMode tx ConwayEraInCardanoMode
ShelleyBasedEraShelley -> toConsensusGenTx $ TxInMode ShelleyEra tx
ShelleyBasedEraAllegra -> toConsensusGenTx $ TxInMode AllegraEra tx
ShelleyBasedEraMary -> toConsensusGenTx $ TxInMode MaryEra tx
ShelleyBasedEraAlonzo -> toConsensusGenTx $ TxInMode AlonzoEra tx
ShelleyBasedEraBabbage -> toConsensusGenTx $ TxInMode BabbageEra tx
ShelleyBasedEraConway -> toConsensusGenTx $ TxInMode ConwayEra tx

fromGenTxId :: GenTxId CardanoBlock -> TxId
fromGenTxId (Block.GenTxIdShelley (Mempool.ShelleyTxId i)) = fromShelleyTxId i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ import Ouroboros.Network.Protocol.LocalTxSubmission.Type (SubmitResult
import Cardano.Node.Configuration.Logging (LoggingLayer)
import Cardano.Node.Protocol.Types (SomeConsensusProtocol (..))

import Cardano.Api.Shelley (CardanoMode)
import Cardano.CLI.Types.Common (SigningKeyFile)

import Cardano.Api (BlockType (..), ConsensusModeParams (..), EpochSlots (..),
LocalNodeConnectInfo (..), NetworkId (..), PaymentKey, SigningKey, SocketPath,
TxInMode, TxValidationErrorInMode, protocolInfo, submitTxToNodeLocal)
TxInMode, TxValidationErrorInCardanoMode, protocolInfo, submitTxToNodeLocal)
import Cardano.Ledger.Shelley.Genesis (ShelleyGenesis)

type CardanoBlock = Consensus.CardanoBlock StandardCrypto
Expand All @@ -61,8 +60,8 @@ protocolToNetworkId :: SomeConsensusProtocol -> NetworkId
protocolToNetworkId ptcl
= Testnet $ getNetworkMagic $ configBlock $ protocolToTopLevelConfig ptcl

makeLocalConnectInfo :: NetworkId -> SocketPath -> LocalNodeConnectInfo CardanoMode
makeLocalConnectInfo :: NetworkId -> SocketPath -> LocalNodeConnectInfo
makeLocalConnectInfo networkId socketPath
= LocalNodeConnectInfo (CardanoModeParams (EpochSlots 21600)) networkId socketPath

type LocalSubmitTx = (TxInMode CardanoMode -> IO (SubmitResult (TxValidationErrorInMode CardanoMode)))
type LocalSubmitTx = (TxInMode -> IO (SubmitResult TxValidationErrorInCardanoMode))
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import System.Exit

import Data.Aeson as Aeson
import Data.Aeson.Encode.Pretty
import Data.Aeson.Parser as Aeson (json)
import qualified Data.Attoparsec.ByteString as Atto
import qualified Data.Yaml as Yaml (encode)

Expand Down
31 changes: 15 additions & 16 deletions bench/tx-generator/src/Cardano/Benchmarking/Script/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ addFund era wallet txIn lovelace keyName = do
fundKey <- getEnvKeys keyName
let
mkOutValue :: forall era. IsShelleyBasedEra era => AsType era -> ActionM (InAnyCardanoEra TxOutValue)
mkOutValue _ = return $ InAnyCardanoEra (cardanoEra @era) (lovelaceToTxOutValue (cardanoEra @era) lovelace)
mkOutValue _ = return $ InAnyCardanoEra (cardanoEra @era) (lovelaceToTxOutValue (shelleyBasedEra @era) lovelace)
outValue <- withEra era mkOutValue
addFundToWallet wallet txIn outValue fundKey

Expand Down Expand Up @@ -161,14 +161,14 @@ cancelBenchmark n = do
liftIO shutdownAction
waitBenchmarkCore ctl

getLocalConnectInfo :: ActionM (LocalNodeConnectInfo CardanoMode)
getLocalConnectInfo :: ActionM LocalNodeConnectInfo
getLocalConnectInfo = makeLocalConnectInfo <$> getEnvNetworkId <*> getEnvSocketPath

queryEra :: ActionM AnyCardanoEra
queryEra = do
localNodeConnectInfo <- getLocalConnectInfo
chainTip <- liftIO $ getLocalChainTip localNodeConnectInfo
ret <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) $ QueryCurrentEra CardanoModeIsMultiEra
ret <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) QueryCurrentEra
case ret of
Right era -> return era
Left err -> liftTxGenError $ TxGenError $ show err
Expand All @@ -180,11 +180,10 @@ queryRemoteProtocolParameters = do
era <- queryEra
let
callQuery :: forall era.
EraInMode era CardanoMode
-> QueryInEra era (Ledger.PParams (ShelleyLedgerEra era))
QueryInEra era (Ledger.PParams (ShelleyLedgerEra era))
-> ActionM ProtocolParameters
callQuery eraInMode query@(QueryInShelleyBasedEra shelleyEra _) = do
res <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) (QueryInEra eraInMode query)
callQuery query@(QueryInShelleyBasedEra shelleyEra _) = do
res <- liftIO $ queryNodeLocalState localNodeConnectInfo (Just $ chainTipToChainPoint chainTip) (QueryInEra query)
case res of
Right (Right pp) -> do
let pp' = fromLedgerPParams shelleyEra pp
Expand All @@ -196,12 +195,12 @@ queryRemoteProtocolParameters = do
Left err -> liftTxGenError $ TxGenError $ show err
case era of
AnyCardanoEra ByronEra -> liftTxGenError $ TxGenError "queryRemoteProtocolParameters Byron not supported"
AnyCardanoEra ShelleyEra -> callQuery ShelleyEraInCardanoMode $ QueryInShelleyBasedEra ShelleyBasedEraShelley QueryProtocolParameters
AnyCardanoEra AllegraEra -> callQuery AllegraEraInCardanoMode $ QueryInShelleyBasedEra ShelleyBasedEraAllegra QueryProtocolParameters
AnyCardanoEra MaryEra -> callQuery MaryEraInCardanoMode $ QueryInShelleyBasedEra ShelleyBasedEraMary QueryProtocolParameters
AnyCardanoEra AlonzoEra -> callQuery AlonzoEraInCardanoMode $ QueryInShelleyBasedEra ShelleyBasedEraAlonzo QueryProtocolParameters
AnyCardanoEra BabbageEra -> callQuery BabbageEraInCardanoMode $ QueryInShelleyBasedEra ShelleyBasedEraBabbage QueryProtocolParameters
AnyCardanoEra ConwayEra -> callQuery ConwayEraInCardanoMode $ QueryInShelleyBasedEra ShelleyBasedEraConway QueryProtocolParameters
AnyCardanoEra ShelleyEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraShelley QueryProtocolParameters
AnyCardanoEra AllegraEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraAllegra QueryProtocolParameters
AnyCardanoEra MaryEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraMary QueryProtocolParameters
AnyCardanoEra AlonzoEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraAlonzo QueryProtocolParameters
AnyCardanoEra BabbageEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraBabbage QueryProtocolParameters
AnyCardanoEra ConwayEra -> callQuery $ QueryInShelleyBasedEra ShelleyBasedEraConway QueryProtocolParameters

getProtocolParameters :: ActionM ProtocolParameters
getProtocolParameters = do
Expand All @@ -219,7 +218,7 @@ waitForEra era = do
liftIO $ threadDelay 1_000_000
waitForEra era

localSubmitTx :: TxInMode CardanoMode -> ActionM (SubmitResult (TxValidationErrorInMode CardanoMode))
localSubmitTx :: TxInMode -> ActionM (SubmitResult TxValidationErrorInCardanoMode)
localSubmitTx tx = do
submit <- getLocalSubmitTx
ret <- liftIO $ submit tx
Expand Down Expand Up @@ -401,10 +400,10 @@ selectCollateralFunds (Just walletName) = do
Nothing -> throwE $ WalletError $ "selectCollateralFunds: collateral: era not supported :" ++ show (cardanoEra @era)
Just p -> return (TxInsCollateral p $ map getFundTxIn collateralFunds, collateralFunds)

dumpToFile :: FilePath -> TxInMode CardanoMode -> ActionM ()
dumpToFile :: FilePath -> TxInMode -> ActionM ()
dumpToFile filePath tx = liftIO $ dumpToFileIO filePath tx

dumpToFileIO :: FilePath -> TxInMode CardanoMode -> IO ()
dumpToFileIO :: FilePath -> TxInMode -> IO ()
dumpToFileIO filePath tx = appendFile filePath ('\n' : show tx)

initWallet :: String -> ActionM ()
Expand Down
4 changes: 2 additions & 2 deletions bench/tx-generator/src/Cardano/TxGenerator/Fund.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ getFundKey (Fund (InAnyCardanoEra _ a)) = _fundSigningKey a
-- | Converting a `TxOutValue` to `Lovelace` requires case analysis.
getFundLovelace :: Fund -> Lovelace
getFundLovelace (Fund (InAnyCardanoEra _ a)) = case _fundVal a of
TxOutAdaOnly _era l -> l
TxOutValue _era v -> selectLovelace v
TxOutValueByron l -> l
TxOutValueShelleyBased era v -> selectLovelace $ Api.fromLedgerValue era v

-- TODO: facilitate casting KeyWitnesses between eras -- Note [Era transitions]
-- | The `Fund` alternative is checked against `cardanoEra`, but
Expand Down
2 changes: 1 addition & 1 deletion bench/tx-generator/src/Cardano/TxGenerator/Genesis.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ genesisSecureInitialFund networkId genesis srcKey destKey TxGenTxParams{txParamF
Just (_, lovelace) ->
let
txOutValue :: TxOutValue era
txOutValue = mkTxOutValueAdaOnly $ lovelace - txParamFee
txOutValue = lovelaceToTxOutValue (shelleyBasedEra @era) $ lovelace - txParamFee
in genesisExpenditure networkId srcKey destAddr txOutValue txParamFee txParamTTL destKey
where
destAddr = keyAddress @era networkId destKey
Expand Down
2 changes: 1 addition & 1 deletion bench/tx-generator/src/Cardano/TxGenerator/PureExample.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ genesisValue :: TxOutValue BabbageEra

(genesisTxIn, genesisValue) =
( TxIn "900fc5da77a0747da53f7675cbb7d149d46779346dea2f879ab811ccc72a2162" (TxIx 0)
, lovelaceToTxOutValue BabbageEra $ Lovelace 90000000000000
, lovelaceToTxOutValue ShelleyBasedEraBabbage $ Lovelace 90000000000000
)

genesisFund :: Fund
Expand Down
2 changes: 1 addition & 1 deletion bench/tx-generator/src/Cardano/TxGenerator/Setup/Plutus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Cardano.CLI.Read (readFileScriptInAnyLang)
import Cardano.Api
import Cardano.Api.Shelley (PlutusScript (..), ProtocolParameters (..), fromAlonzoExUnits,
protocolParamCostModels, toPlutusData)
import Cardano.Ledger.Alonzo.TxInfo (exBudgetToExUnits)
import Cardano.Ledger.Alonzo.Plutus.TxInfo (exBudgetToExUnits)

import qualified PlutusLedgerApi.V1 as PlutusV1
import qualified PlutusLedgerApi.V2 as PlutusV2
Expand Down
Loading

0 comments on commit 34d89af

Please sign in to comment.