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

Enhance explorer observations with chain time #1333

Merged
merged 27 commits into from
Mar 8, 2024

Conversation

ffakenz
Copy link
Contributor

@ffakenz ffakenz commented Feb 29, 2024

To see the "freshness" of the data:

image

To see head details:

image

To see head member commit details:

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

@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch from 8125487 to 0ef3f31 Compare February 29, 2024 16:40
Copy link

github-actions bot commented Feb 29, 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 16:35:22.711545071 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 4795 8.78 3.35 0.46
2 4995 10.72 4.10 0.49
3 5197 12.66 4.84 0.52
5 5597 16.47 6.30 0.58
10 6605 26.22 10.05 0.73
48 14245 99.81 38.30 1.86

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 594 10.24 4.04 0.29
2 780 13.88 5.64 0.34
3 969 17.66 7.29 0.39
5 1345 25.66 10.74 0.49
10 2285 48.19 20.30 0.79
19 3960 97.83 40.79 1.41

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 548 16.88 6.67 0.36
2 114 658 26.89 10.72 0.47
3 171 764 39.91 16.00 0.62
4 228 874 53.82 21.70 0.78
5 283 984 65.44 26.71 0.91
6 338 1095 83.23 34.05 1.12
7 396 1209 99.13 40.83 1.30

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 599 8.29 4.59 0.28
2 779 9.41 6.00 0.30
3 923 10.20 7.10 0.32
5 850 10.62 5.44 0.31
10 1907 15.07 14.68 0.46
50 8149 51.72 64.11 1.39

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 651 8.65 4.74 0.28
2 841 9.70 6.13 0.31
3 958 10.43 7.19 0.33
5 1223 12.01 9.37 0.37
10 2018 16.96 15.76 0.49
50 8411 53.59 65.17 1.42

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 4688 17.13 7.41 0.55
2 4788 27.96 12.18 0.67
3 4890 37.56 16.29 0.79
4 5084 57.52 25.31 1.02
5 5196 76.41 33.59 1.24
6 5357 98.32 43.30 1.49

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 4628 7.64 3.19 0.44
5 1 57 4661 9.00 3.99 0.46
5 5 285 4797 13.40 6.75 0.52
5 10 570 4968 19.58 10.49 0.60
5 20 1137 5305 30.90 17.53 0.76
5 30 1705 5645 42.64 24.76 0.92
5 40 2278 5988 54.17 31.89 1.08
5 50 2847 6326 65.50 38.95 1.24
5 79 4497 7309 98.79 59.60 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 16:38:22.036183319 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 22.608445648
P99 58.36421536000021ms
P95 32.0458837ms
P50 19.928924000000002ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.499102011
P99 7.854247349999975ms
P95 5.804648199999999ms
P50 4.322967ms
Number of Invalid txs 0

Copy link

github-actions bot commented Feb 29, 2024

Test Results

417 tests  +1   409 ✅ +1   14m 7s ⏱️ -7s
138 suites ±0     8 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 9846f0b. ± Comparison against base commit 70fde4b.

♻️ This comment has been updated with latest results.

@ffakenz ffakenz marked this pull request as ready for review February 29, 2024 16:51
@ffakenz ffakenz self-assigned this Feb 29, 2024
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.

In principle a fine change, left a requested change though as you have a leftover Maybe.

In general, this is not what I meant. It would not improve the "freshness" of the data shown as the chain points displayed in the table would stay whenever that head changed it's state. What I meant, though is to provide information about what was the latest seen block / slot of the whole explorer. So we can see something moving as time passes (even when no heads are updated).

hydra-chain-observer/src/Hydra/ChainObserver.hs Outdated Show resolved Hide resolved
hydra-chain-observer/src/Hydra/ChainObserver.hs Outdated Show resolved Hide resolved
hydra-explorer/src/Hydra/Explorer/ExplorerState.hs Outdated Show resolved Hide resolved
hydra-explorer/test/Hydra/Explorer/ExplorerStateSpec.hs Outdated Show resolved Hide resolved
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch 2 times, most recently from f2b6c70 to 1561381 Compare March 1, 2024 15:29
hydra-chain-observer/src/Hydra/ChainObserver.hs Outdated Show resolved Hide resolved
hydra-explorer/src/Hydra/Explorer/ExplorerState.hs Outdated Show resolved Hide resolved
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch 2 times, most recently from f13d914 to c481b6b Compare March 5, 2024 00:32
@ffakenz ffakenz requested a review from ch1bo March 5, 2024 21:59
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch 9 times, most recently from 5866493 to e180e66 Compare March 6, 2024 05:16
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch from e180e66 to 1776e9d Compare March 6, 2024 10:32
@ch1bo ch1bo changed the title Ehnance explorer observations with chain time Enhance explorer observations with chain time Mar 6, 2024
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch 2 times, most recently from 6903f6f to 0143eab Compare March 7, 2024 01:06
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch from 138269d to 13b7b1a Compare March 7, 2024 10:36
@ffakenz ffakenz requested a review from ch1bo March 7, 2024 15:23
@ffakenz ffakenz force-pushed the ehnance-explorer-observations-with-time branch from 4b4ced4 to 5a8d7e8 Compare March 7, 2024 15:29
ffakenz and others added 27 commits March 8, 2024 17:32
This resolves a FIXME: To avoid having to work around NoHeadTx.
To see the freshness of the data.
To see the freshness of the date at /heads endpoint.
To see the "freshness" of the data.
To avoid using Maybe type to represent head observations.
To obtain latest point in time observed on chain.
We were missing to produce tick observations when observed transactions
were no head transactions.
Enhance web HeadState model.
Refactor HeadsTable into HeadsDataProvider:
- to be able to reuse the /heads fetched data in multiple components.
To not overflow when having many participants.
Also:
- removed unnecessary header type
- sort the heads table based on block number
- set pulling /heads data on by default
- add links to sancho.cexplorer
This way we can use the Options type as early as possible.
This adds the blanket content source policy on all responses handled by
the httpApp.
Using suchThat may lead to suboptimal generators while creating the
value we want from its constituents is always a better option (if possible).
Uses the package-specific ResponseMatcher with its MatchHeader and
MatchBody constructors to hook things up with the openapi schema
validation.
@ch1bo ch1bo force-pushed the ehnance-explorer-observations-with-time branch from 9d25c66 to 1e438a7 Compare March 8, 2024 16:32
@ch1bo ch1bo merged commit 536f012 into master Mar 8, 2024
20 checks passed
@ch1bo ch1bo deleted the ehnance-explorer-observations-with-time branch March 8, 2024 17:39
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.

Build and deploy a Hydra heads explorer
3 participants