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

Conway fee calculation #1553

Merged
merged 20 commits into from
Aug 8, 2024
Merged

Conway fee calculation #1553

merged 20 commits into from
Aug 8, 2024

Conversation

ch1bo
Copy link
Collaborator

@ch1bo ch1bo commented Aug 7, 2024

Makes the internal wallet use the right computation depending on the current era. We support Babbage and Conway in that part of the application now by making things a bit more polymorphic on the era.

Co-authored by @noonio and @ffakenz


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

@ch1bo ch1bo requested a review from a team August 7, 2024 14:45
@ch1bo ch1bo linked an issue Aug 7, 2024 that may be closed by this pull request
@ch1bo
Copy link
Collaborator Author

ch1bo commented Aug 7, 2024

We can verify this working correctly on our open head on preview too before merging this.

Copy link

github-actions bot commented Aug 7, 2024

Transaction 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-08-08 12:32:51.116242166 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2fac819a1f4f14e29639d1414220d2a18b6abd6b8e444d88d0dda8ff 3799
νCommit 2043a9f1a685bcf491413a5f139ee42e335157c8c6bc8d9e4018669d 1743
νHead bd9fad235c871fb7f837c767593018a84be3083ff80f9dab5f1c55f9 10194
μHead c8038945816586c4d38926ee63bba67821eb863794220ebbd0bf79ee* 4607
  • The minting policy hash is only usable for comparison. As the script is parameterized, the actual script is unique per head.

Init transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 5189 5.71 2.25 0.44
2 5390 6.99 2.76 0.46
3 5591 8.55 3.38 0.49
5 5993 11.49 4.55 0.54
10 6998 18.34 7.26 0.66
56 16246 81.52 32.24 1.76

Commit transaction costs

This uses ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 556 10.52 4.15 0.29
2 747 13.86 5.65 0.34
3 934 17.33 7.20 0.38
5 1302 24.65 10.44 0.48
10 2242 45.22 19.36 0.75
20 4116 95.99 40.76 1.40

CollectCom transaction costs

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 549 22.17 8.68 0.42
2 114 659 32.10 12.73 0.53
3 170 769 43.87 17.60 0.67
4 226 879 58.84 23.79 0.84
5 281 989 78.05 31.64 1.05
6 337 1100 88.51 36.36 1.18

Cost of Decrement Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 627 17.71 7.79 0.38
2 762 19.36 9.16 0.41
3 998 21.58 10.76 0.45
5 1158 22.65 12.58 0.47
10 2008 32.89 20.17 0.65
48 7790 99.38 73.78 1.83

Close transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 667 21.02 9.42 0.42
2 732 22.03 10.46 0.44
3 1062 24.79 12.94 0.49
5 1349 27.92 15.98 0.55
10 1921 35.04 22.69 0.68
49 7834 97.44 82.00 1.87

Contest transaction costs

Parties Tx size % max Mem % max CPU Min fee ₳
1 674 27.18 11.67 0.48
2 800 28.90 13.17 0.51
3 951 30.72 14.71 0.55
5 1276 34.68 18.08 0.62
10 2079 44.33 26.40 0.79
38 6397 98.31 72.66 1.75

Abort transaction costs

There is some variation due to the random mixture of initial and already committed outputs.

Parties Tx size % max Mem % max CPU Min fee ₳
1 5077 17.32 7.55 0.57
2 5158 24.98 10.82 0.66
3 5309 41.58 18.33 0.85
4 5470 57.94 25.71 1.04
5 5636 73.86 32.82 1.23
6 5723 92.23 40.99 1.44

FanOut transaction costs

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 5023 7.75 3.28 0.46
5 1 57 5057 9.08 4.08 0.48
5 5 283 5190 13.60 6.92 0.54
5 10 569 5361 19.06 10.39 0.62
5 20 1135 5698 30.19 17.43 0.77
5 30 1709 6043 41.51 24.55 0.93
5 40 2274 6378 52.84 31.67 1.09
5 50 2847 6721 64.56 38.97 1.25
5 81 4610 7771 99.33 60.93 1.73

End-to-end benchmark results

This page is intended to collect the latest end-to-end benchmark results produced by Hydra's continuous integration (CI) system from the latest master code.

Please note that these results are approximate as they are currently produced from limited cloud VMs and not controlled hardware. Rather than focusing on the absolute results, the emphasis should be on relative results, such as how the timings for a scenario evolve as the code changes.

Generated at 2024-08-08 12:36:02.355106851 UTC

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 3.989051055
P99 10.615034939999969ms
P95 4.876735899999997ms
P50 3.706972ms
Number of Invalid txs 0

Three local nodes

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 22.141608547
P99 46.06004053000003ms
P95 30.76002494999998ms
P50 20.121686ms
Number of Invalid txs 0

Copy link

github-actions bot commented Aug 7, 2024

Test Results

466 tests  ±0   459 ✅ ±0   17m 14s ⏱️ -13s
148 suites  - 1     7 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 1bab0c8. ± Comparison against base commit 70843d8.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
Hydra.Chain.Direct.Tx/collectComTx ‑ cover fee correctly handles redeemers
Test.EndToEnd/End-to-end on Cardano devnet/forking eras ‑ can start in conway era

♻️ This comment has been updated with latest results.

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.

Let's see if it works for real!

@noonio noonio force-pushed the conway-fee-calculation branch 2 times, most recently from e44b31a to 911e31e Compare August 8, 2024 09:24
ch1bo and others added 19 commits August 8, 2024 14:00
This was introduced lately and our devnet config did not match the one
from preview (or mainnet)
This forces us to pick an era and eventually requires the internal
wallet to handle protocol parameters polymorphically.
- Using the `upgradeTx` from the ledger
This will not work as the plutus purpose does not unify Babbage and Conway.

We should be looking for a better, more generic way to update ex units
in a transaction.
Still investigating why the fees aren't right, even though it's using
the right pparams (Conway) now.
This is higher level and resolves reference scripts itself to find the
ref script bytes (relevant in conway).
This is needed because data is serialized different in Conway than
in Babbage.
This also fails now with an era mismatch exception
This test was seemingly always failing evaluation of the created tx and
not actually testing coverFee at all. Also it was quite annoying to
maintain over the years and we have better ways to create Hydra
transactions nowadays.
.gitignore Show resolved Hide resolved
@ch1bo ch1bo disabled auto-merge August 8, 2024 12:37
@ch1bo ch1bo merged commit 4800525 into master Aug 8, 2024
18 of 20 checks passed
@ch1bo ch1bo deleted the conway-fee-calculation branch August 8, 2024 12:38
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.

Cannot close head in Conway
4 participants