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

Move -Werror from packages into project #1151

Merged
merged 4 commits into from
Nov 6, 2023
Merged

Move -Werror from packages into project #1151

merged 4 commits into from
Nov 6, 2023

Conversation

locallycompact
Copy link
Contributor

We should not have Werror on by default as it creates friction for downstream users consuming published releases of our libraries. If somebody includes our library in a build plan which does not match our development exactly, then that can issue a warning that will throw an error if Werror is set in our cabal files. Things which are innocuous such as StarIsType deprecations or ~ requires TypeOperator deprecations.

Users would then have to override our package in their build plan to add the development flag, which is needless work for developers.

Copy link

github-actions bot commented Nov 2, 2023

Test Results

363 tests   358 ✔️  19m 40s ⏱️
122 suites      5 💤
    5 files        0

Results for commit 384185b.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 2, 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-06 10:36:57.356483581 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 4743 11.60 4.58 0.49
2 4949 14.20 5.58 0.52
3 5154 16.54 6.47 0.56
5 5567 21.24 8.26 0.63
10 6586 33.06 12.76 0.80
38 12328 98.27 37.61 1.76

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.64 4.97 0.31
2 787 16.34 6.64 0.36
3 969 20.09 8.33 0.42
5 1350 28.20 11.93 0.52
10 2287 50.91 21.81 0.82
18 3786 94.61 40.32 1.37

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 814 24.37 9.70 0.45
2 114 1143 36.16 14.57 0.60
3 170 1463 52.70 21.33 0.79
4 226 1776 70.04 28.52 1.00
5 282 2094 87.65 35.92 1.21

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 635 18.29 8.30 0.39
2 932 20.47 10.25 0.43
3 1113 22.60 11.95 0.47
5 1202 22.51 10.42 0.46
10 2532 33.07 22.09 0.69
50 10888 97.11 81.71 2.00

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 742 22.46 10.07 0.44
2 951 24.77 11.88 0.48
3 1169 26.74 13.54 0.52
5 1566 30.15 16.49 0.58
10 2589 39.07 24.28 0.75
44 9567 98.61 76.76 1.92

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 4982 21.16 9.16 0.61
2 5389 35.69 15.63 0.79
3 5881 52.76 23.29 1.00
4 6340 74.19 32.80 1.27
5 6776 98.47 43.60 1.56

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.68 3.67 0.46
5 1 57 4803 9.88 4.42 0.47
5 5 284 4945 15.07 7.60 0.54
5 10 569 5130 21.78 11.67 0.64
5 20 1140 5487 34.39 19.45 0.81
5 30 1707 5845 47.74 27.55 0.99
5 40 2274 6203 60.26 35.31 1.16
5 50 2847 6565 73.48 43.36 1.35
5 70 3981 7276 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-06 10:22:14.912385624 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) 22.573905940
P99 45.72260854999992ms
P95 29.884585999999995ms
P50 21.093571500000003ms
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) 4.869971030
P99 8.5741084ms
P95 6.2451687ms
P50 4.6627565ms
Number of Invalid txs 0

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 think this is fine and will make all our nix build invocations fail with warnings as errors, making CI on PRs report all warnings, but also give developers an easy way to run a "Werror-build" by doing nix build (assuming nobody used the nix invocation for development)

I want a review of @abailly-iohk on this as well as he had an opinion on disabling Werror in the past.

}
strict-containers.doHaddock = false;

# -Werror for CI
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not only enabling Werror for CI but for any nix build involving these packages. Either we put -Werror somewhere else or update this comment.

if flag(hydra-development)
-- NOTE(SN): should fix HLS choking on PlutusTx plugin
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
ghc-options: -fplugin-opt PlutusTx.Plugin:defer-errors
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of turning them on for the full package, we should instead reach to module-level disabling of this via {-# OPTIONS_GHC -fplugin-opt PlutusTx.Plugin:defer-errors #-} pragmas on the affected modules.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Doing this removed the need to do quite some haddock workarounds: a75c0f6

Copy link
Contributor

@abailly-iohk abailly-iohk left a comment

Choose a reason for hiding this comment

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

I am not a big fan of having different local and CI builds, even more so when the only way to not being tripped by forgetting to explicitly set -Werror before pushing is to nix build. And I am not a big fan of not having -Werror by default, as @ch1bo rightfully guessed.
Has anyone complained they were having issues with our published packages?
I won't however prevent merging this change if most people in the team think it's worthwhile to do this.

@locallycompact
Copy link
Contributor Author

Here are complaints of this in other published libraries that would also be true for us when we publish to CHaP.

IntersectMBO/cardano-base#372

@ch1bo
Copy link
Collaborator

ch1bo commented Nov 6, 2023

@abailly-iohk @locallycompact in the discussion of IntersectMBO/cardano-base#372 there is a nice solution:

Turn -Werror on in cabal.project.

That way, any cabal build using our repository will treat warnings as errors (including CI), but downstream projects depending on the .cabal files will not be impacted and developers can turn it off (as mentioned in the issue above).

I think I would prefer this option and will request it as a change.

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.

As discussed, turning -Werror on in cabal.project is more in-line with what we have today. Furthermore it does keep the nix build more similar to a non-nix build.

We could also put a line of advice into CONTRIBUTING.md how to turn it off (e.g. what to put in a cabal.project.local)

@ch1bo ch1bo self-assigned this Nov 6, 2023
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.

@abailly-iohk Changed it to be configured in the cabal.project. Do you approve?

@ch1bo ch1bo removed their assignment Nov 6, 2023
locallycompact and others added 4 commits November 6, 2023 11:11
This is only needed for HLS to not choke on the plutus-tx plugin. As we
recently removed the hydra-development flag and enabled it on package
level, we moved this further "down" into each affected module and this
makes Haddock pick it up correctly.
This enables warnings as errors for all local packages and thus fails
builds inside the nix toolchain, but also non-nix invocations of cabal.
@ch1bo ch1bo merged commit f989458 into master Nov 6, 2023
19 checks passed
@ch1bo ch1bo deleted the lc/Werror branch November 6, 2023 11:20
@ch1bo ch1bo changed the title Remove Werror and move it to CI only Move -Werror from packages into project Nov 6, 2023
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.

3 participants