diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 44d09728..6b972be8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: ['9.2.8'] + ghc: ['9.6.3'] cabal: ['3.10'] os: ['ubuntu-20.04', 'ubuntu-22.04', 'macOS-latest'] @@ -41,6 +41,15 @@ jobs: dist-newstyle key: ${{ matrix.os }}-${{ matrix.ghc }}-4-cabal + # System dependencies + - name: Install liblzma + run: brew install xz # xz package contains liblzma + if: startsWith(matrix.os, 'macOS') + + - name: Install postgresql + run: brew install postgresql # needed by libpq + if: startsWith(matrix.os, 'macOS') + # Build - name: Update package database run: cabal update diff --git a/cabal.project b/cabal.project index c49cfa34..9837bce0 100644 --- a/cabal.project +++ b/cabal.project @@ -1,17 +1,6 @@ packages: haskell-src/chainweb-data.cabal -with-compiler: ghc-9.2.8 - -package aeson - flags: +cffi - -package rocksdb-haskell-kadena - ghc-options: -Wwarn -optc-w -optcxx-w - -source-repository-package - type: git - location: https://github.com/kadena-io/pact.git - tag: e5c922664fb4df53e3b8e2c48618d71b3ef612ad - --sha256: sha256-t1p+Zd5I/mW2Aggi4xMRl0wj6k3ztsgzydvNkBachFA= +with-compiler: ghc-9.6.3 +index-state: 2024-02-01T00:00:00Z source-repository-package type: git @@ -19,38 +8,18 @@ source-repository-package tag: fc84dcef8197bcfb5415c855421bb1921a749c9f --sha256: sha256-2qpkAlpJ9qtfsD1WHuW5IYXWHoVXBxRYs5Pd9GOOXz8= -source-repository-package - type: git - location: https://github.com/kadena-io/pact-json - tag: e43073d0b8d89d9b300980913b842f4be339846d - --sha256: sha256-ZWbAId0JBaxDsYhwcYUyw04sjYstXyosSCenzOvUxsQ= - -source-repository-package - type: git - location: https://github.com/kadena-io/thyme.git - tag: 6ee9fcb026ebdb49b810802a981d166680d867c9 - --sha256: sha256-DqGIoPGBg8py044Xa7l/Y09K+cKGFwlxONHoZRJyzCU= - package vault documentation: false write-ghc-environment-files: never -package pact - ghc-options: -Wwarn - optimization: True - flags: -build-tool - -constraints: sbv <10 constraints: http2 <4.2 +constraints: configuration-tools >= 0.7.0 +allow-newer: beam-migrate:pqueue +allow-newer: beam-migrate:aeson +allow-newer: beam-core:aeson allow-newer: streaming-events:* allow-newer: postgresql-simple-migration:* allow-newer: beam-postgres:* --- allow-newer: *:aeson allow-newer: *:vector - -allow-older: pact:base -allow-older: pact:mtl -allow-older: pact:text -allow-older: pact-json:text diff --git a/cabal.project.freeze b/cabal.project.freeze deleted file mode 100644 index 73401577..00000000 --- a/cabal.project.freeze +++ /dev/null @@ -1,437 +0,0 @@ -active-repositories: hackage.haskell.org:merge -constraints: any.Boolean ==0.2.4, - any.Cabal ==3.6.3.0, - any.Decimal ==0.5.2, - any.Glob ==0.10.2, - any.HUnit ==1.6.2.0, - any.MemoTrie ==0.6.11, - MemoTrie -examples, - any.NumInstances ==1.4, - any.OneTuple ==0.4.1.1, - any.Only ==0.1, - any.QuickCheck ==2.14.3, - QuickCheck -old-random +templatehaskell, - any.StateVar ==1.2.2, - any.adjunctions ==4.4.2, - any.aeson ==2.1.2.1, - aeson +cffi +ordered-keymap, - any.aeson-pretty ==0.8.10, - aeson-pretty -lib-only, - any.ansi-terminal ==1.0, - ansi-terminal -example, - any.ansi-terminal-types ==0.11.5, - any.ansi-wl-pprint ==0.6.9, - ansi-wl-pprint -example, - any.appar ==0.1.8, - any.array ==0.5.4.0, - any.asn1-encoding ==0.9.6, - any.asn1-parse ==0.9.5, - any.asn1-types ==0.3.4, - any.assoc ==1.1, - assoc +tagged, - any.async ==2.2.5, - async -bench, - any.atomic-primops ==0.8.4, - atomic-primops -debug, - any.attoparsec ==0.14.4, - attoparsec -developer, - any.attoparsec-aeson ==2.1.0.0, - any.auto-update ==0.1.6, - any.base ==4.16.4.0, - any.base-compat ==0.13.1, - any.base-compat-batteries ==0.13.1, - any.base-orphans ==0.9.1, - any.base-prelude ==1.6.1.1, - any.base-unicode-symbols ==0.2.4.2, - base-unicode-symbols +base-4-8 -old-base, - any.base16-bytestring ==1.0.2.0, - any.base64-bytestring ==1.2.1.0, - any.basement ==0.0.16, - any.beam-automigrate ==0.1.4.0, - beam-automigrate -ghcipretty -werror, - any.beam-core ==0.10.1.0, - beam-core -werror, - any.beam-migrate ==0.5.2.1, - beam-migrate -werror, - any.beam-postgres ==0.5.3.1, - beam-postgres -werror, - any.bifunctors ==5.6.1, - bifunctors +tagged, - any.binary ==0.8.9.0, - any.binary-orphans ==1.0.4.1, - any.bitvec ==1.1.5.0, - bitvec +simd, - any.blake2 ==0.3.0.1, - blake2 +hlint -llvm -support_blake2_sse, - any.blaze-builder ==0.4.2.3, - any.blaze-html ==0.9.1.2, - any.blaze-markup ==0.8.3.0, - any.boring ==0.2.1, - boring +tagged, - any.bound ==2.0.7, - bound +template-haskell, - any.bsb-http-chunked ==0.0.0.4, - any.byteable ==0.1.1, - any.byteorder ==1.0.4, - any.bytes ==0.17.3, - any.bytestring ==0.11.4.0, - any.bytestring-builder ==0.10.8.2.0, - bytestring-builder +bytestring_has_builder, - any.cabal-doctest ==1.0.9, - any.cache ==0.1.3.0, - any.call-stack ==0.4.0, - any.case-insensitive ==1.2.1.0, - any.cassava ==0.5.3.0, - cassava -bytestring--lt-0_10_4, - any.cborg ==0.2.10.0, - cborg +optimize-gmp, - any.cereal ==0.5.8.3, - cereal -bytestring-builder, - any.chainweb-api ==1.2.1, - chainweb-data -ghc-flags +threaded, - any.charset ==0.3.10, - any.clock ==0.8.4, - clock -llvm, - any.cmdargs ==0.10.22, - cmdargs +quotation -testprog, - any.code-page ==0.2.1, - any.colour ==2.3.6, - any.comonad ==5.0.8, - comonad +containers +distributive +indexed-traversable, - any.conduit ==1.3.5, - any.configuration-tools ==0.6.1, - configuration-tools -remote-configs, - any.connection ==0.3.1, - any.constraints ==0.14, - any.constraints-extras ==0.4.0.0, - constraints-extras +build-readme, - any.containers ==0.6.5.1, - any.contravariant ==1.5.5, - contravariant +semigroups +statevar +tagged, - any.cookie ==0.4.6, - any.criterion ==1.6.1.0, - criterion -embed-data-files -fast, - any.criterion-measurement ==0.2.1.0, - criterion-measurement -fast, - any.cryptohash ==0.11.9, - any.cryptohash-md5 ==0.11.101.0, - any.cryptohash-sha1 ==0.11.101.0, - any.crypton ==0.34, - crypton -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq +support_pclmuldq +support_rdrand -support_sse +use_target_attributes, - any.cryptonite ==0.30, - cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes, - any.data-array-byte ==0.1.0.1, - any.data-default ==0.7.1.1, - any.data-default-class ==0.1.2.0, - any.data-default-instances-containers ==0.0.1, - any.data-default-instances-dlist ==0.0.1, - any.data-default-instances-old-locale ==0.0.1, - any.data-fix ==0.3.2, - any.dec ==0.0.5, - any.deepseq ==1.4.6.1, - any.deferred-folds ==0.9.18.5, - any.dense-linear-algebra ==0.1.0.0, - any.dependent-map ==0.4.0.0, - any.dependent-sum ==0.7.2.0, - any.deriving-compat ==0.6.5, - deriving-compat +base-4-9 +new-functor-classes +template-haskell-2-11, - any.direct-sqlite ==2.3.28, - direct-sqlite +fulltextsearch +haveusleep +json1 -systemlib +urifilenames, - any.directory ==1.3.6.2, - any.distributive ==0.6.2.1, - distributive +semigroups +tagged, - any.dlist ==1.0, - dlist -werror, - any.easy-file ==0.2.5, - any.enclosed-exceptions ==1.0.3, - any.entropy ==0.4.1.10, - entropy -donotgetentropy, - any.errors ==2.3.0, - any.exceptions ==0.10.4, - any.fast-logger ==3.2.2, - any.file-embed ==0.0.15.0, - any.file-embed-lzma ==0.0.1, - any.filelock ==0.1.1.7, - any.filepath ==1.4.2.2, - any.fingertree ==0.1.5.0, - any.finite-typelits ==0.1.6.0, - any.foldable1-classes-compat ==0.1, - foldable1-classes-compat +tagged, - any.foldl ==1.4.15, - any.free ==5.2, - any.gargoyle ==0.1.1.1, - any.gargoyle-postgresql ==0.2.0.2, - gargoyle-postgresql -enable-psql-test, - any.gargoyle-postgresql-connect ==0.1.0.1, - any.gargoyle-postgresql-nix ==0.3.0.1, - any.generically ==0.1.1, - any.generics-sop ==0.5.1.3, - any.ghc-bignum >=1.2, - any.ghc-boot-th ==9.2.8, - any.ghc-prim ==0.8.0, - any.groups ==0.5.3, - any.half ==0.3.1, - any.happy ==1.20.1.1, - any.hashable ==1.4.3.0, - hashable +integer-gmp -random-initial-seed, - any.haskell-lexer ==1.1.1, - any.haskell-src-exts ==1.23.1, - any.headed-megaparsec ==0.2.1.2, - any.hourglass ==0.2.12, - any.hsc2hs ==0.68.10, - hsc2hs -in-ghc-tree, - any.hspec ==2.11.7, - any.hspec-core ==2.11.7, - any.hspec-discover ==2.11.7, - any.hspec-expectations ==0.8.4, - any.http-api-data ==0.6, - http-api-data -use-text-show, - any.http-client ==0.7.15, - http-client +network-uri, - any.http-client-tls ==0.3.6.1, - any.http-date ==0.0.11, - any.http-media ==0.8.1.1, - any.http-types ==0.12.4, - any.http2 ==4.1.4, - http2 -devel -h2spec, - any.indexed-list-literals ==0.2.1.3, - any.indexed-profunctors ==0.1.1.1, - any.indexed-traversable ==0.1.3, - any.indexed-traversable-instances ==0.1.1.2, - any.insert-ordered-containers ==0.2.5.3, - any.integer-conversion ==0.1.0.1, - any.integer-gmp ==1.1, - any.integer-logarithms ==1.0.3.1, - integer-logarithms -check-bounds +integer-gmp, - any.invariant ==0.6.2, - any.iproute ==1.7.12, - any.isomorphism-class ==0.1.0.12, - any.js-chart ==2.9.4.1, - any.kan-extensions ==5.2.5, - any.lens ==5.2.3, - lens -benchmark-uniplate -dump-splices +inlining -j +test-hunit +test-properties +test-templates +trustworthy, - any.lens-aeson ==1.2.3, - any.libyaml ==0.1.2, - libyaml -no-unicode -system-libyaml, - any.lifted-async ==0.10.2.5, - any.lifted-base ==0.2.3.12, - any.lzma ==0.0.1.0, - lzma +pkgconfig, - any.managed ==1.0.10, - any.math-functions ==0.3.4.3, - math-functions +system-erf +system-expm1, - any.megaparsec ==9.6.1, - megaparsec -dev, - any.memory ==0.18.0, - memory +support_bytestring +support_deepseq, - any.microlens ==0.4.13.1, - any.microstache ==1.0.2.3, - any.mime-types ==0.1.2.0, - any.mmorph ==1.2.0, - any.mod ==0.2.0.1, - mod +semirings +vector, - any.monad-control ==1.0.3.1, - any.mono-traversable ==1.0.15.3, - any.mtl ==2.2.2, - any.mtl-compat ==0.2.2, - mtl-compat -two-point-one -two-point-two, - any.mwc-random ==0.15.0.2, - any.neat-interpolation ==0.5.1.4, - any.network ==3.1.4.0, - network -devel, - any.network-byte-order ==0.1.7, - any.network-info ==0.2.1, - any.network-uri ==2.6.4.2, - any.newtype-generics ==0.6.2, - any.old-locale ==1.0.0.7, - any.old-time ==1.1.0.3, - any.openapi3 ==3.2.4, - any.optics-core ==0.4.1.1, - optics-core -explicit-generic-labels, - any.optics-extra ==0.4.2.1, - any.optics-th ==0.4.1, - any.optparse-applicative ==0.16.1.0, - optparse-applicative +process, - any.pact ==4.10, - pact -build-tool +cryptonite-ed25519 -tests-in-lib, - any.pact-json ==0.1.0.0, - any.pact-time ==0.2.0.2, - pact-time -with-time, - any.parallel ==3.2.2.0, - any.parsec ==3.1.15.0, - any.parser-combinators ==1.3.0, - parser-combinators -dev, - any.parsers ==0.12.11, - parsers +attoparsec +binary +parsec, - any.pem ==0.2.4, - any.poly ==0.5.1.0, - poly +sparse, - any.posix-escape ==0.1, - any.postgresql-libpq ==0.9.5.0, - postgresql-libpq -use-pkg-config, - any.postgresql-simple ==0.6.5.1, - any.postgresql-simple-migration ==0.1.15.0, - any.postgresql-syntax ==0.4.1, - any.pqueue ==1.4.3.0, - any.pretty ==1.1.3.6, - any.pretty-simple ==4.1.2.0, - pretty-simple -buildexample +buildexe, - any.prettyprinter ==1.7.1, - prettyprinter -buildreadme +text, - any.prettyprinter-ansi-terminal ==1.1.3, - any.primitive ==0.8.0.0, - any.process ==1.6.16.0, - any.profunctors ==5.6.2, - any.psqueues ==0.2.8.0, - any.pvar ==1.0.0.0, - any.quickcheck-instances ==0.3.30, - quickcheck-instances -bytestring-builder, - any.quickcheck-io ==0.2.0, - any.random ==1.2.1.1, - any.readable ==0.3.1, - any.recv ==0.1.0, - any.reducers ==3.12.4, - any.reflection ==2.1.7, - reflection -slow +template-haskell, - any.resource-pool ==0.4.0.0, - any.resourcet ==1.3.0, - any.retry ==0.9.3.1, - retry -lib-werror, - any.rts ==1.0.2, - any.safe ==0.3.19, - any.safe-exceptions ==0.1.7.4, - any.scheduler ==2.0.0.1, - any.scientific ==0.3.7.0, - scientific -bytestring-builder -integer-simple, - any.selective ==0.7, - any.semialign ==1.3, - semialign +semigroupoids, - any.semigroupoids ==6.0.0.1, - semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers, - any.semigroups ==0.20, - semigroups +binary +bytestring -bytestring-builder +containers +deepseq +hashable +tagged +template-haskell +text +transformers +unordered-containers, - any.semirings ==0.6, - semirings +containers +unordered-containers, - any.serialise ==0.2.6.1, - serialise +newtime15, - any.servant ==0.20.1, - any.servant-blaze ==0.9.1, - any.servant-client ==0.20, - any.servant-client-core ==0.20, - any.servant-openapi3 ==2.0.1.6, - any.servant-server ==0.20, - any.servant-swagger-ui ==0.3.5.5.0.0, - any.servant-swagger-ui-core ==0.3.5, - any.shelly ==1.9.0, - shelly -build-examples -lifted, - any.simple-sendfile ==0.2.32, - simple-sendfile +allow-bsd -fallback, - any.singleton-bool ==0.1.7, - any.socks ==0.6.1, - any.some ==1.0.6, - some +newtype-unsafe, - any.sop-core ==0.5.0.2, - any.split ==0.2.4, - any.splitmix ==0.1.0.5, - splitmix -optimised-mixer, - any.statistics ==0.16.2.1, - any.stm ==2.5.0.2, - any.stm-chans ==3.0.0.9, - any.streaming ==0.2.4.0, - any.streaming-attoparsec ==1.0.0.1, - any.streaming-bytestring ==0.3.2, - any.streaming-commons ==0.2.2.6, - streaming-commons -use-bytestring-builder, - any.streaming-events ==1.0.1, - any.strict ==0.5, - any.strict-tuple ==0.1.5.3, - any.string-conv ==0.2.0, - string-conv -lib-werror, - any.string-conversions ==0.4.0.1, - any.stringsearch ==0.3.6.6, - stringsearch -base3 +base4, - any.syb ==0.7.2.4, - any.tagged ==0.8.8, - tagged +deepseq +transformers, - any.tasty ==1.5, - tasty +unix, - any.tasty-hunit ==0.10.1, - any.tasty-quickcheck ==0.10.3, - any.template-haskell ==2.18.0.0, - any.text ==1.2.5.0, - any.text-builder ==0.6.7, - any.text-builder-dev ==0.3.3.2, - any.text-iso8601 ==0.1, - any.text-short ==0.1.5, - text-short -asserts, - any.tf-random ==0.5, - any.th-abstraction ==0.5.0.0, - any.th-compat ==0.1.4, - any.these ==1.2, - any.thyme ==0.3.6.0, - thyme +bug-for-bug -ghcjs -hlint -lens -show-internal -werror, - any.time ==1.11.1.1, - any.time-compat ==1.9.6.1, - time-compat -old-locale, - any.time-manager ==0.0.1, - any.tls ==1.6.0, - tls +compat -hans +network, - any.tls-session-manager ==0.0.4, - any.token-bucket ==0.1.0.1, - token-bucket +use-cbits, - any.transformers ==0.5.6.2, - any.transformers-base ==0.4.6, - transformers-base +orphaninstances, - any.transformers-compat ==0.7.2, - transformers-compat -five +five-three -four +generic-deriving +mtl -three -two, - any.trifecta ==2.1.3, - any.type-equality ==1, - any.unix ==2.7.2.2, - any.unix-compat ==0.5.4, - unix-compat -old-time, - any.unix-time ==0.4.11, - any.unliftio ==0.2.25.0, - any.unliftio-core ==0.2.1.0, - any.unordered-containers ==0.2.19.1, - unordered-containers -debug, - any.utf8-string ==1.0.2, - any.uuid ==1.3.15, - any.uuid-types ==1.0.5.1, - any.vault ==0.3.1.5, - vault +useghc, - any.vector ==0.13.1.0, - vector +boundschecks -internalchecks -unsafechecks -wall, - any.vector-algorithms ==0.9.0.1, - vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks, - any.vector-binary-instances ==0.2.5.2, - any.vector-sized ==1.5.0, - any.vector-space ==0.16, - any.vector-stream ==0.1.0.0, - any.vector-th-unbox ==0.2.2, - any.void ==0.7.3, - void -safe, - any.wai ==3.2.3, - any.wai-app-static ==3.1.8, - wai-app-static +crypton -print, - any.wai-cors ==0.2.7, - any.wai-extra ==3.1.13.0, - wai-extra -build-example, - any.wai-logger ==2.4.0, - any.wai-middleware-throttle ==0.3.0.1, - any.warp ==3.3.25, - warp +allow-sendfilefd -network-bytestring -warp-debug +x509, - any.warp-tls ==3.3.6, - any.which ==0.2.0.1, - any.witherable ==0.4.2, - any.word8 ==0.1.3, - any.x509 ==1.7.7, - any.x509-store ==1.6.9, - any.x509-system ==1.6.7, - any.x509-validation ==1.6.12, - any.yaml ==0.11.11.2, - yaml +no-examples +no-exe, - any.yet-another-logger ==0.4.2, - yet-another-logger -tbmqueue, - any.zlib ==0.6.3.0, - zlib -bundled-c-zlib -non-blocking-ffi -pkg-config -index-state: hackage.haskell.org 2023-12-05T08:50:28Z diff --git a/default.nix b/default.nix index f6393144..f390bd2d 100644 --- a/default.nix +++ b/default.nix @@ -31,8 +31,7 @@ let profilingModule = { }; project = pkgs.haskell-nix.cabalProject' { src = ./.; - compiler-nix-name = "ghc928"; - cabalProjectFreeze = null; + compiler-nix-name = "ghc963"; shell.tools = { cabal = {}; }; diff --git a/flake.lock b/flake.lock index 4b7fd5ee..03ca6d42 100644 --- a/flake.lock +++ b/flake.lock @@ -69,11 +69,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1696379114, - "narHash": "sha256-dtax/ci3JfYvR2lLsvpvC6b3NCoEGZLrDH21/2svTps=", + "lastModified": 1707870123, + "narHash": "sha256-pOvz6uuPYw3CiPgi63QhNYumoKeyzDh9JOkLDngGWsE=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "21eae6f46c91831741496101e541e628aadecd98", + "rev": "75345eba5d4159e6f54cbdc38785d1e0d0e655e0", "type": "github" }, "original": { @@ -109,7 +109,7 @@ "hs-nix-infra", "empty" ], - "ghc980": [ + "ghc98X": [ "hs-nix-infra", "empty" ], @@ -133,7 +133,19 @@ "hs-nix-infra", "empty" ], - "hls-2.3": "hls-2.3", + "hls-2.3": [ + "hs-nix-infra", + "empty" + ], + "hls-2.4": [ + "hs-nix-infra", + "empty" + ], + "hls-2.5": [ + "hs-nix-infra", + "empty" + ], + "hls-2.6": "hls-2.6", "hpc-coveralls": [ "hs-nix-infra", "empty" @@ -146,6 +158,7 @@ "hs-nix-infra", "empty" ], + "nix-tools-static": "nix-tools-static", "nixpkgs": [ "hs-nix-infra", "haskellNix", @@ -175,6 +188,10 @@ "hs-nix-infra", "empty" ], + "nixpkgs-2311": [ + "hs-nix-infra", + "empty" + ], "nixpkgs-unstable": "nixpkgs-unstable", "old-ghc-nix": [ "hs-nix-infra", @@ -186,11 +203,11 @@ ] }, "locked": { - "lastModified": 1697195891, - "narHash": "sha256-0L803S/wcHmVebEwFxObYCYOaB14ZtBAFCdg0aRgH70=", + "lastModified": 1707876653, + "narHash": "sha256-hsj9chw/cy9h8XuxQkxnfFR22Ek8xEm33aON2+TcUaI=", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "c6cb3ff56b001b211690da35f70827fab5bf3272", + "rev": "d1a608f84c9ed00ceca8571b253e79f67a1ae2d6", "type": "github" }, "original": { @@ -199,19 +216,19 @@ "type": "github" } }, - "hls-2.3": { + "hls-2.6": { "flake": false, "locked": { - "lastModified": 1695910642, - "narHash": "sha256-tR58doOs3DncFehHwCLczJgntyG/zlsSd7DgDgMPOkI=", + "lastModified": 1705325287, + "narHash": "sha256-+P87oLdlPyMw8Mgoul7HMWdEvWP/fNlo8jyNtwME8E8=", "owner": "haskell", "repo": "haskell-language-server", - "rev": "458ccdb55c9ea22cd5d13ec3051aaefb295321be", + "rev": "6e0b342fa0327e628610f2711f8c3e4eaaa08b1e", "type": "github" }, "original": { "owner": "haskell", - "ref": "2.3.0.0", + "ref": "2.6.0.0", "repo": "haskell-language-server", "type": "github" } @@ -226,11 +243,11 @@ "nixpkgs-rec": "nixpkgs-rec" }, "locked": { - "lastModified": 1699970998, - "narHash": "sha256-NgvBCRIB+lvcxJWMpU8Mulx8PG8s5jtqSR8K/natoTA=", + "lastModified": 1708100161, + "narHash": "sha256-rWwE59SfmqXcVQL7GXovYvjbDPMsb4e1GgiNH+7tlrM=", "owner": "kadena-io", "repo": "hs-nix-infra", - "rev": "a69071dafa3f0d12edf30ecc5a562aee1f7d138d", + "rev": "bcbf823a0851b41d64d4f9c87053abc3153c126e", "type": "github" }, "original": { @@ -239,19 +256,36 @@ "type": "github" } }, + "nix-tools-static": { + "flake": false, + "locked": { + "lastModified": 1706266250, + "narHash": "sha256-9t+GRk3eO9muCtKdNAwBtNBZ5dH1xHcnS17WaQyftwA=", + "owner": "input-output-hk", + "repo": "haskell-nix-example", + "rev": "580cb6db546a7777dad3b9c0fa487a366c045c4e", + "type": "github" + }, + "original": { + "owner": "input-output-hk", + "ref": "nix", + "repo": "haskell-nix-example", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1669833724, - "narHash": "sha256-/HEZNyGbnQecrgJnfE8d0WC5c1xuPSD2LUpB6YXlg4c=", + "lastModified": 1694822471, + "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4d2b37a84fad1091b9de401eb450aae66f1a741e", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "4d2b37a84fad1091b9de401eb450aae66f1a741e", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" } }, @@ -273,17 +307,17 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1695318763, - "narHash": "sha256-FHVPDRP2AfvsxAdc+AsgFJevMz5VBmnZglFUMlxBkcY=", + "lastModified": 1694822471, + "narHash": "sha256-6fSDCj++lZVMZlyqOe9SIOL8tYSBz1bI8acwovRwoX8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e12483116b3b51a185a33a272bf351e357ba9a99", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", "repo": "nixpkgs", + "rev": "47585496bcb13fb72e4a90daeea2f434e2501998", "type": "github" } }, diff --git a/haskell-src/chainweb-data.cabal b/haskell-src/chainweb-data.cabal index fe3cb110..e52b6ea7 100644 --- a/haskell-src/chainweb-data.cabal +++ b/haskell-src/chainweb-data.cabal @@ -83,12 +83,12 @@ library , http-client-tls >=0.3 , http-types , openapi3 - , optparse-applicative >=0.14 && <0.17 + , optparse-applicative >=0.14 , postgresql-simple-migration , servant-client , servant-openapi3 , vector - , yet-another-logger + , yet-another-logger >= 0.4.2 if flag(ghc-flags) build-tool-depends: hsinspect:hsinspect -any @@ -126,7 +126,6 @@ executable chainweb-data , managed , mtl , optparse-applicative >=0.14 - , pact >=4.3.1 , postgresql-simple , postgresql-simple-migration , process >=1.6 @@ -143,6 +142,7 @@ executable chainweb-data , streaming-events , strict-tuple >=0.1 , string-conv + , sqlite-simple , vector , wai , wai-app-static @@ -152,7 +152,7 @@ executable chainweb-data , warp , warp-tls , witherable - , yet-another-logger + , yet-another-logger >= 0.4.2 other-modules: Chainweb.Backfill @@ -188,7 +188,7 @@ test-suite testsuite , lens , lens-aeson , neat-interpolation >=0.5 - , optparse-applicative >=0.14 && <0.17 + , optparse-applicative >=0.14 , tasty >=1.2 , tasty-hunit >=0.10 , text @@ -204,7 +204,7 @@ benchmark bench , aeson , base , beam-core >=0.8 - , beam-postgres >=0.5 && <0.6 + , beam-postgres >=0.5 , bytestring , chainweb-api , chainweb-data diff --git a/haskell-src/exec/Chainweb/RichList.hs b/haskell-src/exec/Chainweb/RichList.hs index f76a4f2c..618c118c 100644 --- a/haskell-src/exec/Chainweb/RichList.hs +++ b/haskell-src/exec/Chainweb/RichList.hs @@ -4,7 +4,6 @@ module Chainweb.RichList ( richList ) where import Control.Applicative ((<|>)) -import Control.Exception import Control.Monad import Control.Lens import Data.Aeson (eitherDecodeStrict, Value(..)) @@ -29,14 +28,10 @@ import System.Logger.Types import Text.Printf (printf) import Text.Read -import Database.SQLite3 -import Database.SQLite3.Direct (Utf8(..)) +import Database.SQLite.Simple import ChainwebData.Env (ChainwebVersion(..)) -import Pact.Types.SQLite - - richList :: LogFunctionIO Text -> FilePath -> ChainwebVersion -> IO () richList logger fp (ChainwebVersion version) = do @@ -46,7 +41,7 @@ richList logger fp (ChainwebVersion version) = do $ "Chainweb-node top-level db directory does not exist: " <> fp logger Info "Aggregating richlist ..." - results <- fmap mconcat $ forM files $ \(cid, file) -> fmap (fmap (\(acct,txid, bal) -> (cid,acct,txid,bal))) $ withSQLiteConnection file richListQuery + results <- fmap mconcat $ forM files $ \(cid, file) -> fmap (fmap (\(acct,txid, bal) -> (cid,acct,txid,bal))) $ withConnection file richListQuery logger Info $ "Filtering top 100 richest accounts..." pruneRichList (either error id . parseResult <$> results) where @@ -107,18 +102,12 @@ pruneRichList = LBS.writeFile "richlist.csv" . M.fromListWith (+) . map (\(cid,acct,txid, balance) -> ((cid,acct,txid), balance)) --- WARNING: This function will throw errors if found. We don't "catch" errors in an Either type -withSQLiteConnection :: FilePath -> (Database -> IO a) -> IO a -withSQLiteConnection fp action = bracket (open (T.pack fp)) close action - -richListQuery :: Database -> IO [(Text, Int64, ByteString)] -richListQuery db = do - rows <- qry_ db richListQueryStmt [RText, RInt, RBlob] - return $ rows <&> \case - [SText (Utf8 account), SInt txid, SBlob jsonvalue] -> (toS account,txid, jsonvalue) - _ -> error "impossible?" -- TODO: Make this use throwError/throwM instead of error +richListQuery :: Connection -> IO [(Text, Int64, ByteString)] +richListQuery conn = do + rows <- query_ conn richListQueryStmt + forM rows $ \(account, txid, jsonvalue) -> return (toS @ByteString @Text account,txid, jsonvalue) -richListQueryStmt :: Utf8 +richListQueryStmt :: Query richListQueryStmt = "select rowkey as acct_id, txid, rowdata \ \ from [coin_coin-table] as coin\ diff --git a/haskell-src/exec/Chainweb/Server.hs b/haskell-src/exec/Chainweb/Server.hs index 40c5fe1f..64e65231 100644 --- a/haskell-src/exec/Chainweb/Server.hs +++ b/haskell-src/exec/Chainweb/Server.hs @@ -20,6 +20,7 @@ import Chainweb.Api.NodeInfo import Control.Concurrent import Control.Error import Control.Exception (bracket_, throwIO) +import Control.Monad import Control.Monad.Except import qualified Control.Monad.Managed as M import Control.Retry diff --git a/haskell-src/lib/ChainwebDb/Queries.hs b/haskell-src/lib/ChainwebDb/Queries.hs index b95b0277..e899df85 100644 --- a/haskell-src/lib/ChainwebDb/Queries.hs +++ b/haskell-src/lib/ChainwebDb/Queries.hs @@ -11,6 +11,7 @@ {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} -- | module ChainwebDb.Queries where @@ -294,7 +295,7 @@ data XChainInfoT f = XChainInfo joinXChainInfo :: TransferT (PgExpr s) -> Q Postgres ChainwebDataDb s (XChainInfoT (PgExpr s)) -joinXChainInfo tr = pgUnnest $ (customExpr_ $ \fromAcct toAcct idx mdName blk req amt -> +joinXChainInfo tr = pgUnnest $ (customExpr_ $ \fromAcct toAcct idx mdName blk req _amt -> -- We need the following LATERAL keyword so that it can be used liberally -- in any Q context despite the fact that it refers to the `tr` coming -- from the outside scope. The LATERAL helps, because when the expression below