Skip to content

Commit a84887a

Browse files
authored
Merge pull request #91 from geniusyield/update-maestro-sdk
feat: remove usage of deprecated Maestro endpoints
2 parents ad6be7d + 697ec24 commit a84887a

File tree

7 files changed

+121
-139
lines changed

7 files changed

+121
-139
lines changed

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/geniusyield/haskell-base-image:9.2.8
1+
FROM ghcr.io/geniusyield/haskell-base-image:9.6.5
22

33
# ==================================[ BUILD ]========================================
44
WORKDIR /MM

cabal.project

+84-123
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ repository cardano-haskell-packages
1010
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee
1111

1212
-- repeating the index-state for hackage to work around hackage.nix parsing limitation
13-
index-state: 2023-06-06T00:00:00Z
13+
index-state: 2024-03-19T15:29:53Z
1414

1515
index-state:
16-
, hackage.haskell.org 2023-06-06T00:00:00Z
17-
, cardano-haskell-packages 2023-06-05T06:39:32Z
16+
, hackage.haskell.org 2024-03-19T15:29:53Z
17+
, cardano-haskell-packages 2024-03-15T17:07:52Z
1818

1919
packages: .
2020
packages: geniusyield-annset
@@ -24,127 +24,113 @@ packages: geniusyield-market-maker
2424
-- TODO: Default value should be @direct@ in upcoming 3.10 version of cabal, omit this line then.
2525
test-show-details: direct
2626

27-
package cardano-crypto-praos
28-
flags: -external-libsodium-vrf
29-
30-
-- TODO: This is fixed for in their later version, omit this when we update to it.
31-
package strict-containers
32-
ghc-options: -Wwarn=noncanonical-monad-instances
33-
3427
source-repository-package
3528
type: git
3629
location: https://github.com/geniusyield/dex-contracts-api
37-
tag: d1212bba3112e3057543a159303f0bdec294feca
38-
--sha256: sha256-fgFz50aaEr1uZQTBO1C1Y+G08SQmoZjs0ajqh5pWFzg=
30+
tag: 5d21453d7b99491b5e40ddcdb500685bcd00f862
31+
--sha256: sha256-s8xPPW4zbcYdJvZsxZfBAOCvaheSqI01k1SUhMRrXTA=
3932
subdir:
4033
geniusyield-dex-api
4134
geniusyield-onchain/geniusyield-common
4235

43-
source-repository-package
44-
type: git
45-
location: https://github.com/maestro-org/haskell-sdk
46-
tag: 609515b3f8861efaa17adf4e599aa1b845775a6d
47-
--sha256: sha256-8se+xlIB1BDEuKGwjaldmW5G4LpCujD1ABgBaY0cY6Y=
48-
49-
-- Unfortunately, cardano-node 8.1.2 is constrained with plutus-ledger-api 1.5.0.0 and we would like at least 1.6.0.0.
50-
-- This is done in accordance with changes in https://github.com/input-output-hk/cardano-ledger/pull/3430/files.
51-
constraints:
52-
plutus-ledger-api == 1.6.0.0
53-
, plutus-core == 1.6.0.0
54-
55-
allow-newer:
56-
, cardano-ledger-alonzo:plutus-ledger-api
57-
, cardano-ledger-alonzo:plutus-core
58-
, cardano-ledger-alonzo-test:plutus-ledger-api
59-
, cardano-ledger-alonzo-test:plutus-ledger-api-testlib
60-
, cardano-ledger-babbage:plutus-ledger-api
61-
, cardano-ledger-conway:plutus-ledger-api
62-
, cardano-ledger-binary:plutus-ledger-api
63-
, cardano-api:plutus-ledger-api
64-
, cardano-api:plutus-ledger-api-testlib
65-
, cardano-api:prettyprinter-configurable
66-
6736
source-repository-package
6837
type: git
6938
location: https://github.com/geniusyield/ply
70-
tag: c301d9514982abce1b4497237ba8231cf3ca058d
71-
--sha256: sha256-f3hhzeOpva64FfF4HZc3uoPcWbhEJN20b0RrEKfXBxc=
39+
tag: b13674633771f572a5eedfb47276c0ac3993ab85
40+
--sha256: sha256-a63OdFAbo0sWOXxceI2bW/ZMrS8wo1t7aPFrfXvVhvE=
7241
subdir: ply-core
7342

7443
source-repository-package
7544
type: git
7645
location: https://github.com/geniusyield/atlas
77-
tag: 105ff78b32935ae5c18c53ccf4fb8462b8c1ca03
78-
--sha256: sha256-Ee/UIoJ8OYBxgdnSv61hN8DH7CrIOPn4DjqOBxFL3Js=
46+
tag: 97f3ca97bda997533d17274689daa69c5fdcbcd6
47+
--sha256: sha256-NKUrxa3f6tlywWNWwdw5bWQ974ziOG9MXmY9GNZTdu8=
48+
49+
-------- Begin contents from @atlas@'s @cabal.project@ file. --------
50+
51+
package cardano-crypto-praos
52+
flags: -external-libsodium-vrf
53+
54+
-- TODO: This is fixed for in their later version, omit this when we update to it.
55+
package strict-containers
56+
ghc-options: -Wwarn=noncanonical-monad-instances
7957

8058
source-repository-package
8159
type: git
82-
location: https://github.com/geniusyield/plutus-simple-model
83-
tag: 0cb63af903a835c73aec662092eb67d228bba9b0
84-
--sha256: sha256-H56EyRFNdDvLDo9FVeGZyQZ92itQPG39TkMVyEC/xqM=
85-
subdir:
86-
cardano-simple
87-
psm
60+
location: https://github.com/maestro-org/haskell-sdk
61+
tag: v1.7.2
62+
--sha256: sha256-nXnelHH4a+V0nguP8oUDlyEz/fLQ/i1fs/flyZTmvAc=
8863

89-
-- This should be present for in hackage index state >= 18th of september, 23. Remove it when we update to it.
9064
source-repository-package
9165
type: git
92-
location: https://github.com/blockfrost/blockfrost-haskell
93-
tag: 206e1a0f62e2a7cc08d05db8d62cef8dc2fbd98e
94-
--sha256: sha256-R6BP3hwrOBmlRabA3prUuOGkYzETmQIM+K+Oh+fczEY=
95-
subdir:
96-
blockfrost-api
97-
blockfrost-client-core
98-
blockfrost-client
66+
location: https://github.com/mlabs-haskell/clb
67+
tag: 18e781b5b53adc1aa1d8c057c1b606b536a80350
68+
--sha256: sha256-PDmrXYTBHPcY0x+JnF21uupLMBwURLSiNMqNmwwapkc=
9969

70+
constraints:
71+
, cardano-api ^>= 8.38.0.0
10072

10173
-- Everything below is essentially copied from cardano-wallet's cabal.project.
102-
-------- Begin contents from @cardano-wallet@'s @cabal.project@ file. --------
10374

10475
source-repository-package
10576
type: git
10677
location: https://github.com/input-output-hk/cardano-wallet
107-
tag: v2023-07-18
108-
--sha256: sha256-ijflgIw+1FpLoxM4Rksf4MJvNqnEPAv3gNWE8zMuefU=
78+
tag: v2024-03-27
79+
--sha256: sha256-rxMPopa3nxQaM0yOxUCq5oj3+XSL68jkuuFVhj/SY+w=
10980
subdir:
81+
lib/address-derivation-discovery
11082
lib/balance-tx/
11183
lib/coin-selection/
84+
lib/crypto-primitives/
11285
lib/delta-store/
11386
lib/delta-table
11487
lib/delta-types/
88+
lib/iohk-monitoring-extra
11589
lib/launcher/
90+
lib/network-layer/
11691
lib/numeric/
11792
lib/primitive/
93+
lib/read
94+
lib/secrets
95+
lib/std-gen-seed/
11896
lib/test-utils/
11997
lib/text-class/
12098
lib/wai-middleware-logging/
121-
lib/wallet/
12299
lib/wallet-benchmarks/
100+
lib/wallet/
123101

124-
-- Using RDRAND instead of /dev/urandom as an entropy source for key
125-
-- generation is dubious. Set the flag so we use /dev/urandom by default.
126-
package cryptonite
127-
flags: -support_rdrand
128-
129-
-- Using a fork until our patches can be merged upstream
102+
------ Begin contents from @cardano-wallet@'s @cabal.project@ file. --------
130103

131-
-- TODO: ADP-1713
132-
source-repository-package
133-
type: git
134-
location: https://github.com/paolino/openapi3
135-
tag: f22c31611c295637a3e72b341cd1c56d1d87b993
136-
--sha256: 10l7wlaz9rcr3fysi1vwg7qqa826bb7nidkpx9jy1q7ja7ddw47i
104+
--------------------------------------------------------------------------------
137105

138106
source-repository-package
139107
type: git
140-
location: https://github.com/input-output-hk/cardano-addresses
141-
tag: 6b55f96d57a181f898eb2a50531d3ae4280c549c
142-
--sha256: 0yygam995i3mawk6hfgxb6v918phvqzyipzhjflff0l6zfrldy7f
108+
location: https://github.com/IntersectMBO/cardano-addresses
109+
tag: 126964483d188c2362393d2a6eea8c65dfc43097
110+
--sha256: 1w152imj28ap5dfdc8x9ly0cy7dn500v7k63vw11f70gvgg6x7my
143111
subdir: command-line
144112
core
145113

114+
-- Normally cabal won't apply ghc-options which we specify to build packages
115+
-- to their "regular" dependencies.
116+
-- However, the dependencies declared using the `source-repository-package`
117+
-- pragma are an exception to this rule.
118+
-- This is why we need to manually control options that are applied to the
119+
-- `cardano-addresses` package by declaring them explicitly here.
120+
--
121+
-- Cardano Addresses CLI uses an outdated version of the `optparse-applicative`
122+
-- library. This causes a deprecation warning to be emitted when building.
123+
-- We don't want to promote this warning to an error level as it break the
124+
-- release build and cardano-addresses codebase is not under our control.
125+
package cardano-addresses-cli
126+
ghc-options:
127+
-Wwarn=deprecations
128+
146129
package cardano-addresses
147-
ghc-options: -Wno-incomplete-uni-patterns
130+
ghc-options:
131+
-Wwarn=incomplete-uni-patterns
132+
-- END Cardano Addresses Dependency
133+
--------------------------------------------------------------------------------
148134

149135
source-repository-package
150136
type: git
@@ -154,13 +140,13 @@ source-repository-package
154140

155141
source-repository-package
156142
type: git
157-
location: https://github.com/input-output-hk/bech32.git
158-
tag: e341e7f83d7b73f10baa87e946818b2c493cc5f5
159-
--sha256: 1d891bpc1q1m1gqj02b4iv3kr4g9w7knlkq43hwbl9dn5k78aydc
160-
subdir: bech32
143+
location: https://github.com/cardano-foundation/cardano-wallet-client.git
144+
tag: 353412ca621dc28af53e4a19795338b19bab1b7b
145+
--sha256: 04q58c82wy6x9nkwqbvcxbv6s61fx08h5kf62sb511aqp08id4bb
146+
subdir: generated
161147

162-
-- -------------------------------------------------------------------------
163-
-- Constraints tweaking
148+
--------------------------------------------------------------------------------
149+
-- BEGIN Constraints tweaking section
164150

165151
-- cardano-addresses unit tests bring in some version constraint conflicts.
166152
--
@@ -175,56 +161,31 @@ allow-newer:
175161
, ekg:*
176162
, ntp-client:*
177163
, libsystemd-journal:base
178-
, size-based:template-haskell
164+
, cardano-addresses-cli:mtl
165+
, servant-openapi3:*
179166

180-
constraints:
181-
bimap >= 0.4.0
182-
, openapi3 >= 3.2.0
183-
, libsystemd-journal >= 1.4.4
184-
, systemd >= 2.3.0
185-
-- dependency of systemd-2.3.0
186-
, network >= 3.1.1.1
187-
-- choose versions that work with base >= 4.12
188-
, hjsonpointer >= 1.5.0
189-
, hjsonschema >= 1.10.0
190-
, Cabal >= 3.4.0.0
191-
, async-timer >= 0.2.0.0
192-
, unliftio-core >= 0.2.0.1
193-
, generic-arbitrary >= 0.2.2
194-
, iohk-monitoring >= 0.1.11
195-
196-
-- lower versions of katip won't build with the Win32-2.12.0.1
197-
-- which is shipped with the ghc-9.2.8
198-
, katip >= 0.8.7.4
199-
200-
-- Cardano Node dependencies:
201-
, cardano-api ^>=8.2
202-
, cardano-slotting >= 0.1
203-
, ouroboros-network ^>= 0.8.1.0
204-
205-
-- TH Name shadowing warnings need to be addressed when bumping to 2.13.3.5
206-
, persistent == 2.13.3.3
207-
208-
-- Haddock is broken in this release. Waiting for the next release
209-
210-
-- ----------------------------------------------------------------
211-
-- Flags for dependencies
167+
-- END Constraints tweaking section
168+
--------------------------------------------------------------------------------
169+
170+
--------------------------------------------------------------------------------
171+
-- Flags for dependencies without an S-R-P pragma should be kept in this section
172+
-- (conversely, flags for the S-R-P dependencies should be kept within the
173+
-- same section where an S-R-P pragma is located,
174+
-- for them to be managed together)
175+
176+
-- Using RDRAND instead of /dev/urandom as an entropy source for key
177+
-- generation is dubious. Set the flag so we use /dev/urandom by default.
178+
package cryptonite
179+
flags: -support_rdrand
212180

213181
package cardano-config
214182
flags: -systemd
183+
215184
package cardano-node
216185
flags: -systemd
217186

218187
-- -------------------------------------------------------------------------
188+
219189
-------- End contents from @cardano-wallet@'s @cabal.project@ file. --------
220190

221-
constraints:
222-
-- We need turtle > 1.6 to support GHC 9.6. But that version now allows
223-
-- some broken situations: https://github.com/Gabriella439/turtle/pull/446#issuecomment-1637628373
224-
-- We are forced into an old version of ansi-wl-pprint because of inline-c (dep of inline-r), which
225-
-- doesn't support the new one.
226-
-- So for now we just force old versions of optparse-applicative and ansi-wl-pprint.
227-
-- This is fine for CHaP, since we don't publish plutus-metatheory and the flag for inline-r
228-
-- is off by default.
229-
optparse-applicative < 0.18
230-
, ansi-wl-pprint < 1.0
191+
-------- End contents from @atlas@'s @cabal.project@ file. --------

geniusyield-market-maker/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Revision history for geniusyield-market-maker
22

3+
## 0.7.0 -- 2024-08-30
4+
5+
* Updated Atlas & Maestro SDK version to not make use Maestro's recently deprecated protocol parameters & era summaries endpoint.
6+
37
## 0.6.1 -- 2024-07-04
48

59
* Bug fix to resolve the behavior of `buildGetQuota` where it would result in an arithmetic underflow for TapTools provider when precision of commodity token is greater than that of ADA.

geniusyield-market-maker/geniusyield-market-maker.cabal

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 3.4
22
name: geniusyield-market-maker
3-
version: 0.6.1
3+
version: 0.7.0
44
build-type: Simple
55
extra-doc-files: CHANGELOG.md
66
synopsis:
@@ -195,6 +195,7 @@ test-suite pproviders-status-sequence
195195
, geniusyield-market-maker:{datasource-providers, orderbook-annset, geniusyield-market-maker-lib}
196196
, geniusyield-orderbot-framework:common
197197
, ghc-typelits-knownnat
198+
, katip
198199
, maestro-sdk
199200
, servant-client-core
200201
, tasty

geniusyield-market-maker/src/GeniusYield/MarketMaker/Prices.hs

-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ import Servant.Client (ClientEnv)
6868
-- Configuration
6969
-------------------------------------------------------------------------------
7070

71-
-- TODO: https://github.com/geniusyield/market-maker/issues/86.
72-
deriving newtype instance (ToJSON a) => ToJSON (Confidential a)
73-
7471
-- | PriceConfigV1 is deprecated
7572
data PriceConfigV1 = PriceConfigV1
7673
{ pcApiKey !(Confidential Text),

geniusyield-market-maker/test/GeniusYield/Test/MarketMaker/Utils.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module GeniusYield.Test.MarketMaker.Utils where
22

3-
import Data.List (isInfixOf, findIndex)
43
import Control.Concurrent.MVar
54
import Control.Monad.State (StateT)
5+
import Data.List (findIndex, isInfixOf)
66
import GeniusYield.MarketMaker.Constants (logNS)
77
import GeniusYield.Types
88

@@ -104,13 +104,13 @@ arePredicatesOrdered ps xs = case midxs of
104104
Nothing -> (False, 0)
105105
Just idxs -> (isOrdered idxs, last idxs)
106106
where
107-
midxs = sequenceA $ flip findIndex xs <$> ps
107+
midxs = traverse (`findIndex` xs) ps
108108

109109
areEventsOrdered :: [[a -> Bool]] -> [a] -> Bool
110110
areEventsOrdered [] _ = True
111111
areEventsOrdered (ps:pss) xs =
112112
let (b, i) = arePredicatesOrdered ps xs
113-
in if b then areEventsOrdered pss (drop (i + 1) xs) else False
113+
in (b && areEventsOrdered pss (drop (i + 1) xs))
114114

115115
isPPStatus :: [Maybe Double] -> LogData -> Bool
116116
isPPStatus mbps ld = case ld of

0 commit comments

Comments
 (0)