Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add hlint CI job #1290

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Add hlint CI job #1290

merged 1 commit into from
Feb 15, 2024

Conversation

locallycompact
Copy link
Contributor

@locallycompact locallycompact commented Feb 6, 2024

Adds hlint 3.8 and apply-refact 0.14.0.0 to devshell.
Adds an hlint github CI workflow.


  • CHANGELOG updated or not needed
  • Documentation updated or not needed
  • Haddocks updated or not needed
  • No new TODOs introduced or explained herafter

Copy link

github-actions bot commented Feb 6, 2024

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 2024-02-14 09:37:52.749776697 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 985245919fcc6c0c5cd116023cd2c947c43e80dcbb5075fe12433fbb 4072
νCommit 7cb20fa71eb4c563ca283566ebe0aa65859d96c3f8cba35c52c181fd 2043
νHead 7a36661f5c15e9f1783aeaab890812c59b7286cbbc6de762d3110772 8816
μHead 8b111ac12274e46314769295a1c5dcab1d260096fc469fd698065463* 3851
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per Head.

Cost of Init Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 4372 10.29 3.97 0.45
2 4573 12.55 4.83 0.49
3 4777 14.68 5.63 0.52
5 5180 19.16 7.33 0.59
10 6185 30.30 11.55 0.75
41 12417 99.06 37.61 1.77

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 534 11.37 4.44 0.30
2 723 15.04 6.07 0.35
3 906 18.85 7.75 0.40
5 1289 26.90 11.27 0.51
10 2221 49.55 20.97 0.80
19 3911 99.43 41.75 1.43

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 480 21.12 8.27 0.40
2 114 590 32.34 12.79 0.53
3 169 704 45.87 18.26 0.68
4 226 810 59.41 23.86 0.84
5 284 924 79.42 31.92 1.06
6 339 1031 91.65 37.25 1.20

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 490 16.23 7.33 0.36
2 751 18.54 9.36 0.40
3 847 19.90 10.62 0.42
5 1138 22.58 13.21 0.48
10 1856 29.91 20.19 0.62
50 7696 88.54 75.24 1.75

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 549 20.27 8.97 0.40
2 705 21.77 10.32 0.43
3 827 23.42 11.71 0.46
5 1133 26.81 14.71 0.52
10 1971 36.19 22.69 0.69
46 7567 98.79 76.91 1.84

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 4326 18.98 8.17 0.55
2 4501 32.09 13.99 0.71
3 4553 45.40 19.79 0.86
4 4747 64.62 28.38 1.09
5 4900 83.94 36.94 1.31

Cost of FanOut Transaction

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

Parties UTxO UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
5 0 0 4205 7.42 3.10 0.42
5 1 57 4239 9.28 4.13 0.44
5 5 285 4375 13.56 6.91 0.50
5 10 568 4544 19.92 10.81 0.59
5 20 1138 4883 32.64 18.62 0.76
5 30 1705 5223 44.73 26.16 0.93
5 40 2275 5563 57.25 33.88 1.10
5 50 2844 5901 68.93 41.25 1.26
5 74 4215 6720 98.50 59.60 1.67

End-To-End Benchmark Results

This page is intended to collect the latest end-to-end benchmarks results produced by Hydra's Continuous Integration system from the latest master code.

Please take those results with a grain of salt as they are currently produced from very limited cloud VMs and not controlled hardware. Instead of focusing on the absolute results, the emphasis should be on relative results, eg. how the timings for a scenario evolve as the code changes.

Generated at 2024-02-14 09:40:41.038121007 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 22.335860923
P99 113.39348308000001ms
P95 31.695836449999994ms
P50 19.7112035ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.185836964
P99 7.590317399999993ms
P95 5.216062999999997ms
P50 3.9758115ms
Number of Invalid txs 0

Copy link

github-actions bot commented Feb 13, 2024

Test Results

412 tests  ±0   404 ✅ ±0   12m 29s ⏱️ -30s
138 suites ±0     8 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 72cea3c. ± Comparison against base commit 51ff24e.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

I like this change overall, one question about apply-refact and also this does not compile.


- name: 📐 Check hlint
run: |
nix develop .#fmt --command hlint .
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should: Just expand the formatting workflow

We use the exact same shell as in the formatting workflow, we should avoid preparing it twice. So I would suggest to move it as an additional step on the existing workflow.

In fact, the code formatting job in the formatting workflow should actually be even part of the ci-nix workflow as we have also the exact same workflow trigger.

@@ -0,0 +1,2 @@
- ignore: {name: Redundant <$>, within: [Hydra.Contract.HeadTokens]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should: Leave a hint on the corresponding code location

You mentioned that we can't have a local ignore pragma because of plutus-tx, but can we somehow make a link that we want to get rid of that change the next time when we recompile / change the script hashes?

@@ -0,0 +1,2 @@
- ignore: {name: Redundant <$>, within: [Hydra.Contract.HeadTokens]}
- ignore: {name: Redundant compare, within: [Hydra.PartySpec]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should: use a local ignore pragma or address this

This should be possible, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know really, GHC just doesn't like it when I do the suggestions in the docs.

( const
(contramap TraceSendRecv tracer)
, codecFireForget
, fireForgetClientPeer $ client tracer sk party
Copy link
Collaborator

Choose a reason for hiding this comment

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

Must: fix this as it does not compile

This binary is not built by CI, so that's why we don't see it red. How did you apply the hlint suggestions? Seems like this broke.

@@ -45,6 +47,8 @@ let
fourmolu
cabal-fmt
pkgs.nixpkgs-fmt
hlint
apply-refact
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For

hlint --refactor --refactor-options="-i"

applies everything.

Copy link
Collaborator

@ch1bo ch1bo left a comment

Choose a reason for hiding this comment

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

Would be great if we find alternatives to the .hlint.yaml ignores, but this is good to go.

@locallycompact locallycompact merged commit 081a8aa into master Feb 15, 2024
21 checks passed
@locallycompact locallycompact deleted the hlint branch February 15, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants