Skip to content

Commit

Permalink
Merge pull request #77 from geniusyield/update-latest-atlas-28-june-24
Browse files Browse the repository at this point in the history
feat: update to latest Atlas commit (16 July 2024)
  • Loading branch information
brunjlar authored Jul 16, 2024
2 parents 4497d21 + 0863361 commit 9b1bae0
Show file tree
Hide file tree
Showing 21 changed files with 353 additions and 272 deletions.
25 changes: 24 additions & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Setup haskell tooling
uses: haskell-actions/setup@v2
with:
ghc-version: '9.2.8'
ghc-version: '9.6.5'
cabal-version: '3.10.1.0'
enable-stack: true
stack-version: '2.9'
Expand Down Expand Up @@ -91,6 +91,29 @@ jobs:
make
sudo make install
sudo ldconfig
- name: Install BLST
run: |
: ${BLST_VERSION:='v0.3.11'}
git clone --depth 1 --branch ${BLST_VERSION} https://github.com/supranational/blst
cd blst
./build.sh
cat > libblst.pc << EOF
prefix=/usr/local
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libblst
Description: Multilingual BLS12-381 signature library
URL: https://github.com/supranational/blst
Version: ${BLST_VERSION#v}
Cflags: -I\${includedir}
Libs: -L\${libdir} -lblst
EOF
sudo cp libblst.pc /usr/local/lib/pkgconfig/
sudo cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/
sudo cp libblst.a /usr/local/lib
sudo chmod u=rw,go=r /usr/local/{lib/{libblst.a,pkgconfig/libblst.pc},include/{blst.{h,hpp},blst_aux.h}}
- name: Update dependencies (cabal)
run: cabal update
- name: Install fourmolu
Expand Down
17 changes: 16 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ RUN git clone https://github.com/bitcoin-core/secp256k1 && \
make && \
make install

ARG BLST_VERSION=v0.3.11
ENV BLST_VERSION=${BLST_VERSION}
RUN git clone --depth 1 --branch ${BLST_VERSION} https://github.com/supranational/blst && \
cd blst && \
./build.sh && \
printf 'prefix=/usr/local\nexec_prefix=${prefix}\nlibdir=${exec_prefix}/lib\nincludedir=${prefix}/include\nName: libblst\nDescription: Multilingual BLS12-381 signature library\nURL: https://github.com/supranational/blst\nVersion: '${BLST_VERSION#v}'\nCflags: -I${includedir}\nLibs: -L${libdir} -lblst\n' > libblst.pc && \
cp libblst.pc /usr/local/lib/pkgconfig/ && \
cp bindings/blst_aux.h bindings/blst.h bindings/blst.hpp /usr/local/include/ && \
cp libblst.a /usr/local/lib && \
chmod 644 /usr/local/lib/libblst.a && \
chmod 644 /usr/local/lib/pkgconfig/libblst.pc && \
chmod 644 /usr/local/include/blst.h && \
chmod 644 /usr/local/include/blst.hpp && \
chmod 644 /usr/local/include/blst_aux.h

ENV LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

Expand All @@ -65,7 +80,7 @@ RUN gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 7D1E8AFD1D4A16D71FA

# ghcup:
ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1
ENV BOOTSTRAP_HASKELL_GHC_VERSION=9.2.8
ENV BOOTSTRAP_HASKELL_GHC_VERSION=9.6.5
ENV BOOTSTRAP_HASKELL_CABAL_VERSION=3.10.2.0
RUN bash -c "curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh"
ENV PATH=${PATH}:/root/.local/bin
Expand Down
191 changes: 91 additions & 100 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ repository cardano-haskell-packages
d4a35cd3121aa00d18544bb0ac01c3e1691d618f462c46129271bccf39f7e8ee

-- repeating the index-state for hackage to work around hackage.nix parsing limitation
index-state: 2023-06-06T00:00:00Z
index-state: 2024-06-15T17:35:54Z

index-state:
, hackage.haskell.org 2023-06-06T00:00:00Z
, cardano-haskell-packages 2023-06-05T06:39:32Z
, hackage.haskell.org 2024-06-15T17:35:54Z
, cardano-haskell-packages 2024-06-13T23:12:13Z

packages:
geniusyield-dex-api
Expand All @@ -25,108 +25,113 @@ packages:
-- TODO: Default value should be @direct@ in upcoming 3.10 version of cabal, omit this line then.
test-show-details: direct

source-repository-package
type: git
location: https://github.com/geniusyield/ply
tag: b13674633771f572a5eedfb47276c0ac3993ab85
--sha256: sha256-a63OdFAbo0sWOXxceI2bW/ZMrS8wo1t7aPFrfXvVhvE=
subdir: ply-core

source-repository-package
type: git
location: https://github.com/geniusyield/atlas
tag: 0066924f0f93be16f3d5de32d94d53cde9eeb0f9
--sha256: sha256-G8+Kdm6qwWvp7BSPnPffHVEkcHt7COpXRWRqgofQj74=

-------- Begin contents from @atlas@'s @cabal.project@ file. --------

package cardano-crypto-praos
flags: -external-libsodium-vrf

-- TODO: This is fixed for in their later version, omit this when we update to it.
package strict-containers
ghc-options: -Wwarn=noncanonical-monad-instances

source-repository-package
type: git
location: https://github.com/geniusyield/atlas
tag: 7532a439525db20346f4b205fea49f970efe0a98
--sha256: sha256-UyLTCsbZVShxdhAu6fjBrILnyka3vOgBiOeNwW36xkk=

source-repository-package
type: git
location: https://github.com/geniusyield/ply
tag: c301d9514982abce1b4497237ba8231cf3ca058d
--sha256: sha256-f3hhzeOpva64FfF4HZc3uoPcWbhEJN20b0RrEKfXBxc=
subdir: ply-core

source-repository-package
type: git
location: https://github.com/maestro-org/haskell-sdk
tag: 609515b3f8861efaa17adf4e599aa1b845775a6d
tag: d70479ce3be06d6b7c52bf39d783f36d6771e36d
--sha256: sha256-8se+xlIB1BDEuKGwjaldmW5G4LpCujD1ABgBaY0cY6Y=

-- 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.
-- This is done in accordance with changes in https://github.com/input-output-hk/cardano-ledger/pull/3430/files.
constraints:
plutus-ledger-api == 1.6.0.0
, plutus-core == 1.6.0.0

allow-newer:
, cardano-ledger-alonzo:plutus-ledger-api
, cardano-ledger-alonzo:plutus-core
, cardano-ledger-alonzo-test:plutus-ledger-api
, cardano-ledger-alonzo-test:plutus-ledger-api-testlib
, cardano-ledger-babbage:plutus-ledger-api
, cardano-ledger-conway:plutus-ledger-api
, cardano-ledger-binary:plutus-ledger-api
, cardano-api:plutus-ledger-api
, cardano-api:plutus-ledger-api-testlib
, cardano-api:prettyprinter-configurable

source-repository-package
type: git
location: https://github.com/geniusyield/plutus-simple-model
tag: 0cb63af903a835c73aec662092eb67d228bba9b0
--sha256: sha256-H56EyRFNdDvLDo9FVeGZyQZ92itQPG39TkMVyEC/xqM=
subdir:
cardano-simple
psm
location: https://github.com/mlabs-haskell/clb
tag: 18e781b5b53adc1aa1d8c057c1b606b536a80350
--sha256: sha256-PDmrXYTBHPcY0x+JnF21uupLMBwURLSiNMqNmwwapkc=

-- This should be present for in hackage index state >= 18th of september, 23. Remove it when we update to it.
-- Obtaining cardano-node stuff for 8.9.*. These aren't published on CHaP yet.
source-repository-package
type: git
location: https://github.com/blockfrost/blockfrost-haskell
tag: 206e1a0f62e2a7cc08d05db8d62cef8dc2fbd98e
--sha256: sha256-R6BP3hwrOBmlRabA3prUuOGkYzETmQIM+K+Oh+fczEY=
location: https://github.com/IntersectMBO/cardano-node
tag: 8.9.2
--sha256: sha256-PxMlVzTLMuVeu04QcGOxjaSMnpWJG78J0Rul3423too=
subdir:
blockfrost-api
blockfrost-client-core
blockfrost-client
cardano-node
cardano-testnet
cardano-git-rev
trace-dispatcher

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

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-wallet
tag: v2023-07-18
--sha256: sha256-ijflgIw+1FpLoxM4Rksf4MJvNqnEPAv3gNWE8zMuefU=
tag: v2024-03-27
--sha256: sha256-rxMPopa3nxQaM0yOxUCq5oj3+XSL68jkuuFVhj/SY+w=
subdir:
lib/address-derivation-discovery
lib/balance-tx/
lib/coin-selection/
lib/crypto-primitives/
lib/delta-store/
lib/delta-table
lib/delta-types/
lib/iohk-monitoring-extra
lib/launcher/
lib/network-layer/
lib/numeric/
lib/primitive/
lib/read
lib/secrets
lib/std-gen-seed/
lib/test-utils/
lib/text-class/
lib/wai-middleware-logging/
lib/wallet/
lib/wallet-benchmarks/
lib/wallet/

-- Using RDRAND instead of /dev/urandom as an entropy source for key
-- generation is dubious. Set the flag so we use /dev/urandom by default.
package cryptonite
flags: -support_rdrand
------ Begin contents from @cardano-wallet@'s @cabal.project@ file. --------

--------------------------------------------------------------------------------

source-repository-package
type: git
location: https://github.com/input-output-hk/cardano-addresses
tag: 6b55f96d57a181f898eb2a50531d3ae4280c549c
--sha256: 0yygam995i3mawk6hfgxb6v918phvqzyipzhjflff0l6zfrldy7f
location: https://github.com/IntersectMBO/cardano-addresses
tag: 126964483d188c2362393d2a6eea8c65dfc43097
--sha256: 1w152imj28ap5dfdc8x9ly0cy7dn500v7k63vw11f70gvgg6x7my
subdir: command-line
core

-- Normally cabal won't apply ghc-options which we specify to build packages
-- to their "regular" dependencies.
-- However, the dependencies declared using the `source-repository-package`
-- pragma are an exception to this rule.
-- This is why we need to manually control options that are applied to the
-- `cardano-addresses` package by declaring them explicitly here.
--
-- Cardano Addresses CLI uses an outdated version of the `optparse-applicative`
-- library. This causes a deprecation warning to be emitted when building.
-- We don't want to promote this warning to an error level as it break the
-- release build and cardano-addresses codebase is not under our control.
package cardano-addresses-cli
ghc-options:
-Wwarn=deprecations

package cardano-addresses
ghc-options: -Wno-incomplete-uni-patterns
ghc-options:
-Wwarn=incomplete-uni-patterns
-- END Cardano Addresses Dependency
--------------------------------------------------------------------------------

source-repository-package
type: git
Expand All @@ -136,13 +141,13 @@ source-repository-package

source-repository-package
type: git
location: https://github.com/input-output-hk/bech32.git
tag: e341e7f83d7b73f10baa87e946818b2c493cc5f5
--sha256: 1d891bpc1q1m1gqj02b4iv3kr4g9w7knlkq43hwbl9dn5k78aydc
subdir: bech32
location: https://github.com/cardano-foundation/cardano-wallet-client.git
tag: 353412ca621dc28af53e4a19795338b19bab1b7b
--sha256: 04q58c82wy6x9nkwqbvcxbv6s61fx08h5kf62sb511aqp08id4bb
subdir: generated

-- -------------------------------------------------------------------------
-- Constraints tweaking
--------------------------------------------------------------------------------
-- BEGIN Constraints tweaking section

-- cardano-addresses unit tests bring in some version constraint conflicts.
--
Expand All @@ -157,45 +162,31 @@ allow-newer:
, ekg:*
, ntp-client:*
, libsystemd-journal:base
, size-based:template-haskell

constraints:
bimap >= 0.4.0
, openapi3 >= 3.2.0
, libsystemd-journal >= 1.4.4
, systemd >= 2.3.0
-- dependency of systemd-2.3.0
, network >= 3.1.1.1
-- choose versions that work with base >= 4.12
, hjsonpointer >= 1.5.0
, hjsonschema >= 1.10.0
, Cabal >= 3.4.0.0
, async-timer >= 0.2.0.0
, unliftio-core >= 0.2.0.1
, generic-arbitrary >= 0.2.2
, iohk-monitoring >= 0.1.11

-- lower versions of katip won't build with the Win32-2.12.0.1
-- which is shipped with the ghc-9.2.8
, katip >= 0.8.7.4

-- Cardano Node dependencies:
, cardano-api ^>=8.2
, cardano-slotting >= 0.1
, ouroboros-network ^>= 0.8.1.0

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

-- Haddock is broken in this release. Waiting for the next release

-- ----------------------------------------------------------------
-- Flags for dependencies
, cardano-addresses-cli:mtl
, servant-openapi3:*

-- END Constraints tweaking section
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
-- Flags for dependencies without an S-R-P pragma should be kept in this section
-- (conversely, flags for the S-R-P dependencies should be kept within the
-- same section where an S-R-P pragma is located,
-- for them to be managed together)

-- Using RDRAND instead of /dev/urandom as an entropy source for key
-- generation is dubious. Set the flag so we use /dev/urandom by default.
package cryptonite
flags: -support_rdrand

package cardano-config
flags: -systemd

package cardano-node
flags: -systemd

-- -------------------------------------------------------------------------

-------- End contents from @cardano-wallet@'s @cabal.project@ file. --------

-------- End contents from @atlas@'s @cabal.project@ file. --------
4 changes: 2 additions & 2 deletions geniusyield-dex-api/geniusyield-dex-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extra-doc-files:
CHANGELOG.md
README.md

tested-with: GHC ==9.2.8
tested-with: GHC ==9.6.5

source-repository head
type: git
Expand Down Expand Up @@ -71,7 +71,7 @@ library

build-depends:
, aeson
, base ^>=4.16.4.0
, base ^>=4.18.2.0
, containers
, data-default
, http-types
Expand Down
6 changes: 3 additions & 3 deletions geniusyield-dex-api/src/GeniusYield/Api/Dex/PartialOrder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ getPartialOrderVersion' ∷ GYDexApiQueryMonad m a ⇒ (Maybe GYPaymentCredentia
getPartialOrderVersion' (p1 :!: p1_1) (addr :!: oref) = do
let pc = addressToPaymentCredential addr
if
| p1 == pc pure POCVersion1
| p1_1 == pc pure POCVersion1_1
| otherwise throwAppError $ PodOrderDoesntBelongToScript oref
| p1 == pc pure POCVersion1
| p1_1 == pc pure POCVersion1_1
| otherwise throwAppError $ PodOrderDoesntBelongToScript oref

getPartialOrderInfo
GYDexApiQueryMonad m a
Expand Down
6 changes: 4 additions & 2 deletions geniusyield-dex-api/src/GeniusYield/Scripts/Dex/Version.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ instance Swagger.ToSchema POCVersion where
pure $
Swagger.named "POCVersion" $
Swagger.paramSchemaToSchema p
& Swagger.example ?~ Aeson.toJSON POCVersion1
& Swagger.description ?~ "Version of the family of partial order contracts"
& Swagger.example
?~ Aeson.toJSON POCVersion1
& Swagger.description
?~ "Version of the family of partial order contracts"

data SingPOCVersion (v POCVersion) where
SingPOCVersion1 SingPOCVersion 'POCVersion1
Expand Down
Loading

0 comments on commit 9b1bae0

Please sign in to comment.