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

Refactor Outcome algebra #1340

Merged
merged 2 commits into from
Mar 8, 2024
Merged

Refactor Outcome algebra #1340

merged 2 commits into from
Mar 8, 2024

Conversation

ch1bo
Copy link
Member

@ch1bo ch1bo commented Mar 6, 2024

This ensures that Error outcomes do not allow state changes, while Wait outcomes terminate the "line of effects".

Smart constructors and the Semigroup instance still result in some form of DSL in the HeadLogic.


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

@ch1bo ch1bo requested a review from a team March 6, 2024 08:08
@ch1bo ch1bo force-pushed the outcome-algebra branch 2 times, most recently from 488fbad to 116c866 Compare March 6, 2024 12:16
Copy link

github-actions bot commented Mar 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-03-08 07:06:56.756414547 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial bccf2a430c016bc960fbf31b02694011cd399d20da8882aac9d33611 4110
νCommit 56b0f0b597150e619c76bed60683f3b1e42d7bc0685ed951b882bfc5 1975
νHead 86bff95ba20e9d1d1b34899a56d86bbacc9fed999260b27dcc92d128 9351
μHead 88f533cf67cd0fc93d7d9ccf0a8b1d69ffd1208a825efbebbc1d36ba* 4213
  • 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 4794 8.87 3.39 0.46
2 4996 10.61 4.05 0.49
3 5197 12.55 4.80 0.51
5 5599 16.53 6.33 0.58
10 6605 26.33 10.09 0.73
47 14043 98.04 37.62 1.83

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 592 10.24 4.04 0.29
2 784 13.88 5.64 0.34
3 972 17.66 7.29 0.39
5 1341 25.66 10.74 0.49
10 2275 48.19 20.30 0.79
19 3965 97.83 40.79 1.41

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 544 16.52 6.53 0.35
2 113 654 26.89 10.72 0.47
3 171 764 38.14 15.34 0.60
4 226 874 52.82 21.34 0.77
5 283 984 66.35 27.04 0.92
6 338 1095 82.05 33.63 1.10
7 396 1205 99.18 40.85 1.30

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 591 8.25 4.58 0.28
2 744 9.04 5.68 0.30
3 741 9.48 4.76 0.29
5 1256 11.52 9.31 0.37
10 1933 15.82 15.14 0.47
50 5206 41.67 26.30 0.91

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 615 8.69 4.74 0.28
2 749 9.34 5.78 0.30
3 961 10.43 7.19 0.33
5 1259 12.47 9.72 0.38
10 2076 17.40 16.19 0.50
50 8134 51.13 63.51 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 4678 17.13 7.41 0.55
2 4796 27.88 12.15 0.67
3 4980 41.97 18.45 0.84
4 5147 59.94 26.39 1.05
5 5209 76.30 33.55 1.24
6 5265 88.76 38.81 1.38

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 4627 7.85 3.28 0.44
5 1 57 4661 9.21 4.08 0.46
5 5 285 4797 13.61 6.84 0.52
5 10 567 4964 19.37 10.40 0.60
5 20 1136 5303 31.32 17.71 0.76
5 30 1709 5649 42.64 24.76 0.92
5 40 2279 5988 53.96 31.81 1.08
5 50 2849 6328 65.50 38.95 1.24
5 79 4491 7303 98.79 59.59 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 2024-03-08 07:10:41.040534756 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 25.345713989
P99 51.38594325000004ms
P95 34.99626049999999ms
P50 23.736244499999998ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 5.704872025
P99 12.925944049999991ms
P95 9.645522049999997ms
P50 5.0915635ms
Number of Invalid txs 0

@ch1bo ch1bo enabled auto-merge March 6, 2024 13:20
@ch1bo ch1bo disabled auto-merge March 6, 2024 13:20
Copy link

github-actions bot commented Mar 6, 2024

Test Results

416 tests   - 2   408 ✅  - 2   13m 51s ⏱️ +3s
138 suites  - 1     8 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit a2b7673. ± Comparison against base commit 7bfd3c5.

This pull request removes 2 tests.
Hydra.Behavior/Hydra Node Logging/JSON encoding of (HydraNodeLog SimpleTx) ‑ allows to encode values with aeson and read them back
Hydra.Behavior/Hydra Node Logging/JSON encoding of (HydraNodeLog SimpleTx) ‑ produces the same JSON as is found in golden/HydraNodeLog SimpleTx.json

♻️ This comment has been updated with latest results.

This ensures that `Error` outcomes do not allow state changes, while
`Wait` may not have any side effects.

Smart constructors and the Semigroup instance still result in some form
of DSL in the HeadLogic.
These are not really needed as we do test the JSON definition against
the logs.yaml schema and the sample size was very small anyways.
@ch1bo ch1bo enabled auto-merge March 8, 2024 07:01
@ch1bo ch1bo merged commit 87fddc8 into master Mar 8, 2024
20 checks passed
@ch1bo ch1bo deleted the outcome-algebra branch March 8, 2024 07:14
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

4 participants