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

Report error on unsupported era #1219

Merged
merged 38 commits into from
Dec 22, 2023
Merged

Report error on unsupported era #1219

merged 38 commits into from
Dec 22, 2023

Conversation

locallycompact
Copy link
Contributor

@locallycompact locallycompact commented Dec 14, 2023

Required for Conway Support #1177

⛄ Add e2e tests to check the hydra-node survives a fork (like Conway) and report on unsupported era:

  • while running
  • on startup: here, because publishHydraScriptsAs does not supports the new era Conway, we had to delay the fork so that the hydra scripts are published under the current supported Babbage.

⛄ throw EraNotSupportedException in the direct chain component when we detect blocks from a different era.

⛄ Use displayException in hydra-node to explain exceptions rised during a change of era, like:

  • EraNotSupportedException
  • QueryEraMismatchException

We are also migrating the ConfigurationExceptions to use displayException to 'explain' on the hydra-node 'Run' case.

⛄ Implement helper function (forkIntoConwayInEpoch) to simulate a change of era, by using a cardano-config file that will trigger a fork in the cardano-node when it reaches a certain epoch.

⛄ Enhance cardano-node setup in devnet.

⛄ Add missing genDelegs attribute to genesis-conway config file, as is needed for cardano-node to run and produce Conway blocks in devnet.

⛄ Reduce epochLength in genesis-shelley config file, to trigger a fork in the cardano-node faster.


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

@locallycompact locallycompact changed the title Ensemble/survive conway fork Report error on unsupported era Dec 14, 2023
@ch1bo ch1bo marked this pull request as draft December 18, 2023 10:42
Copy link

github-actions bot commented Dec 18, 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-12-22 14:19:45.778270404 UTC
Max. memory units 14000000
Max. CPU units 10000000000
Max. tx size (kB) 16384

Script summary

Name Hash Size (Bytes)
νInitial 985245919fcc6c0c5cd116023cd2c947c43e80dcbb5075fe12433fbb 4072
νCommit 7cb20fa71eb4c563ca283566ebe0aa65859d96c3f8cba35c52c181fd 2043
νHead 7a36661f5c15e9f1783aeaab890812c59b7286cbbc6de762d3110772 8816
μHead 8b111ac12274e46314769295a1c5dcab1d260096fc469fd698065463* 3851
  • 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 4375 10.25 3.95 0.45
2 4573 12.57 4.83 0.49
3 4777 14.87 5.71 0.52
5 5179 19.12 7.31 0.59
10 6182 30.30 11.55 0.75
41 12418 99.02 37.59 1.77

Cost of Commit Transaction

This is using ada-only outputs for better comparability.

UTxO Tx size % max Mem % max CPU Min fee ₳
1 534 11.37 4.44 0.30
2 724 15.04 6.07 0.35
3 907 18.85 7.75 0.40
5 1285 26.90 11.27 0.51
10 2218 49.55 20.97 0.80
19 3897 99.43 41.75 1.43

Cost of CollectCom Transaction

Parties UTxO (bytes) Tx size % max Mem % max CPU Min fee ₳
1 57 480 21.12 8.27 0.40
2 114 590 33.21 13.10 0.54
3 169 700 46.02 18.32 0.68
4 225 810 64.37 25.66 0.89
5 284 920 81.37 32.64 1.08
6 338 1031 97.01 39.21 1.26

Cost of Close Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 551 16.64 7.66 0.36
2 754 18.40 9.31 0.40
3 916 20.22 10.94 0.43
5 1227 23.44 13.89 0.49
10 2092 31.56 21.58 0.65
50 8891 96.91 82.69 1.92

Cost of Contest Transaction

Parties Tx size % max Mem % max CPU Min fee ₳
1 570 20.27 8.97 0.40
2 771 22.17 10.66 0.44
3 940 24.24 12.39 0.48
5 1257 27.38 15.23 0.54
10 2206 38.16 24.28 0.73
43 7880 99.85 77.71 1.86

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 4329 19.02 8.19 0.55
2 4383 27.20 11.62 0.65
3 4589 42.16 18.28 0.82
4 4843 65.93 29.06 1.11
5 4971 87.84 38.72 1.36

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 4205 8.26 3.46 0.43
5 1 57 4239 9.36 4.17 0.44
5 5 285 4375 13.98 7.09 0.51
5 10 568 4543 20.55 11.08 0.60
5 20 1136 4882 32.85 18.71 0.77
5 30 1706 5224 45.15 26.34 0.93
5 40 2278 5566 57.25 33.88 1.10
5 50 2845 5902 69.65 41.56 1.27
5 74 4218 6723 99.01 59.82 1.68

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-12-22 14:23:51.931550908 UTC

Baseline Scenario

Number of nodes 3
Number of txs 9000
Avg. Confirmation Time (ms) 24.407533913
P99 114.73398800000004ms
P95 33.666978799999974ms
P50 21.836944000000003ms
Number of Invalid txs 0

Baseline Scenario

Number of nodes 1
Number of txs 3000
Avg. Confirmation Time (ms) 4.842914443
P99 7.717165329999999ms
P95 6.490466199999995ms
P50 4.6510169999999995ms
Number of Invalid txs 0

@ch1bo ch1bo force-pushed the ensemble/survive-conway-fork branch from e3ffa36 to 2354b1b Compare December 19, 2023 14:43
@ffakenz ffakenz mentioned this pull request Dec 19, 2023
8 tasks
@ffakenz ffakenz marked this pull request as ready for review December 20, 2023 09:35
locallycompact and others added 19 commits December 20, 2023 11:34
As it seems to be confusing otherwise.
This updates the node config file by addin a field
that is going to trigger the fork at certain epoch.
Also change the approach of how to handle the create process, by using alternatives
This is not yet migrating the ConfigurationExceptions which are relying
on a call to 'explain' on the hydra-node 'Run' case.
By implementing displayException for QueryException.

publishHydraScriptsAs does not supports Conway; for that reason
we delayed the fork so that the hydra scripts are published under Babbage.
Copy link

github-actions bot commented Dec 20, 2023

Test Results

381 tests  +2   376 ✔️ +2   22m 2s ⏱️ +3s
130 suites +1       5 💤 ±0 
    5 files   ±0       0 ±0 

Results for commit a67ec3e. ± Comparison against base commit cfac902.

♻️ 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.

Nice work! I added some comments, potential improvements and perhaps one unneeded function parameter.

hydra-cluster/src/CardanoNode.hs Outdated Show resolved Hide resolved
hydra-node/exe/hydra-node/Main.hs Show resolved Hide resolved
hydra-node/src/Hydra/Chain/CardanoClient.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Chain/Direct.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/src/HydraNode.hs Outdated Show resolved Hide resolved
@ffakenz ffakenz force-pushed the ensemble/survive-conway-fork branch 2 times, most recently from 773f52d to 03d136b Compare December 20, 2023 14:14
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.

Change looks good.. but please do revert cabal.project before merging.

cabal.project Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-cluster/src/CardanoNode.hs Outdated Show resolved Hide resolved
hydra-cluster/src/CardanoNode.hs Outdated Show resolved Hide resolved
hydra-cluster/src/CardanoNode.hs Outdated Show resolved Hide resolved
hydra-cluster/test/Test/EndToEndSpec.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Chain/CardanoClient.hs Outdated Show resolved Hide resolved
hydra-node/src/Hydra/Chain/Direct.hs Outdated Show resolved Hide resolved
If we want to turn off -Werror, we should use cabal configure as
described in the contributing guidelines.
So they explicitly describe the era missmatch.

Also included some formatting changes.
By providing informationa about the era mismatch that triggered it.
Remove outdated reference to shelley genesis file from comment.
Added queryEpochNo to cardano-node client to support this operation.
@ch1bo ch1bo force-pushed the ensemble/survive-conway-fork branch from 9633771 to a22e308 Compare December 22, 2023 08:57
@ffakenz ffakenz merged commit b0c94e7 into master Dec 22, 2023
21 checks passed
@ffakenz ffakenz deleted the ensemble/survive-conway-fork branch December 22, 2023 15:27
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.

Detect era mismatch error in chain sync and inform users somewhat friendly what to do
4 participants