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 a code formatting PR workflow #1154

Merged
merged 7 commits into from
Nov 7, 2023
Merged

Add a code formatting PR workflow #1154

merged 7 commits into from
Nov 7, 2023

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Nov 6, 2023

  • 🧹 Adds a code formatting workflow which runs treefmt to check all code formatting in the project.

  • 🧹 Updates to latest available fourmolu and cabal-fmt version

  • 🧹 Applies changes to comply. Notable differences with new version of fourmolu:

    • Postfix qualified (not configurable from ourmolu), e.g.
    -import qualified Cardano.Api
    +import Cardano.Api qualified
    • Removed parenthesis from single constraints:
    -  (IsShelleyBasedEra era) =>
    +  IsShelleyBasedEra era =>
    • Multiple $ and >>= seemingly get broken into new lines differently now:
      • Fixed with a fixity override of $
    -        withOSStats workDir $
    -          withCardanoNodeDevnet (contramap FromCardanoNode tracer) workDir $ \node@RunningNode{nodeSocket} -> do
    +        withOSStats workDir
    +          $ withCardanoNodeDevnet (contramap FromCardanoNode tracer) workDir
    +          $ \node@RunningNode{nodeSocket} -> do
    • Lenses are a bit annoying now and sometimes require additional parens:
      • Fixed with a fixity override of &
    & ppPricesL
    -      .~ ( Prices
    -            { prMem = fromJust $ boundRational 0
    -            , prSteps = fromJust $ boundRational 0
    -            }
    -         )
    -    & ppMinFeeAL .~ Coin 0
    -    & ppMinFeeBL .~ Coin 0
    +    .~ ( Prices
    +          { prMem = fromJust $ boundRational 0
    +          , prSteps = fromJust $ boundRational 0
    +          }
    +       )
    +      & ppMinFeeAL
    +    .~ Coin 0
    +      & ppMinFeeBL
    +    .~ Coin 0

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

@ch1bo ch1bo self-assigned this Nov 6, 2023
Copy link

github-actions bot commented Nov 6, 2023

Test Results

363 tests  ±0   358 ✔️ ±0   18m 14s ⏱️ - 1m 53s
122 suites ±0       5 💤 ±0 
    5 files   ±0       0 ±0 

Results for commit 837c00b. ± Comparison against base commit 8a451dd.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 6, 2023

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 2023-11-07 12:14:19.708902966 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 9bad424d8a3bc67f63acfe1b015b551e84a14d7d8818204089a021b5 4120
νCommit 171a1e6bdbc8aa96d957a65b3f505517386af06ba265e3f784741f67 2050
νHead 00a8a1475bd29c02c0e3ff02a2fc83607425cd9b94eaa9f2a3056ab1 9185
μHead 16bb32b8df4dfc6cefe5bbaad9174db1b61394bdeaf1b26e83024bf6* 4150
  • 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 4747 11.63 4.59 0.49
2 4946 14.44 5.68 0.53
3 5155 16.64 6.51 0.56
5 5563 21.15 8.22 0.63
10 6586 32.89 12.70 0.80
38 12334 99.84 38.23 1.78

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 599 12.55 4.94 0.31
2 786 16.25 6.61 0.36
3 965 20.09 8.33 0.42
5 1350 28.20 11.93 0.52
10 2288 50.99 21.85 0.82
18 3777 94.61 40.32 1.37

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 815 24.37 9.70 0.45
2 114 1135 38.17 15.31 0.62
3 170 1456 51.21 20.77 0.78
4 227 1773 71.00 28.86 1.01
5 284 2098 87.92 36.02 1.21

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 711 19.11 8.82 0.40
2 900 20.39 10.20 0.43
3 1064 21.92 11.52 0.46
5 1561 25.10 14.62 0.53
10 2593 33.78 22.47 0.70
50 10499 95.75 80.28 1.96

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 720 22.92 10.24 0.44
2 967 24.86 11.92 0.48
3 1082 25.38 12.66 0.49
5 1562 30.27 16.61 0.58
10 2605 38.75 24.17 0.75
44 9450 97.59 75.91 1.90

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 4968 21.08 9.12 0.60
2 5434 35.53 15.57 0.79
3 5877 53.19 23.46 1.01
4 6319 74.09 32.75 1.26
5 6485 91.15 40.12 1.46

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 4766 8.58 3.63 0.46
5 1 57 4802 10.11 4.52 0.48
5 5 285 4947 15.30 7.70 0.55
5 10 570 5127 21.78 11.67 0.64
5 20 1138 5488 34.76 19.61 0.81
5 30 1708 5843 47.74 27.55 0.99
5 40 2275 6204 60.49 35.40 1.17
5 50 2846 6564 73.71 43.45 1.35
5 70 3988 7287 99.71 59.37 1.70

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 2023-11-07 12:05:59.912719656 UTC

3-nodes Scenario

A rather typical setup, with 3 nodes forming a Hydra head.

Number of nodes 3
Number of txs 900
Avg. Confirmation Time (ms) 26.759377015
P99 135.39278735999955ms
P95 33.183039949999994ms
P50 22.2661435ms
Number of Invalid txs 0

Baseline Scenario

This scenario represents a minimal case and as such is a good baseline against which to assess the overhead introduced by more complex setups. There is a single hydra-node d with a single client submitting single input and single output transactions with a constant UTxO set of 1.

Number of nodes 1
Number of txs 300
Avg. Confirmation Time (ms) 6.051702473
P99 11.67815447ms
P95 8.56624315ms
P50 5.567921ms
Number of Invalid txs 0

@ch1bo ch1bo force-pushed the code-format-workflow branch 5 times, most recently from 961aaf2 to 35aab4c Compare November 6, 2023 12:07
@ch1bo ch1bo requested review from locallycompact and a user November 6, 2023 12:09
@ch1bo ch1bo removed their assignment Nov 6, 2023
@ch1bo ch1bo force-pushed the code-format-workflow branch 3 times, most recently from cf689db to d5cdc84 Compare November 6, 2023 17:27
@ch1bo ch1bo force-pushed the code-format-workflow branch from 5a6fb74 to 837c00b Compare November 7, 2023 12:01
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.

Interestingly the build is red but no individual step is 🤷 What am I missing?

@ch1bo
Copy link
Collaborator Author

ch1bo commented Nov 7, 2023

Interestingly the build is red but no individual step is 🤷 What am I missing?

I did rerun a failing step and forgot to rerun all dependent ones.

@ch1bo ch1bo merged commit 424671d into master Nov 7, 2023
20 checks passed
@ch1bo ch1bo deleted the code-format-workflow branch November 7, 2023 17:16
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.

1 participant