Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use CHaP 🤖 #576

Merged
merged 5 commits into from
Oct 21, 2022
Merged

Use CHaP 🤖 #576

merged 5 commits into from
Oct 21, 2022

Conversation

ch1bo
Copy link
Member

@ch1bo ch1bo commented Oct 21, 2022

🤖 The Cardano Haskell Packages (CHaP) will make our life's simpler by forcing our upstream dependencies to version & release their code, and we don't need to keep source-repository-package entries in the cabal.project

🤖 Added the CHaP index to cabal.project and made it work using nix. The nix shell will now compile (or download) & provide most third-party dependencies to us.

🤖 Only exception: cardano-api where only version 1.35.3 is in CHaP, which does not include our upstreamed changes. Needed to backport the two commits and keep the source-repository-package stanza for that one.

@ch1bo ch1bo requested a review from a user October 21, 2022 09:09
Copy link
Contributor

@v0d1ch v0d1ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Builds on my machine 💪

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 I ♡ the amount of code this remove in cabal.project


Because of how we use Nix to manage our Haskell build, whenever you do this you
will also need to pull in the Nix equivalent of the newer `index-state`. You can
do this by bumping the `haskellNix` to a newer tag in our `default.nix`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Mention the possibility of a conflict, eg. trying to pull newer hackage index than supported by haskell.nix? It happened to me a couple of months ago

@@ -349,7 +349,7 @@ test-suite tests
, plutus-ledger-api
, process
, QuickCheck
, quickcheck-dynamic
, quickcheck-dynamic <2.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this formatting looks weird, I guess that's cabal-fmt but I am not keen on "tables" in text

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This was automatic by cabal-fmt

@github-actions
Copy link

github-actions bot commented Oct 21, 2022

Test Results

261 tests  ±0   255 ✔️ ±0   16m 6s ⏱️ - 2m 43s
  93 suites ±0       6 💤 ±0 
    5 files   ±0       0 ±0 

Results for commit 0cd441e. ± Comparison against base commit 2e41d95.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Oct 21, 2022

Transactions Costs

Sizes and execution budgets for Hydra protocol transactions. Note that unlisted parameters are currently using arbitrary values and results are not fully deterministic and comparable to previous runs.

Metadata
Generated at 2022-10-21 20:37:27.628994138 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4832 11.97 4.77 0.49
2 5038 11.17 4.38 0.49
3 5242 15.22 6.00 0.55
5 5653 18.44 7.22 0.60
10 6677 27.10 10.52 0.74
46 14058 99.60 38.49 1.85

Cost of Commit Transaction

Currently only one UTxO per commit allowed (this is about to change soon)

UTxO Tx size % max Mem % max CPU Min fee ₳
1 5771 19.92 8.05 0.62

Cost of CollectCom Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 13058 20.68 8.29 0.95
2 13379 36.59 14.81 1.14
3 13594 52.92 21.58 1.33
4 14168 79.17 32.49 1.65

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9327 8.19 3.36 0.65
2 9488 8.97 3.81 0.67
3 9729 10.58 4.59 0.70
5 10054 12.19 5.51 0.73
10 10880 16.04 7.75 0.81
30 14222 32.44 17.09 1.16
62 15415 37.63 14.26 1.24

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 9328 8.16 3.34 0.65
2 9526 9.38 3.96 0.67
3 9660 9.72 4.24 0.68
5 9988 11.28 5.15 0.72
10 10917 16.64 7.97 0.82
30 14224 32.60 17.14 1.16
43 16372 42.92 23.08 1.38

Cost of Abort Transaction

Some variation because of random mixture of still initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 13495 22.50 9.35 0.99
2 13817 38.29 16.29 1.18
3 13927 52.72 22.50 1.35
4 14744 93.37 43.21 1.86
5 14435 97.10 42.41 1.88

Cost of FanOut Transaction

Involves spending head output and burning head tokens. Uses ada-only UTxO for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 13417 10.13 4.41 0.85
2 13454 11.40 5.19 0.87
3 13491 12.92 6.07 0.89
5 13564 15.96 7.83 0.93
10 13810 23.95 12.37 1.04
50 15315 85.51 47.85 1.86
59 15569 98.60 55.53 2.03

ch1bo added 5 commits October 21, 2022 22:19
This will make dependency management (hopefully) a lot simpler and
improve UX with cabal and nix(haskell.nix)
This will result in quite some rebuilds, but our nix cache is now
containing ALL the cardano haskell packages 🎉
For some reason we need to fetch the CHaP index and this does not play
well with pure nix-shells. Alternative would've been to add TLS
capability to the nix-shell .. I guess. But this is not important enough
that I would bother now.
@ch1bo ch1bo merged commit 68616a0 into master Oct 21, 2022
@ch1bo ch1bo deleted the ch1bo/use-chap branch October 21, 2022 21:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants