Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Most specifically update cardano-ledger which has changed significantly
and required a HUGE number of changes.

Co-Authored-By: Marcin Szamotulski <coot@coot.me>
Co-authored-by: Jonathan Knowles <jonathan.knowles@iohk.io>
Co-authored-by: Johannes Lund <johannes.lund@iohk.io>
Co-authored-by: Paolo Veronelli <paolo.veronelli@gmail.com>
  • Loading branch information
5 people committed Mar 16, 2023
1 parent 7d4f880 commit f634654
Show file tree
Hide file tree
Showing 46 changed files with 582 additions and 508 deletions.
159 changes: 67 additions & 92 deletions cabal.project
Expand Up @@ -50,12 +50,12 @@ repository cardano-haskell-packages
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- repeating the index-state for hackage to work around hackage.nix parsing limitation
index-state: 2022-09-27T00:00:00Z
index-state: 2023-01-30T00:00:00Z
index-state:
, hackage.haskell.org 2022-09-27T00:00:00Z
, cardano-haskell-packages 2022-10-25T20:00:00Z
, hackage.haskell.org 2023-01-30T00:00:00Z
, cardano-haskell-packages 2022-12-14T00:40:15Z

with-compiler: ghc-8.10.7
-- with-compiler: ghc-8.10.7

packages:
lib/balance-tx/
Expand Down Expand Up @@ -95,76 +95,59 @@ source-repository-package
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-addresses
tag: 2c0923cbc13e0dc022cc1e33571d41f173a4c810
--sha256: 0j7qn5h3099yzjdy72d9l40nbgwcm3w0vi3y15k0q91n2vcx4q1p
tag: 46e3807ad4529344567c50ee5c3489e60575a9dd
--sha256: 03ya5md876sfw0nihmjk5rza76z1m9j7q34j8rj2marrkb51vhf0
subdir: command-line
core

source-repository-package
type: git
location: https://github.com/input-output-hk/bech32
tag: ab61914443e5f53624d3b2995767761b3f68e576
--sha256: 0isqh5s6rdhmqa3jhvc32zb3kvzy149hmzddx1ld9f9jhls4f3wg
subdir: bech32
bech32-th

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-sl-x509
tag: a91add165152fa36f08e95fafe7da24f1dba4690
--sha256: 1ia8vlqghis92cla8qmqa6kh8f3jn29b01fshyk5hmgy5373s684

source-repository-package
type: git
location: https://github.com/input-output-hk/ekg-forward
tag: 297cd9db5074339a2fb2e5ae7d0780debb670c63
--sha256: 1zcwry3y5rmd9lgxy89wsb3k4kpffqji35dc7ghzbz603y1gy24g

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-crypto
tag: f73079303f663e028288f9f4a9e08bcca39a923e
--sha256: 1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q

-- Different version than from CHaP to include the ReaderT fix.
-- TODO [ADP-2447] This source-repository-package should be removable with next node bump.
source-repository-package
type: git
location: https://github.com/input-output-hk/io-sim
tag: 57e888b1894829056cb00b7b5785fdf6a74c3271
--sha256: 1kv8lwmrw1c0g03jy3i3fgk3c8d47ihjcslg295djqj442y95y2f
subdir:
io-classes
io-sim
strict-stm

-- It seems that if we remove this source-repository-package to rely on CHaP,
-- for some reason, we're unable to retrieve the cardano-node executables in
-- our nix/haskell.nix file.

-- Without this source-repository-package:
-- config.hsPkgs.cardano-node.components.exes
-- => []
--
-- With:
-- config.hsPkgs.cardano-node.components.exes
-- => [ "cardano-node" ]
--
-- TODO [ADP-2447] See if the situation has improved and try to remove this source-repository-package.
source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
tag: ebc7be471b30e5931b35f9bbc236d21c375b91bb
--sha256: 1j01m2cp2vdcl26zx9xmipr551v3b2rz9kfn9ik8byfwj1z7652r
subdir:
cardano-api
cardano-git-rev
cardano-cli
cardano-node
cardano-node-chairman
trace-dispatcher
trace-resources
trace-forward
type: git
location: https://github.com/input-output-hk/ouroboros-network
tag: 679c7da2079a5e9972a1c502b6a4d6af3eb76945
--sha256: 138mqd5cv0b13giwjvlz3pr6l1cwgpn38n0q3m11mrjwwmmxl0mw
subdir:
monoidal-synchronisation
network-mux
ouroboros-consensus
ouroboros-consensus-byron
ouroboros-consensus-cardano
ouroboros-consensus-protocol
ouroboros-consensus-shelley
ouroboros-network
ouroboros-network-framework
ouroboros-network-testing
ouroboros-consensus-cardano-tools

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-node
tag: 75130f1d496b44e80cbd842b27ac203adf35bcd4
--sha256: 1wy33hs5rg2n0haf5wc9s9mrrkdzyp95njkkpgs8g5mnllapdka8
subdir:
cardano-api
cardano-git-rev
cardano-cli
cardano-node
cardano-node-chairman
trace-dispatcher
trace-resources
trace-forward

-- -------------------------------------------------------------------------
-- Constraints tweaking
Expand All @@ -176,18 +159,12 @@ source-repository-package
allow-newer:
hjsonschema:*
, hjsonpointer:*
, cardano-sl-x509:ip
, *:aeson
, size-based:template-haskell

-- Copied from (copied from cardano-node/cabal.project)
allow-newer:
*:aeson,
monoidal-containers:aeson,
size-based:template-haskell

allow-newer:
async-timer:unliftio-core
, *:hashable
, async-timer:unliftio-core
, ekg:*
, ntp-client:*
, libsystemd-journal:base

constraints:
bimap >= 0.4.0
Expand All @@ -202,46 +179,44 @@ constraints:
, Cabal >= 3.4.0.0
, async-timer >= 0.2.0.0
, unliftio-core >= 0.2.0.1
, cardano-api == 1.35.4
, cardano-node == 1.35.4
, generic-arbitrary == 0.2.2
, cardano-api >= 1.35.4
, cardano-node >= 1.35.4
, generic-arbitrary >= 0.2.2
, iohk-monitoring >= 0.1.11

-- Could probably be bumped with minor work in the wallet
, resource-pool == 0.2.3.2
, resource-pool >= 0.2.3.2

-- TH Name shadowing warnings need to be addressed when bumping to 2.13.3.5
, persistent == 2.13.3.3

-- Copied from cardano-node's cabal.project:
, bimap >= 0.4.0
, libsystemd-journal >= 1.4.4
, systemd >= 2.3.0
-- systemd-2.3.0 requires at least network 3.1.1.0 but it doesn't declare
-- that dependency
, network >= 3.1.1.0
, HSOpenSSL >= 0.11.7.2
, algebraic-graphs < 0.7
, protolude < 0.3.1
, cardano-prelude == 0.1.0.0
, base-deriving-via == 0.1.0.0
, cardano-binary == 1.5.0
, cardano-binary-test == 1.3.0
, cardano-crypto-class == 2.0.0.0.1
, cardano-crypto-praos == 2.0.0.0.1
, cardano-crypto-tests == 2.0.0.0.1
, cardano-slotting == 0.1.0.0
, measures == 0.1.0.0
, orphans-deriving-via == 0.1.0.0
, strict-containers == 0.1.0.0
, plutus-core == 1.0.0.1
, plutus-ledger-api == 1.0.0.1
, plutus-tx == 1.0.0.0
, plutus-tx-plugin == 1.0.0.0
, prettyprinter-configurable == 0.1.0.0
, plutus-ghc-stub == 8.6.5
, word-array == 0.1.0.0
, word-array == 0.1.0.0
, cardano-prelude >= 0.1.0.0
, base-deriving-via >= 0.1.0.0
, cardano-binary >= 1.5.0
, cardano-binary-test >= 1.3.0
, cardano-crypto-class >= 2.0.0.0.1
, cardano-crypto-praos >= 2.0.0.0.1
, cardano-crypto-tests >= 2.0.0.0.1
, cardano-slotting >= 0.1.0.0
, measures >= 0.1.0.0
, orphans-deriving-via >= 0.1.0.0
, plutus-core >= 1.0.0.1
, plutus-ledger-api >= 1.0.0.1
, plutus-tx >= 1.0.0.0
, plutus-tx-plugin >= 1.0.0.0
, prettyprinter-configurable >= 0.1.0.0
, plutus-ghc-stub >= 8.6.5
, word-array >= 0.1.0.0

-- Related to: https://github.com/haskell/cabal/issues/8554
if impl(ghc == 8.10.7)
constraints: process == 1.6.13.2

-- ----------------------------------------------------------------
-- Flags for dependencies
Expand Down
2 changes: 2 additions & 0 deletions lib/dbvar/src/Data/DBVar.hs
Expand Up @@ -52,6 +52,8 @@ import Control.Monad.Class.MonadSTM
, retry
, writeTVar
)
import Control.Exception
( Exception, SomeException, toException )
import Control.Monad.Class.MonadThrow
( MonadEvaluate
, MonadMask
Expand Down
82 changes: 75 additions & 7 deletions lib/delta-table/src/Demo/Database.hs
Expand Up @@ -31,7 +31,7 @@ import Control.Applicative
( Alternative )
import Control.Monad
( MonadPlus )
import Control.Monad.Class.MonadSTM
import Control.Monad.Class.MonadSTM.Internal
( MonadSTM (..) )
import Control.Monad.Class.MonadThrow
( ExitCase (..)
Expand All @@ -46,6 +46,8 @@ import Control.Monad.Logger
( NoLoggingT )
import Data.Chain
( DeltaChain (..), Edge (..), chainIntoTable )
import Data.Function
( on )
import Data.Generics.Internal.VL
( Iso', iso, withIso )
import Data.Proxy
Expand Down Expand Up @@ -75,7 +77,6 @@ import GHC.Generics
import Say
( sayShow )

import qualified Control.Concurrent.STM.TVar as STM
import qualified Control.Monad.Catch as ResourceT
import qualified Control.Monad.STM as STM
import qualified Data.Chain as Chain
Expand Down Expand Up @@ -158,11 +159,78 @@ newStoreAddress = embedStore addressChainIntoTable =<< newEntityStore
instance MonadSTM (NoLoggingT (ResourceT IO)) where
type STM (NoLoggingT (ResourceT IO)) = WrapSTM
type TVar (NoLoggingT (ResourceT IO)) = TVar IO
atomically = liftIO . STM.atomically . unWrapSTM
newTVar = WrapSTM . STM.newTVar
readTVar = WrapSTM . STM.readTVar
writeTVar v = WrapSTM . STM.writeTVar v
modifyTVar' v = WrapSTM . STM.modifyTVar' v
newTVar = WrapSTM . newTVar
readTVar = WrapSTM . readTVar
writeTVar = WrapSTM .: writeTVar
retry = WrapSTM retry
orElse = WrapSTM .: on orElse unWrapSTM

modifyTVar = WrapSTM .: modifyTVar
modifyTVar' = WrapSTM .: modifyTVar'
stateTVar = WrapSTM .: stateTVar
swapTVar = WrapSTM .: swapTVar
check = WrapSTM . check

type TMVar (NoLoggingT (ResourceT IO)) = TMVar IO
newTMVar = WrapSTM . newTMVar
newEmptyTMVar = WrapSTM newEmptyTMVar
takeTMVar = WrapSTM . takeTMVar
tryTakeTMVar = WrapSTM . tryTakeTMVar
putTMVar = WrapSTM .: putTMVar
tryPutTMVar = WrapSTM .: tryPutTMVar
readTMVar = WrapSTM . readTMVar
tryReadTMVar = WrapSTM . tryReadTMVar
swapTMVar = WrapSTM .: swapTMVar
isEmptyTMVar = WrapSTM . isEmptyTMVar

type TQueue (NoLoggingT (ResourceT IO)) = TQueue IO
newTQueue = WrapSTM newTQueue
readTQueue = WrapSTM . readTQueue
tryReadTQueue = WrapSTM . tryReadTQueue
peekTQueue = WrapSTM . peekTQueue
tryPeekTQueue = WrapSTM . tryPeekTQueue
flushTQueue = WrapSTM . flushTQueue
writeTQueue v = WrapSTM . writeTQueue v
isEmptyTQueue = WrapSTM . isEmptyTQueue
unGetTQueue = WrapSTM .: unGetTQueue

type TBQueue (NoLoggingT (ResourceT IO)) = TBQueue IO
newTBQueue = WrapSTM . newTBQueue
readTBQueue = WrapSTM . readTBQueue
tryReadTBQueue = WrapSTM . tryReadTBQueue
peekTBQueue = WrapSTM . peekTBQueue
tryPeekTBQueue = WrapSTM . tryPeekTBQueue
flushTBQueue = WrapSTM . flushTBQueue
writeTBQueue = WrapSTM .: writeTBQueue
lengthTBQueue = WrapSTM . lengthTBQueue
isEmptyTBQueue = WrapSTM . isEmptyTBQueue
isFullTBQueue = WrapSTM . isFullTBQueue
unGetTBQueue = WrapSTM .: unGetTBQueue

type TArray (NoLoggingT (ResourceT IO)) = TArray IO

type TSem (NoLoggingT (ResourceT IO)) = TSem IO
newTSem = WrapSTM . newTSem
waitTSem = WrapSTM . waitTSem
signalTSem = WrapSTM . signalTSem
signalTSemN = WrapSTM .: signalTSemN

type TChan (NoLoggingT (ResourceT IO)) = TChan IO
newTChan = WrapSTM newTChan
newBroadcastTChan = WrapSTM newBroadcastTChan
dupTChan = WrapSTM . dupTChan
cloneTChan = WrapSTM . cloneTChan
readTChan = WrapSTM . readTChan
tryReadTChan = WrapSTM . tryReadTChan
peekTChan = WrapSTM . peekTChan
tryPeekTChan = WrapSTM . tryPeekTChan
writeTChan = WrapSTM .: writeTChan
unGetTChan = WrapSTM .: unGetTChan
isEmptyTChan = WrapSTM . isEmptyTChan


(.:) :: (c -> d) -> (a -> b -> c) -> (a -> b -> d)
(f .: g) x y = f (g x y)

-- | Helper type for the above instance.
newtype WrapSTM a = WrapSTM { unWrapSTM :: STM.STM a }
Expand Down
18 changes: 11 additions & 7 deletions lib/wallet/api/http/Cardano/Wallet/Launch/Cluster.hs
Expand Up @@ -259,8 +259,12 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B8
import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString.Lazy.Char8 as BL8
<<<<<<< HEAD
import qualified Data.List.NonEmpty as NE
import qualified Data.Map.Strict as Map
=======
import qualified Data.ListMap as ListMap
>>>>>>> c74a4ee662 (Update dependencies)
import qualified Data.Set as Set
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
Expand Down Expand Up @@ -580,16 +584,16 @@ configurePool tr baseDir era metadataServer recipe = do
}

let updateStaking sgs = sgs
{ Ledger.sgsPools = (Map.singleton poolId params)
{ Ledger.sgsPools = (ListMap.ListMap [(poolId, params)])
<> (sgsPools sgs)
, Ledger.sgsStake = (Map.singleton stakePubHash poolId)
, Ledger.sgsStake = (ListMap.fromList [(stakePubHash, poolId)])
<> Ledger.sgsStake sgs
}
let poolSpecificFunds = Map.fromList
let poolSpecificFunds = ListMap.fromList
[(pledgeAddr, Ledger.Coin $ intCast pledgeAmt)]

return $ \sg -> sg
{ sgInitialFunds = poolSpecificFunds <> (sgInitialFunds sg)
{ sgInitialFunds = poolSpecificFunds <> sgInitialFunds sg
, sgStaking = updateStaking (sgStaking sg)
}

Expand Down Expand Up @@ -905,7 +909,7 @@ generateGenesis dir systemStart initialFunds addPoolsToGenesis = do
let startTime = round @_ @Int . utcTimeToPOSIXSeconds $ systemStart
let systemStart' = posixSecondsToUTCTime . fromRational . toRational $ startTime

let pparams = Ledger.PParams
let pparams = Ledger.ShelleyPParams
{ _minfeeA = 100
, _minfeeB = 100_000
, _minUTxOValue = Ledger.Coin 1_000_000
Expand Down Expand Up @@ -981,8 +985,8 @@ generateGenesis dir systemStart initialFunds addPoolsToGenesis = do
}

where
extraInitialFunds :: Map (Ledger.Addr (Crypto StandardShelley)) Ledger.Coin
extraInitialFunds = Map.fromList
extraInitialFunds :: ListMap (Ledger.Addr (Crypto StandardShelley)) Ledger.Coin
extraInitialFunds = ListMap.fromList
[ (fromMaybe (error "extraFunds: invalid addr") $ Ledger.deserialiseAddr addrBytes
, Ledger.Coin $ intCast c)
| (Address addrBytes, Coin c) <- initialFunds
Expand Down

0 comments on commit f634654

Please sign in to comment.