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

Use eventId/effectId pair to dedup effects logged content #896

Merged
1 commit merged into from
Jun 1, 2023

Conversation

ghost
Copy link

@ghost ghost commented May 30, 2023

A previous PR already introduced the idea of using a unique sequential id for events to reduce duplication in logs. This PR expands on this to handle the BeginEffect/EndEffect pairs, using a pair of eventId and sequential effectId to identify effects pairs.


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

@ghost ghost requested review from ch1bo, ffakenz, pgrange and v0d1ch and removed request for ch1bo May 30, 2023 08:13
Copy link
Contributor

@pgrange pgrange left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution which, I think makes our logs better. I want to share my feeling that we might be mixing things a bit between logs and traces. I'm no expert in that but I feel like this begin/end tries to make our logs be usable for traces and maybe at some point we should make things clear between these too concepts.

@github-actions
Copy link

github-actions bot commented May 30, 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-05-31 12:21:04.411169158 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 2212a4ee618434b9b2f366d7c330dbdfb5c7072e793a850fd0de6ddd 4294
νCommit 69e1ccf9ad73dc6d37a5bc8de5aec86f3c4c1710fe5fd334e0e16b18 2124
νHead 8ae095dca4d14a1b8edffb37faa6c84ec60340fbf389a62f027e0b76 9355
μHead 33642a45c7fbb955ce1704ef09229bb211bf9af9980530db28c6aafe* 4148
  • 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 4741 12.47 4.87 0.49
2 4951 15.07 5.86 0.53
3 5152 18.04 7.00 0.57
5 5562 21.62 8.31 0.63
10 6584 34.42 13.18 0.81
37 12123 98.09 37.18 1.74

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 599 14.89 5.70 0.34
2 784 19.57 7.70 0.40
3 972 24.75 9.88 0.46
5 1350 36.07 14.56 0.61
10 2278 71.81 28.88 1.04
13 2838 98.03 39.15 1.35

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 815 27.72 10.77 0.49
2 114 1136 43.29 16.94 0.67
3 171 1457 61.86 24.37 0.89
4 227 1777 81.78 32.38 1.12

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 669 19.33 8.77 0.40
2 812 19.97 9.56 0.42
3 965 21.37 10.82 0.44
5 1299 24.16 13.33 0.50
10 2120 31.12 19.62 0.64
50 8725 87.17 69.99 1.74

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 676 24.77 10.63 0.46
2 841 26.49 12.01 0.49
3 1007 28.20 13.38 0.52
5 1333 31.20 15.95 0.58
10 2152 40.20 22.97 0.74
44 7771 98.03 69.37 1.78

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 4853 22.40 9.38 0.61
2 4893 28.81 11.76 0.68
3 5495 53.45 22.88 0.99
4 5816 73.46 31.59 1.23
5 5997 90.33 38.78 1.42

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 4761 8.66 3.57 0.46
5 1 57 4797 10.06 4.39 0.47
5 5 283 4938 15.64 7.69 0.55
5 10 567 5125 22.61 11.82 0.64
5 20 1137 5477 36.56 20.07 0.83
5 30 1707 5848 50.52 28.33 1.02
5 40 2279 6202 64.49 36.60 1.21
5 50 2847 6564 78.46 44.87 1.40
5 65 3698 7099 99.42 57.28 1.68

@github-actions
Copy link

github-actions bot commented May 30, 2023

Test Results

308 tests   - 11   302 ✔️  - 11   22m 32s ⏱️ +57s
104 suites  -   4       6 💤 ±  0 
    5 files    -   1       0 ±  0 

Results for commit 6d405a7. ± Comparison against base commit df42836.

This pull request removes 11 tests.
Hydra.TUI.Options ‑ parses --cardano-signing-key option
Hydra.TUI.Options ‑ parses --connect option
Hydra.TUI.Options ‑ parses --node-socket option
Hydra.TUI.Options ‑ parses --testnet-magic option
Hydra.TUI/end-to-end smoke tests ‑ display feedback long enough
Hydra.TUI/end-to-end smoke tests ‑ doesn't allow multiple initializations
Hydra.TUI/end-to-end smoke tests ‑ starts & renders
Hydra.TUI/end-to-end smoke tests ‑ supports the full Head life cycle
Hydra.TUI/end-to-end smoke tests ‑ supports the init & abort Head life cycle
Hydra.TUI/text rendering errors ‑ should show not enough fuel message and suggestion
…

♻️ This comment has been updated with latest results.

@ghost
Copy link
Author

ghost commented May 30, 2023

As I tried to demonstrate and explain here I do think that logs and traces are just one and the same thing seen from 2 different perspectives, eg. instruments for observability of a system, and their difference lies in how they are used. By unifying the producing side we make our system simpler and more consistent as you don't have to put in place 2 similar but slightly different systems to output logs, and output traces, and collect metrics.

@pgrange
Copy link
Contributor

pgrange commented May 30, 2023

Makes sense! I would love to see it in practice with an actual trace-exploitation tool 👍

@ghost
Copy link
Author

ghost commented May 30, 2023

Just add --monitoring-port xxxx to your hydra-node's command-line. Then for a quick test you can curl http://hydra.noe:xxx/metrics to get the metrics which are computed from the traces in raw text format.
You can also run a prometheus scrapper configured to scrape from this address and then point a web browser to your prometheus UI. This will open up an interface which you can query to retrieve tx_confirmed time IIRC. You can also do that in grafana with a scraper agent.

@pgrange pgrange force-pushed the abailly-iohk/improve-logs branch from f86c272 to 99fca5a Compare May 31, 2023 09:37
@ghost ghost force-pushed the abailly-iohk/improve-logs branch from 99fca5a to 6d405a7 Compare May 31, 2023 12:09
@ghost ghost merged commit 2c8a786 into master Jun 1, 2023
@ghost ghost deleted the abailly-iohk/improve-logs branch June 1, 2023 04:49
This pull request was closed.
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